1 |
commit: 9816ecb58b14813d55811e0fa9f54d50324216c3 |
2 |
Author: Dominick Grift <dominick.grift <AT> gmail <DOT> com> |
3 |
AuthorDate: Fri Sep 27 16:28:52 2013 +0000 |
4 |
Commit: Sven Vermeulen <swift <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Sep 30 19:03:06 2013 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-refpolicy.git;a=commit;h=9816ecb5 |
7 |
|
8 |
alsa: due to a bug in gnome 3.4, in debian, alsactl does all kinds of weird things related to pulseaudio |
9 |
|
10 |
Signed-off-by: Dominick Grift <dominick.grift <AT> gmail.com> |
11 |
|
12 |
--- |
13 |
policy/modules/contrib/alsa.fc | 4 ++++ |
14 |
policy/modules/contrib/alsa.te | 25 +++++++++++++++++++------ |
15 |
2 files changed, 23 insertions(+), 6 deletions(-) |
16 |
|
17 |
diff --git a/policy/modules/contrib/alsa.fc b/policy/modules/contrib/alsa.fc |
18 |
index 5de1e01..33d9d31 100644 |
19 |
--- a/policy/modules/contrib/alsa.fc |
20 |
+++ b/policy/modules/contrib/alsa.fc |
21 |
@@ -1,5 +1,9 @@ |
22 |
HOME_DIR/\.asoundrc -- gen_context(system_u:object_r:alsa_home_t,s0) |
23 |
|
24 |
+ifdef(`distro_debian',` |
25 |
+/\.config(/.*)? gen_context(system_u:object_r:alsa_var_lib_t,s0) |
26 |
+') |
27 |
+ |
28 |
/bin/alsaunmute -- gen_context(system_u:object_r:alsa_exec_t,s0) |
29 |
|
30 |
/etc/alsa/asound\.state -- gen_context(system_u:object_r:alsa_etc_rw_t,s0) |
31 |
|
32 |
diff --git a/policy/modules/contrib/alsa.te b/policy/modules/contrib/alsa.te |
33 |
index 595a217..78d134a 100644 |
34 |
--- a/policy/modules/contrib/alsa.te |
35 |
+++ b/policy/modules/contrib/alsa.te |
36 |
@@ -20,8 +20,6 @@ files_tmp_file(alsa_tmp_t) |
37 |
|
38 |
type alsa_tmpfs_t; |
39 |
files_tmpfs_file(alsa_tmpfs_t) |
40 |
-pulseaudio_tmpfs_content(alsa_tmpfs_t) |
41 |
-dev_associate(alsa_tmpfs_t) |
42 |
|
43 |
type alsa_var_lib_t; |
44 |
files_type(alsa_var_lib_t) |
45 |
@@ -72,8 +70,6 @@ dev_write_sound(alsa_t) |
46 |
files_read_usr_files(alsa_t) |
47 |
files_search_var_lib(alsa_t) |
48 |
|
49 |
-fs_list_tmpfs(alsa_t) |
50 |
- |
51 |
term_dontaudit_use_console(alsa_t) |
52 |
term_dontaudit_use_generic_ptys(alsa_t) |
53 |
term_dontaudit_use_all_ptys(alsa_t) |
54 |
@@ -90,8 +86,25 @@ userdom_manage_unpriv_user_semaphores(alsa_t) |
55 |
userdom_manage_unpriv_user_shared_mem(alsa_t) |
56 |
userdom_search_user_home_dirs(alsa_t) |
57 |
|
58 |
-optional_policy(` |
59 |
- dbus_read_lib_files(alsa_t) |
60 |
+ifdef(`distro_debian',` |
61 |
+ # Gnome 3.4 bug |
62 |
+ dev_associate(alsa_tmpfs_t) |
63 |
+ |
64 |
+ allow alsa_t self:capability kill; |
65 |
+ |
66 |
+ manage_lnk_files_pattern(alsa_t, alsa_var_lib_t, alsa_var_lib_t) |
67 |
+ files_root_filetrans(alsa_t, alsa_var_lib_t, dir, ".config") |
68 |
+ |
69 |
+ fs_getattr_tmpfs(alsa_t) |
70 |
+ fs_list_tmpfs(alsa_t) |
71 |
+ |
72 |
+ optional_policy(` |
73 |
+ dbus_read_lib_files(alsa_t) |
74 |
+ ') |
75 |
+ |
76 |
+ optional_policy(` |
77 |
+ pulseaudio_tmpfs_content(alsa_tmpfs_t) |
78 |
+ ') |
79 |
') |
80 |
|
81 |
optional_policy(` |