Gentoo Archives: gentoo-commits

From: Jason Zaman <perfinion@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/hardened-refpolicy:master commit in: policy/modules/contrib/
Date: Sun, 30 Apr 2017 09:32:48
Message-Id: 1493543572.cb26336af2009ff82257bb3d49f0630259471070.perfinion@gentoo
1 commit: cb26336af2009ff82257bb3d49f0630259471070
2 Author: Guido Trentalancia <guido <AT> trentalancia <DOT> net>
3 AuthorDate: Sun Apr 16 22:39:36 2017 +0000
4 Commit: Jason Zaman <perfinion <AT> gentoo <DOT> org>
5 CommitDate: Sun Apr 30 09:12:52 2017 +0000
6 URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=cb26336a
7
8 wm: interactive start
9
10 Update the window manager (wm) module (support starting
11 gnome-shell from an X terminal).
12
13 This second version curbs on an open permission when dealing with the user terminal (terminal is already opened by the X terminal application, thanks to Christian Göttsche for the tip).
14
15 Signed-off-by: Guido Trentalancia <guido <AT> trentalancia.net>
16
17 policy/modules/contrib/wm.if | 27 +++++++++++++++++++++++++++
18 policy/modules/contrib/wm.te | 7 ++++++-
19 2 files changed, 33 insertions(+), 1 deletion(-)
20
21 diff --git a/policy/modules/contrib/wm.if b/policy/modules/contrib/wm.if
22 index dbe32237..e8fd7706 100644
23 --- a/policy/modules/contrib/wm.if
24 +++ b/policy/modules/contrib/wm.if
25 @@ -73,6 +73,8 @@ template(`wm_role_template',`
26 xserver_role($2, $1_wm_t)
27 xserver_manage_core_devices($1_wm_t)
28
29 + wm_write_pipes($1, $3)
30 +
31 optional_policy(`
32 dbus_connect_spec_session_bus($1, $1_wm_t)
33 dbus_spec_session_bus_client($1, $1_wm_t)
34 @@ -219,3 +221,28 @@ interface(`wm_application_domain',`
35 userdom_user_application_domain($1, $2)
36 domtrans_pattern(wm_domain, $2, $1)
37 ')
38 +
39 +########################################
40 +### <summary>
41 +### Write wm unnamed pipes.
42 +### </summary>
43 +## <param name="role_prefix">
44 +### <summary>
45 +### The prefix of the user domain (e.g., user
46 +### is the prefix for user_t).
47 +### </summary>
48 +### </param>
49 +### <param name="domain">
50 +### <summary>
51 +### Domain allowed access.
52 +### </summary>
53 +### </param>
54 +### </param>
55 +##
56 +interface(`wm_write_pipes',`
57 + gen_require(`
58 + type $1_t;
59 + ')
60 +
61 + allow $2 $1_wm_t:fifo_file write;
62 +')
63
64 diff --git a/policy/modules/contrib/wm.te b/policy/modules/contrib/wm.te
65 index 77dcc432..5b39df69 100644
66 --- a/policy/modules/contrib/wm.te
67 +++ b/policy/modules/contrib/wm.te
68 @@ -64,6 +64,8 @@ kernel_read_fs_sysctls(wm_domain)
69 kernel_read_proc_symlinks(wm_domain)
70 kernel_read_sysctl(wm_domain)
71
72 +locallogin_dontaudit_use_fds(wm_domain)
73 +
74 miscfiles_read_fonts(wm_domain)
75 miscfiles_read_generic_certs(wm_domain)
76 miscfiles_read_localization(wm_domain)
77 @@ -72,13 +74,16 @@ networkmanager_read_etc_files(wm_domain)
78
79 udev_read_pid_files(wm_domain)
80
81 -# this is needed by gnome-shell
82 +# the following is needed by gnome-shell
83 userdom_exec_user_home_content_files(wm_domain)
84
85 userdom_manage_user_tmp_sockets(wm_domain)
86 userdom_tmp_filetrans_user_tmp(wm_domain, sock_file)
87 userdom_user_runtime_filetrans_user_tmp(wm_domain, sock_file)
88
89 +# to print error messages
90 +userdom_use_inherited_user_terminals(wm_domain)
91 +
92 userdom_manage_user_home_content_dirs(wm_domain)
93 userdom_manage_user_home_content_files(wm_domain)