Skip to contentSkip to conversation

dbus: move comments out of the file context definitions

PATCH New Nicolas Iooss 2 participants 2 messages Aug 23, 2017 – Aug 24, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dbus: move comments out of the file context definitions

When loading module dbus from Reference Policy's git master, semodule fails:

Invalid syntax
Bad context
Bad filecon declaration at /var/lib/selinux/refpolicy/tmp/modules/400/dbus/cil:734
semodule: Failed!

"/usr/lib/selinux/hll/pp dbus.pp" generates the following lines (prefixed by the line number):

733 (filecon "/usr/bin/dbus-daemon(-1)?" file (system_u object_r
dbusd_exec_t (systemlow systemlow)))
734 (filecon "/usr/bin/dbus-broker-launch" file (system_u object_r
dbusd_exec_t # needed by dbus-broker (systemlow systemlow)))
735 (filecon "/usr/bin/dbus-broker" file (system_u object_r
dbusd_exec_t # needed by dbus-broker (systemlow systemlow)))

The comments need to be on their own lines in order to be ignored by semodule.

---
 dbus.fc | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
dbus.fc +4 -2
index c18fd7fd292e..e9a13ee9915f 100644
@@ -8,8 +8,10 @@ HOME_DIR/\.dbus(/.*)?				gen_context(system_u:object_r:session_dbusd_home_t,s0)
 /run/user/%{USERID}/dbus-1(/.*)?		gen_context(system_u:object_r:session_dbusd_runtime_t,s0)
 
 /usr/bin/dbus-daemon(-1)?		--	gen_context(system_u:object_r:dbusd_exec_t,s0)
-/usr/bin/dbus-broker-launch		--	gen_context(system_u:object_r:dbusd_exec_t,s0) # needed by dbus-broker
-/usr/bin/dbus-broker			--	gen_context(system_u:object_r:dbusd_exec_t,s0) # needed by dbus-broker
+
+# needed by dbus-broker
+/usr/bin/dbus-broker-launch		--	gen_context(system_u:object_r:dbusd_exec_t,s0)
+/usr/bin/dbus-broker			--	gen_context(system_u:object_r:dbusd_exec_t,s0)
 
 /usr/lib/dbus-.*/dbus-daemon-launch-helper	--	gen_context(system_u:object_r:dbusd_exec_t,s0)
 
Signature · 1 line
2.14.1
#1 lore raw

PATCH 1/1 dbus: move comments out of the file context definitions

Quoted 31 lines · Nicolas Iooss via refpolicy

When loading module dbus from Reference Policy's git master, semodule fails:

Invalid syntax
Bad context
Bad filecon declaration at /var/lib/selinux/refpolicy/tmp/modules/400/dbus/cil:734
semodule: Failed!

"/usr/lib/selinux/hll/pp dbus.pp" generates the following lines (prefixed by the line number):

733 (filecon "/usr/bin/dbus-daemon(-1)?" file (system_u object_r
dbusd_exec_t (systemlow systemlow)))
734 (filecon "/usr/bin/dbus-broker-launch" file (system_u object_r
dbusd_exec_t # needed by dbus-broker (systemlow systemlow)))
735 (filecon "/usr/bin/dbus-broker" file (system_u object_r
dbusd_exec_t # needed by dbus-broker (systemlow systemlow)))

The comments need to be on their own lines in order to be ignored by semodule.

---
  dbus.fc | 6 ++++--
  1 file changed, 4 insertions(+), 2 deletions(-)
dbus.fc +0 -0
index c18fd7fd292e..e9a13ee9915f 100644
@@ -8,8 +8,10 @@ HOME_DIR/\.dbus(/.*)?				gen_context(system_u:object_r:session_dbusd_home_t,s0)
  /run/user/%{USERID}/dbus-1(/.*)?		gen_context(system_u:object_r:session_dbusd_runtime_t,s0)

dbus.fc HOME_DIR/\.dbus(/.*)? gen_context(system_u:object_r:session_dbusd_home_t,s0) · line 16

Quoted 10 lines
dbus.fc +4 -2
 
  /usr/bin/dbus-daemon(-1)?		--	gen_context(system_u:object_r:dbusd_exec_t,s0)
-/usr/bin/dbus-broker-launch		--	gen_context(system_u:object_r:dbusd_exec_t,s0) # needed by dbus-broker
-/usr/bin/dbus-broker			--	gen_context(system_u:object_r:dbusd_exec_t,s0) # needed by dbus-broker
+
+# needed by dbus-broker
+/usr/bin/dbus-broker-launch		--	gen_context(system_u:object_r:dbusd_exec_t,s0)
+/usr/bin/dbus-broker			--	gen_context(system_u:object_r:dbusd_exec_t,s0)
 
  /usr/lib/dbus-.*/dbus-daemon-launch-helper	--	gen_context(system_u:object_r:dbusd_exec_t,s0)

Merged.

Signature · 1 line
Chris PeBenito