~ubuntu-branches/ubuntu/dapper/selinux-policy-default/dapper

« back to all changes in this revision

Viewing changes to macros/program/xauth_macros.te

  • Committer: Bazaar Package Importer
  • Author(s): Russell Coker
  • Date: 2004-06-10 18:08:00 UTC
  • Revision ID: james.westby@ubuntu.com-20040610180800-gagxr0cdovi7mv2i
Tags: upstream-1.12
ImportĀ upstreamĀ versionĀ 1.12

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#
 
2
# Macros for xauth domains.
 
3
#
 
4
 
 
5
#
 
6
# Author:  Russell Coker <russell@coker.com.au>
 
7
#
 
8
 
 
9
#
 
10
# xauth_domain(domain_prefix)
 
11
#
 
12
# Define a derived domain for the xauth program when executed
 
13
# by a user domain.
 
14
#
 
15
# The type declaration for the executable type for this program is
 
16
# provided separately in domains/program/xauth.te. 
 
17
#
 
18
undefine(`xauth_domain')
 
19
ifdef(`xauth.te', `
 
20
define(`xauth_domain',`
 
21
ifdef(`single_userdomain', `
 
22
typealias $1_home_t alias $1_home_xauth_t;
 
23
typealias $1_t alias $1_xauth_t;
 
24
', `
 
25
# Derived domain based on the calling user domain and the program.
 
26
type $1_xauth_t, domain;
 
27
type $1_home_xauth_t, file_type, homedirfile, sysadmfile;
 
28
 
 
29
ifdef(`slocate.te', `
 
30
allow $1_locate_t $1_home_xauth_t:file { getattr read };
 
31
')
 
32
 
 
33
allow $1_xauth_t self:process signal;
 
34
 
 
35
allow $1_t $1_home_xauth_t:file { relabelfrom relabelto create_file_perms };
 
36
 
 
37
# Transition from the user domain to this domain.
 
38
domain_auto_trans($1_t, xauth_exec_t, $1_xauth_t)
 
39
ifdef(`ssh.te', `
 
40
domain_auto_trans($1_ssh_t, xauth_exec_t, $1_xauth_t)
 
41
allow $1_xauth_t sshd_t:fifo_file { getattr read };
 
42
dontaudit $1_xauth_t $1_ssh_t:tcp_socket { read write };
 
43
allow $1_xauth_t sshd_t:process sigchld;
 
44
')dnl end if ssh
 
45
 
 
46
# The user role is authorized for this domain.
 
47
role $1_r types $1_xauth_t;
 
48
 
 
49
# Inherit and use descriptors from gnome-pty-helper.
 
50
ifdef(`gnome-pty-helper.te', `
 
51
allow $1_xauth_t $1_gph_t:fd use;
 
52
')
 
53
 
 
54
allow $1_xauth_t privfd:fd use;
 
55
 
 
56
# allow ps to show xauth
 
57
allow $1_t $1_xauth_t:dir { search getattr read };
 
58
allow $1_t $1_xauth_t:{ file lnk_file } { read getattr };
 
59
allow $1_t $1_xauth_t:process signal;
 
60
 
 
61
uses_shlib($1_xauth_t)
 
62
 
 
63
# allow DNS lookups...
 
64
can_network($1_xauth_t)
 
65
can_ypbind($1_xauth_t)
 
66
ifdef(`named.te', `
 
67
can_udp_send($1_xauth_t, named_t)
 
68
can_udp_send(named_t, $1_xauth_t)
 
69
')dnl end if named.te
 
70
 
 
71
allow $1_xauth_t self:unix_stream_socket create_stream_socket_perms;
 
72
allow $1_xauth_t etc_t:file { getattr read };
 
73
allow $1_xauth_t fs_t:filesystem getattr;
 
74
 
 
75
# Write to the user domain tty.
 
76
allow $1_xauth_t $1_tty_device_t:chr_file rw_file_perms;
 
77
allow $1_xauth_t $1_devpts_t:chr_file rw_file_perms;
 
78
 
 
79
# Scan /var/run.
 
80
allow $1_xauth_t var_t:dir search;
 
81
allow $1_xauth_t var_run_t:dir search; 
 
82
 
 
83
# this is what we are here for
 
84
allow $1_xauth_t home_root_t:dir search;
 
85
file_type_auto_trans($1_xauth_t, $1_home_dir_t, $1_home_xauth_t, file)
 
86
 
 
87
tmp_domain($1_xauth)
 
88
 
 
89
allow $1_xauth_t $1_tmp_t:file { getattr ioctl read };
 
90
allow $1_xauth_t tmp_t:dir { search };
 
91
 
 
92
ifdef(`nfs_home_dirs', `
 
93
ifdef(`automount.te', `
 
94
allow $1_xauth_t autofs_t:dir { search getattr };
 
95
')
 
96
rw_dir_create_file($1_xauth_t, nfs_t)
 
97
')dnl end nfs_home_dirs
 
98
')dnl end ifdef single_userdomain
 
99
')dnl end xauth_domain macro
 
100
 
 
101
', `
 
102
 
 
103
define(`xauth_domain',`')
 
104
 
 
105
')dnl end if xauth.te