~ubuntu-branches/ubuntu/natty/refpolicy-ubuntu/natty

« back to all changes in this revision

Viewing changes to policy/modules/apps/pulseaudio.if

  • Committer: Bazaar Package Importer
  • Author(s): Caleb Case
  • Date: 2009-10-19 01:48:39 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20091019014839-0rpi67ygkrjya30k
Tags: 0.2.20090730-0ubuntu1
* Updated to upstream release 2.20090730
* Handle Upstart direct execution of daemons.
* Pre-depend on selinux to ensure that the trigger is handled (LP: #434084).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
## <summary>Pulseaudio network sound server.</summary>
 
2
 
 
3
########################################
 
4
## <summary>
 
5
##      Role access for pulseaudio
 
6
## </summary>
 
7
## <param name="role">
 
8
##      <summary>
 
9
##      Role allowed access
 
10
##      </summary>
 
11
## </param>
 
12
## <param name="domain">
 
13
##      <summary>
 
14
##      User domain for the role
 
15
##      </summary>
 
16
## </param>
 
17
#
 
18
interface(`pulseaudio_role',`
 
19
        gen_require(`
 
20
                type pulseaudio_t, pulseaudio_exec_t, print_spool_t;
 
21
                class dbus { send_msg };
 
22
        ')
 
23
 
 
24
        role $1 types pulseaudio_t;
 
25
 
 
26
        # Transition from the user domain to the derived domain.
 
27
        domtrans_pattern($2, pulseaudio_exec_t, pulseaudio_t)
 
28
 
 
29
        ps_process_pattern($2, pulseaudio_t)
 
30
 
 
31
        allow pulseaudio_t $2:process { signal signull };
 
32
        allow $2 pulseaudio_t:process { signal signull };
 
33
        ps_process_pattern(pulseaudio_t, $2)
 
34
 
 
35
        allow pulseaudio_t $2:unix_stream_socket connectto;
 
36
        allow $2 pulseaudio_t:unix_stream_socket connectto;
 
37
 
 
38
        userdom_manage_home_role($1, pulseaudio_t)
 
39
        userdom_manage_tmp_role($1, pulseaudio_t)
 
40
        userdom_manage_tmpfs_role($1, pulseaudio_t)
 
41
 
 
42
        allow $2 pulseaudio_t:dbus send_msg;
 
43
        allow pulseaudio_t $2:dbus send_msg;
 
44
')
 
45
 
 
46
########################################
 
47
## <summary>
 
48
##      Execute a domain transition to run pulseaudio.
 
49
## </summary>
 
50
## <param name="domain">
 
51
## <summary>
 
52
##      Domain allowed to transition.
 
53
## </summary>
 
54
## </param>
 
55
#
 
56
interface(`pulseaudio_domtrans',`
 
57
        gen_require(`
 
58
                type pulseaudio_t, pulseaudio_exec_t;
 
59
        ')
 
60
 
 
61
        domtrans_pattern($1,pulseaudio_exec_t,pulseaudio_t)
 
62
')
 
63
 
 
64
########################################
 
65
## <summary>
 
66
##      Execute pulseaudio in the pulseaudio domain, and
 
67
##      allow the specified role the pulseaudio domain.
 
68
## </summary>
 
69
## <param name="domain">
 
70
##      <summary>
 
71
##      Domain allowed access.
 
72
##      </summary>
 
73
## </param>
 
74
## <param name="role">
 
75
##      <summary>
 
76
##      The role to be allowed the pulseaudio domain.
 
77
##      </summary>
 
78
## </param>
 
79
#
 
80
interface(`pulseaudio_run',`
 
81
        gen_require(`
 
82
                type pulseaudio_t;
 
83
        ')
 
84
 
 
85
        pulseaudio_domtrans($1)
 
86
        role $2 types pulseaudio_t;
 
87
')
 
88
 
 
89
########################################
 
90
## <summary>
 
91
##      Execute a pulseaudio in the current domain
 
92
## </summary>
 
93
## <param name="domain">
 
94
## <summary>
 
95
##      Domain allowed to transition.
 
96
## </summary>
 
97
## </param>
 
98
#
 
99
interface(`pulseaudio_exec',`
 
100
        gen_require(`
 
101
                type pulseaudio_exec_t;
 
102
        ')
 
103
 
 
104
        can_exec($1,pulseaudio_exec_t)
 
105
')
 
106
 
 
107
########################################
 
108
## <summary>
 
109
##      Send and receive messages from
 
110
##      pulseaudio over dbus.
 
111
## </summary>
 
112
## <param name="domain">
 
113
##      <summary>
 
114
##      Domain allowed access.
 
115
##      </summary>
 
116
## </param>
 
117
#
 
118
interface(`pulseaudio_dbus_chat',`
 
119
        gen_require(`
 
120
                type pulseaudio_t;
 
121
                class dbus send_msg;
 
122
        ')
 
123
 
 
124
        allow $1 pulseaudio_t:dbus send_msg;
 
125
        allow pulseaudio_t $1:dbus send_msg;
 
126
')
 
127
 
 
128
########################################
 
129
## <summary>
 
130
##      pulsaudio connection template.
 
131
## </summary>
 
132
## <param name="user_domain">
 
133
##      <summary>
 
134
##      The type of the user domain.
 
135
##      </summary>
 
136
## </param>
 
137
#
 
138
interface(`pulseaudio_stream_connect',`
 
139
        gen_require(`
 
140
                type pulseaudio_t;
 
141
        ')
 
142
 
 
143
        allow $1 pulseaudio_t:process signull;
 
144
        allow $1 pulseaudio_t:unix_stream_socket connectto;
 
145
')