All of lore.kernel.org
 help / color / mirror / Atom feed
* [refpolicy] [PATCH] misc fc changes again
@ 2017-04-05  4:24 Russell Coker
  2017-04-05 18:21 ` cgzones
  2017-04-06 21:01 ` Chris PeBenito
  0 siblings, 2 replies; 5+ messages in thread
From: Russell Coker @ 2017-04-05  4:24 UTC (permalink / raw)
  To: refpolicy

Here's another copy of that patch, with the requested changes and without
the /etc/ssl change.

Index: refpolicy-2.20170402/policy/modules/contrib/acct.fc
===================================================================
--- refpolicy-2.20170402.orig/policy/modules/contrib/acct.fc
+++ refpolicy-2.20170402/policy/modules/contrib/acct.fc
@@ -1,5 +1,3 @@
-/etc/cron\.(daily|monthly)/acct	--	gen_context(system_u:object_r:acct_exec_t,s0)
-
 /etc/rc\.d/init\.d/psacct	--	gen_context(system_u:object_r:acct_initrc_exec_t,s0)
 
 /usr/sbin/accton	--	gen_context(system_u:object_r:acct_exec_t,s0)
Index: refpolicy-2.20170402/policy/modules/contrib/apache.fc
===================================================================
--- refpolicy-2.20170402.orig/policy/modules/contrib/apache.fc
+++ refpolicy-2.20170402/policy/modules/contrib/apache.fc
@@ -86,6 +86,7 @@ ifdef(`distro_suse',`
 /usr/share/mythtv/data(/.*)?	gen_context(system_u:object_r:httpd_sys_content_t,s0)
 /usr/share/ntop/html(/.*)?	gen_context(system_u:object_r:httpd_sys_content_t,s0)
 /usr/share/openca/htdocs(/.*)?	gen_context(system_u:object_r:httpd_sys_content_t,s0)
+/usr/share/postfixadmin/templates_c(/.*)?	gen_context(system_u:object_r:httpd_sys_rw_content_t,s0)
 /usr/share/selinux-policy[^/]*/html(/.*)?	gen_context(system_u:object_r:httpd_sys_content_t,s0)
 /usr/share/wordpress/.*\.php	--	gen_context(system_u:object_r:httpd_sys_script_exec_t,s0)
 /usr/share/wordpress-mu/wp-config\.php	--	gen_context(system_u:object_r:httpd_sys_script_exec_t,s0)
Index: refpolicy-2.20170402/policy/modules/contrib/apt.fc
===================================================================
--- refpolicy-2.20170402.orig/policy/modules/contrib/apt.fc
+++ refpolicy-2.20170402/policy/modules/contrib/apt.fc
@@ -14,6 +14,7 @@ ifndef(`distro_redhat',`
 
 /var/lib/apt(/.*)?	gen_context(system_u:object_r:apt_var_lib_t,s0)
 /var/lib/aptitude(/.*)?	gen_context(system_u:object_r:apt_var_lib_t,s0)
+/var/lib/apt-xapian-inde(x)(/.*)?	gen_context(system_u:object_r:apt_var_lib_t,s0)
 
 /var/lock/aptitude	gen_context(system_u:object_r:apt_lock_t,s0)
 
Index: refpolicy-2.20170402/policy/modules/contrib/dirmngr.fc
===================================================================
--- refpolicy-2.20170402.orig/policy/modules/contrib/dirmngr.fc
+++ refpolicy-2.20170402/policy/modules/contrib/dirmngr.fc
@@ -7,6 +7,7 @@
 /var/log/dirmngr(/.*)?	gen_context(system_u:object_r:dirmngr_log_t,s0)
 
 /var/lib/dirmngr(/.*)?	gen_context(system_u:object_r:dirmngr_var_lib_t,s0)
+/var/cache/dirmngr(/.*)?	gen_context(system_u:object_r:dirmngr_var_lib_t,s0)
 
 /run/dirmngr\.pid	--	gen_context(system_u:object_r:dirmngr_var_run_t,s0)
 
Index: refpolicy-2.20170402/policy/modules/contrib/dpkg.fc
===================================================================
--- refpolicy-2.20170402.orig/policy/modules/contrib/dpkg.fc
+++ refpolicy-2.20170402/policy/modules/contrib/dpkg.fc
@@ -4,6 +4,7 @@
 /usr/bin/dpkg	--	gen_context(system_u:object_r:dpkg_exec_t,s0)
 /usr/bin/dselect	--	gen_context(system_u:object_r:dpkg_exec_t,s0)
 
+/var/lib/debtags(/.*)?	gen_context(system_u:object_r:dpkg_var_lib_t,s0)
 /var/lib/dpkg(/.*)?	gen_context(system_u:object_r:dpkg_var_lib_t,s0)
 /var/lib/dpkg/(meth)?lock	--	gen_context(system_u:object_r:dpkg_lock_t,s0)
 
Index: refpolicy-2.20170402/policy/modules/kernel/corecommands.fc
===================================================================
--- refpolicy-2.20170402.orig/policy/modules/kernel/corecommands.fc
+++ refpolicy-2.20170402/policy/modules/kernel/corecommands.fc
@@ -151,6 +151,7 @@ ifdef(`distro_gentoo',`
 /usr/bin/zsh.*			--	gen_context(system_u:object_r:shell_exec_t,s0)
 
 /usr/lib/(.*/)?bin(/.*)?		gen_context(system_u:object_r:bin_t,s0)
+/usr/lib/postfix/configure-instance.sh -- gen_context(system_u:object_r:bin_t,s0)
 
 /usr/(.*/)?sbin(/.*)?			gen_context(system_u:object_r:bin_t,s0)
 /usr/lib/(.*/)?sbin(/.*)?		gen_context(system_u:object_r:bin_t,s0)
@@ -158,6 +159,7 @@ ifdef(`distro_gentoo',`
 /usr/lib/at-spi2-core(/.*)?		gen_context(system_u:object_r:bin_t,s0)
 /usr/lib/avahi/avahi-daemon-check-dns\.sh	--	gen_context(system_u:object_r:bin_t,s0)
 /usr/lib/ccache/bin(/.*)?		gen_context(system_u:object_r:bin_t,s0)
+/usr/lib/dovecot/.+			gen_context(system_u:object_r:bin_t,s0)
 /usr/lib/fence(/.*)?			gen_context(system_u:object_r:bin_t,s0)
 /usr/lib/pgsql/test/regress/.*\.sh --	gen_context(system_u:object_r:bin_t,s0)
 /usr/lib/qt.*/bin(/.*)?			gen_context(system_u:object_r:bin_t,s0)
@@ -201,6 +203,7 @@ ifdef(`distro_gentoo',`
 /usr/lib/rpm/rpmq		-- 	gen_context(system_u:object_r:bin_t,s0)
 /usr/lib/rpm/rpmv		-- 	gen_context(system_u:object_r:bin_t,s0)
 /usr/lib/security/pam_krb5/pam_krb5_storetmp -- gen_context(system_u:object_r:bin_t,s0)
+/usr/lib/selinux/hll/pp		--	gen_context(system_u:object_r:bin_t,s0)
 /usr/lib/sftp-server		--	gen_context(system_u:object_r:bin_t,s0)
 /usr/lib/ssh(/.*)?			gen_context(system_u:object_r:bin_t,s0)
 /usr/lib/sudo/sesh		--	gen_context(system_u:object_r:shell_exec_t,s0)
@@ -259,6 +262,7 @@ ifdef(`distro_gentoo',`
 /usr/sbin/sesh			--	gen_context(system_u:object_r:shell_exec_t,s0)
 /usr/sbin/smrsh			--	gen_context(system_u:object_r:shell_exec_t,s0)
 
+/usr/share/mdadm/checkarray	--	gen_context(system_u:object_r:bin_t,s0)
 /usr/share/(.*/)?bin(/.*)?		gen_context(system_u:object_r:bin_t,s0)
 /usr/share/ajaxterm/ajaxterm.py.* --	gen_context(system_u:object_r:bin_t,s0)
 /usr/share/ajaxterm/qweb.py.* --	gen_context(system_u:object_r:bin_t,s0)
@@ -289,6 +293,7 @@ ifdef(`distro_gentoo',`
 /usr/share/printconf/util/print\.py --	gen_context(system_u:object_r:bin_t,s0)
 /usr/share/PackageKit/pk-upgrade-distro\.sh -- 	gen_context(system_u:object_r:bin_t,s0)
 /usr/share/PackageKit/helpers(/.*)?	gen_context(system_u:object_r:bin_t,s0)
+/usr/share/reportbug/handle_bugscript -- gen_context(system_u:object_r:bin_t,s0)
 /usr/share/sandbox/sandboxX.sh	--	gen_context(system_u:object_r:bin_t,s0)
 /usr/share/sectool/.*\.py	--	gen_context(system_u:object_r:bin_t,s0)
 /usr/share/selinux/devel/policygentool -- gen_context(system_u:object_r:bin_t,s0)
Index: refpolicy-2.20170402/policy/modules/kernel/files.fc
===================================================================
--- refpolicy-2.20170402.orig/policy/modules/kernel/files.fc
+++ refpolicy-2.20170402/policy/modules/kernel/files.fc
@@ -215,6 +215,7 @@ HOME_ROOT/lost\+found/.*	<<none>>
 ifdef(`distro_debian',`
 # on Debian /lib/init/rw is a tmpfs used like /run
 /usr/lib/init/rw(/.*)?		gen_context(system_u:object_r:var_run_t,s0-mls_systemhigh)
+/run/resolvconf(/.*)? -d	gen_context(system_u:object_r:etc_t,s0)
 ')
 
 ifndef(`distro_redhat',`
Index: refpolicy-2.20170402/policy/modules/kernel/terminal.fc
===================================================================
--- refpolicy-2.20170402.orig/policy/modules/kernel/terminal.fc
+++ refpolicy-2.20170402/policy/modules/kernel/terminal.fc
@@ -14,6 +14,9 @@
 /dev/ip2[^/]*		-c	gen_context(system_u:object_r:tty_device_t,s0)
 /dev/isdn.*		-c	gen_context(system_u:object_r:tty_device_t,s0)
 /dev/ptmx		-c	gen_context(system_u:object_r:ptmx_t,s0)
+# if /dev/ptmx is a symlink to /dev/pts/ptmx then we need to have /dev/pts/ptmx
+# relabelled before sshd etc are ready to accept connections
+/dev/pts/ptmx		-c	gen_context(system_u:object_r:ptmx_t,s0)
 /dev/rfcomm[0-9]+	-c	gen_context(system_u:object_r:tty_device_t,s0)
 /dev/slamr[0-9]+	-c	gen_context(system_u:object_r:tty_device_t,s0)
 /dev/tty		-c	gen_context(system_u:object_r:devtty_t,s0)
@@ -24,7 +27,6 @@
 /dev/pty/.*		-c	gen_context(system_u:object_r:bsdpty_device_t,s0)
 
 /dev/pts		-d	gen_context(system_u:object_r:devpts_t,s0-mls_systemhigh)
-/dev/pts/ptmx		-c	gen_context(system_u:object_r:devpts_t,s0)
 /dev/pts/[0-9]+		-c	gen_context(system_u:object_r:user_devpts_t,s0)
 
 /dev/tts/[^/]*		-c	gen_context(system_u:object_r:tty_device_t,s0)
Index: refpolicy-2.20170402/policy/modules/services/xserver.fc
===================================================================
--- refpolicy-2.20170402.orig/policy/modules/services/xserver.fc
+++ refpolicy-2.20170402/policy/modules/services/xserver.fc
@@ -32,6 +32,7 @@ HOME_DIR/\.Xauthority.*	--	gen_context(s
 /etc/kde[34]?/kdm/backgroundrc	gen_context(system_u:object_r:xdm_var_run_t,s0)
 
 /etc/rc\.d/init\.d/x11-common -- gen_context(system_u:object_r:xdm_exec_t,s0)
+/etc/sddm/Xsession	--	gen_context(system_u:object_r:xsession_exec_t,s0)
 
 /etc/X11/[wx]dm/Xreset.* --	gen_context(system_u:object_r:xsession_exec_t,s0)
 /etc/X11/[wxg]dm/Xsession --	gen_context(system_u:object_r:xsession_exec_t,s0)
@@ -65,6 +66,7 @@ HOME_DIR/\.Xauthority.*	--	gen_context(s
 /usr/bin/gdm-binary	--	gen_context(system_u:object_r:xdm_exec_t,s0)
 /usr/bin/lxdm(-binary)? --	gen_context(system_u:object_r:xdm_exec_t,s0)
 /usr/bin/[xkw]dm	--	gen_context(system_u:object_r:xdm_exec_t,s0)
+/usr/bin/sddm		--	gen_context(system_u:object_r:xdm_exec_t,s0)
 /usr/bin/gpe-dm		--	gen_context(system_u:object_r:xdm_exec_t,s0)
 /usr/bin/iceauth	--	gen_context(system_u:object_r:iceauth_exec_t,s0)
 /usr/bin/slim		--	gen_context(system_u:object_r:xdm_exec_t,s0)
@@ -115,6 +117,7 @@ ifndef(`distro_debian',`
 /var/lib/lxdm(/.*)?		gen_context(system_u:object_r:xdm_var_lib_t,s0)
 /var/lib/[xkw]dm(/.*)?		gen_context(system_u:object_r:xdm_var_lib_t,s0)
 /var/lib/xkb(/.*)?		gen_context(system_u:object_r:xkb_var_lib_t,s0)
+/var/lib/sddm(/.*)?		gen_context(system_u:object_r:xkb_var_lib_t,s0)
 
 /var/log/[kwx]dm\.log.*	--	gen_context(system_u:object_r:xserver_log_t,s0)
 /var/log/lightdm(/.*)?		gen_context(system_u:object_r:xserver_log_t,s0)
@@ -124,6 +127,7 @@ ifndef(`distro_debian',`
 /var/log/XFree86.*	--	gen_context(system_u:object_r:xserver_log_t,s0)
 /var/log/Xorg.*		--	gen_context(system_u:object_r:xserver_log_t,s0)
 
+/run/sddm(/.*)?			gen_context(system_u:object_r:xdm_var_run_t,s0)
 /run/gdm(3)?(/.*)?		gen_context(system_u:object_r:xdm_var_run_t,s0)
 /run/gdm(3)?\.pid	--	gen_context(system_u:object_r:xdm_var_run_t,s0)
 /run/xdm\.pid	--	gen_context(system_u:object_r:xdm_var_run_t,s0)
Index: refpolicy-2.20170402/policy/modules/system/init.fc
===================================================================
--- refpolicy-2.20170402.orig/policy/modules/system/init.fc
+++ refpolicy-2.20170402/policy/modules/system/init.fc
@@ -38,7 +38,6 @@ ifdef(`distro_gentoo', `
 /usr/libexec/dcc/start-.* --	gen_context(system_u:object_r:initrc_exec_t,s0)
 /usr/libexec/dcc/stop-.* --	gen_context(system_u:object_r:initrc_exec_t,s0)
 
-/usr/sbin/apachectl	-- 	gen_context(system_u:object_r:initrc_exec_t,s0)
 /usr/sbin/init(ng)?	--	gen_context(system_u:object_r:init_exec_t,s0)
 /usr/sbin/open_init_pty	--	gen_context(system_u:object_r:initrc_exec_t,s0)
 /usr/sbin/upstart	--	gen_context(system_u:object_r:init_exec_t,s0)
@@ -65,6 +64,10 @@ ifdef(`distro_gentoo', `
 ifdef(`distro_debian',`
 /run/hotkey-setup	--	gen_context(system_u:object_r:initrc_var_run_t,s0)
 /run/kdm/.*		--	gen_context(system_u:object_r:initrc_var_run_t,s0)
+/etc/network/if-pre-up\.d/.* --	gen_context(system_u:object_r:initrc_exec_t,s0)
+/etc/network/if-up\.d/.* --	gen_context(system_u:object_r:initrc_exec_t,s0)
+/etc/network/if-down\.d/.* --	gen_context(system_u:object_r:initrc_exec_t,s0)
+/etc/network/if-post-down\.d/.* -- gen_context(system_u:object_r:initrc_exec_t,s0)
 ')
 
 ifdef(`distro_gentoo', `
Index: refpolicy-2.20170402/policy/modules/system/libraries.fc
===================================================================
--- refpolicy-2.20170402.orig/policy/modules/system/libraries.fc
+++ refpolicy-2.20170402/policy/modules/system/libraries.fc
@@ -105,6 +105,7 @@ ifdef(`distro_debian',`
 /usr/(.*/)?dh-python/dh_pypy		--	gen_context(system_u:object_r:lib_t,s0)
 ')
 
+/usr/lib/postfix/lib.*so.*		--	gen_context(system_u:object_r:lib_t,s0)
 /usr/lib/altivec/libavcodec\.so(\.[^/]*)* --	gen_context(system_u:object_r:textrel_shlib_t,s0)
 /usr/lib/cedega/.+\.so(\.[^/]*)*	--	gen_context(system_u:object_r:textrel_shlib_t,s0)
 /usr/lib/dovecot/(.*/)?lib.*\.so.*      --      gen_context(system_u:object_r:lib_t,s0)
Index: refpolicy-2.20170402/policy/modules/system/lvm.fc
===================================================================
--- refpolicy-2.20170402.orig/policy/modules/system/lvm.fc
+++ refpolicy-2.20170402/policy/modules/system/lvm.fc
@@ -42,6 +42,7 @@ ifdef(`distro_gentoo',`
 /usr/sbin/lvdisplay		--	gen_context(system_u:object_r:lvm_exec_t,s0)
 /usr/sbin/lvextend		--	gen_context(system_u:object_r:lvm_exec_t,s0)
 /usr/sbin/lvm			--	gen_context(system_u:object_r:lvm_exec_t,s0)
+/usr/sbin/lvmetad		--	gen_context(system_u:object_r:lvm_exec_t,s0)
 /usr/sbin/lvm\.static		--	gen_context(system_u:object_r:lvm_exec_t,s0)
 /usr/sbin/lvmchange		--	gen_context(system_u:object_r:lvm_exec_t,s0)
 /usr/sbin/lvmdiskscan		--	gen_context(system_u:object_r:lvm_exec_t,s0)
@@ -93,3 +94,4 @@ ifdef(`distro_gentoo',`
 /var/lock/lvm(/.*)?			gen_context(system_u:object_r:lvm_lock_t,s0)
 /run/multipathd\.sock		-s	gen_context(system_u:object_r:lvm_var_run_t,s0)
 /run/dmevent.*				gen_context(system_u:object_r:lvm_var_run_t,s0)
+/run/lvm(/.*)?				gen_context(system_u:object_r:lvm_var_run_t,s0)
Index: refpolicy-2.20170402/policy/modules/system/udev.fc
===================================================================
--- refpolicy-2.20170402.orig/policy/modules/system/udev.fc
+++ refpolicy-2.20170402/policy/modules/system/udev.fc
@@ -39,4 +39,5 @@ ifdef(`distro_redhat',`
 
 ifdef(`distro_debian',`
 /run/xen-hotplug -d	gen_context(system_u:object_r:udev_var_run_t,s0)
+/run/console-setup(/.*)?	gen_context(system_u:object_r:udev_var_run_t,s0)
 ')

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [refpolicy] [PATCH] misc fc changes again
  2017-04-05  4:24 [refpolicy] [PATCH] misc fc changes again Russell Coker
@ 2017-04-05 18:21 ` cgzones
  2017-04-06 20:58   ` Chris PeBenito
  2017-04-06 21:01 ` Chris PeBenito
  1 sibling, 1 reply; 5+ messages in thread
From: cgzones @ 2017-04-05 18:21 UTC (permalink / raw)
  To: refpolicy

2017-04-05 6:24 GMT+02:00 Russell Coker via refpolicy
<refpolicy@oss.tresys.com>:
> Here's another copy of that patch, with the requested changes and without
> the /etc/ssl change.
>
> Index: refpolicy-2.20170402/policy/modules/contrib/acct.fc
> ===================================================================
> --- refpolicy-2.20170402.orig/policy/modules/contrib/acct.fc
> +++ refpolicy-2.20170402/policy/modules/contrib/acct.fc
> @@ -1,5 +1,3 @@
> -/etc/cron\.(daily|monthly)/acct        --      gen_context(system_u:object_r:acct_exec_t,s0)
> -
>  /etc/rc\.d/init\.d/psacct      --      gen_context(system_u:object_r:acct_initrc_exec_t,s0)
>
>  /usr/sbin/accton       --      gen_context(system_u:object_r:acct_exec_t,s0)
> Index: refpolicy-2.20170402/policy/modules/contrib/apache.fc
> ===================================================================
> --- refpolicy-2.20170402.orig/policy/modules/contrib/apache.fc
> +++ refpolicy-2.20170402/policy/modules/contrib/apache.fc
> @@ -86,6 +86,7 @@ ifdef(`distro_suse',`
>  /usr/share/mythtv/data(/.*)?   gen_context(system_u:object_r:httpd_sys_content_t,s0)
>  /usr/share/ntop/html(/.*)?     gen_context(system_u:object_r:httpd_sys_content_t,s0)
>  /usr/share/openca/htdocs(/.*)? gen_context(system_u:object_r:httpd_sys_content_t,s0)
> +/usr/share/postfixadmin/templates_c(/.*)?      gen_context(system_u:object_r:httpd_sys_rw_content_t,s0)
>  /usr/share/selinux-policy[^/]*/html(/.*)?      gen_context(system_u:object_r:httpd_sys_content_t,s0)
>  /usr/share/wordpress/.*\.php   --      gen_context(system_u:object_r:httpd_sys_script_exec_t,s0)
>  /usr/share/wordpress-mu/wp-config\.php --      gen_context(system_u:object_r:httpd_sys_script_exec_t,s0)
> Index: refpolicy-2.20170402/policy/modules/contrib/apt.fc
> ===================================================================
> --- refpolicy-2.20170402.orig/policy/modules/contrib/apt.fc
> +++ refpolicy-2.20170402/policy/modules/contrib/apt.fc
> @@ -14,6 +14,7 @@ ifndef(`distro_redhat',`
>
>  /var/lib/apt(/.*)?     gen_context(system_u:object_r:apt_var_lib_t,s0)
>  /var/lib/aptitude(/.*)?        gen_context(system_u:object_r:apt_var_lib_t,s0)
> +/var/lib/apt-xapian-inde(x)(/.*)?      gen_context(system_u:object_r:apt_var_lib_t,s0)
>
>  /var/lock/aptitude     gen_context(system_u:object_r:apt_lock_t,s0)
>
> Index: refpolicy-2.20170402/policy/modules/contrib/dirmngr.fc
> ===================================================================
> --- refpolicy-2.20170402.orig/policy/modules/contrib/dirmngr.fc
> +++ refpolicy-2.20170402/policy/modules/contrib/dirmngr.fc
> @@ -7,6 +7,7 @@
>  /var/log/dirmngr(/.*)? gen_context(system_u:object_r:dirmngr_log_t,s0)
>
>  /var/lib/dirmngr(/.*)? gen_context(system_u:object_r:dirmngr_var_lib_t,s0)
> +/var/cache/dirmngr(/.*)?       gen_context(system_u:object_r:dirmngr_var_lib_t,s0)
>
>  /run/dirmngr\.pid      --      gen_context(system_u:object_r:dirmngr_var_run_t,s0)
>
> Index: refpolicy-2.20170402/policy/modules/contrib/dpkg.fc
> ===================================================================
> --- refpolicy-2.20170402.orig/policy/modules/contrib/dpkg.fc
> +++ refpolicy-2.20170402/policy/modules/contrib/dpkg.fc
> @@ -4,6 +4,7 @@
>  /usr/bin/dpkg  --      gen_context(system_u:object_r:dpkg_exec_t,s0)
>  /usr/bin/dselect       --      gen_context(system_u:object_r:dpkg_exec_t,s0)
>
> +/var/lib/debtags(/.*)? gen_context(system_u:object_r:dpkg_var_lib_t,s0)
>  /var/lib/dpkg(/.*)?    gen_context(system_u:object_r:dpkg_var_lib_t,s0)
>  /var/lib/dpkg/(meth)?lock      --      gen_context(system_u:object_r:dpkg_lock_t,s0)
>
> Index: refpolicy-2.20170402/policy/modules/kernel/corecommands.fc
> ===================================================================
> --- refpolicy-2.20170402.orig/policy/modules/kernel/corecommands.fc
> +++ refpolicy-2.20170402/policy/modules/kernel/corecommands.fc
> @@ -151,6 +151,7 @@ ifdef(`distro_gentoo',`
>  /usr/bin/zsh.*                 --      gen_context(system_u:object_r:shell_exec_t,s0)
>
>  /usr/lib/(.*/)?bin(/.*)?               gen_context(system_u:object_r:bin_t,s0)
> +/usr/lib/postfix/configure-instance.sh -- gen_context(system_u:object_r:bin_t,s0)

unescaped dot

>
>  /usr/(.*/)?sbin(/.*)?                  gen_context(system_u:object_r:bin_t,s0)
>  /usr/lib/(.*/)?sbin(/.*)?              gen_context(system_u:object_r:bin_t,s0)
> @@ -158,6 +159,7 @@ ifdef(`distro_gentoo',`
>  /usr/lib/at-spi2-core(/.*)?            gen_context(system_u:object_r:bin_t,s0)
>  /usr/lib/avahi/avahi-daemon-check-dns\.sh      --      gen_context(system_u:object_r:bin_t,s0)
>  /usr/lib/ccache/bin(/.*)?              gen_context(system_u:object_r:bin_t,s0)
> +/usr/lib/dovecot/.+                    gen_context(system_u:object_r:bin_t,s0)
>  /usr/lib/fence(/.*)?                   gen_context(system_u:object_r:bin_t,s0)
>  /usr/lib/pgsql/test/regress/.*\.sh --  gen_context(system_u:object_r:bin_t,s0)
>  /usr/lib/qt.*/bin(/.*)?                        gen_context(system_u:object_r:bin_t,s0)
> @@ -201,6 +203,7 @@ ifdef(`distro_gentoo',`
>  /usr/lib/rpm/rpmq              --      gen_context(system_u:object_r:bin_t,s0)
>  /usr/lib/rpm/rpmv              --      gen_context(system_u:object_r:bin_t,s0)
>  /usr/lib/security/pam_krb5/pam_krb5_storetmp -- gen_context(system_u:object_r:bin_t,s0)
> +/usr/lib/selinux/hll/pp                --      gen_context(system_u:object_r:bin_t,s0)
>  /usr/lib/sftp-server           --      gen_context(system_u:object_r:bin_t,s0)
>  /usr/lib/ssh(/.*)?                     gen_context(system_u:object_r:bin_t,s0)
>  /usr/lib/sudo/sesh             --      gen_context(system_u:object_r:shell_exec_t,s0)
> @@ -259,6 +262,7 @@ ifdef(`distro_gentoo',`
>  /usr/sbin/sesh                 --      gen_context(system_u:object_r:shell_exec_t,s0)
>  /usr/sbin/smrsh                        --      gen_context(system_u:object_r:shell_exec_t,s0)
>
> +/usr/share/mdadm/checkarray    --      gen_context(system_u:object_r:bin_t,s0)
>  /usr/share/(.*/)?bin(/.*)?             gen_context(system_u:object_r:bin_t,s0)
>  /usr/share/ajaxterm/ajaxterm.py.* --   gen_context(system_u:object_r:bin_t,s0)
>  /usr/share/ajaxterm/qweb.py.* --       gen_context(system_u:object_r:bin_t,s0)
> @@ -289,6 +293,7 @@ ifdef(`distro_gentoo',`
>  /usr/share/printconf/util/print\.py -- gen_context(system_u:object_r:bin_t,s0)
>  /usr/share/PackageKit/pk-upgrade-distro\.sh --         gen_context(system_u:object_r:bin_t,s0)
>  /usr/share/PackageKit/helpers(/.*)?    gen_context(system_u:object_r:bin_t,s0)
> +/usr/share/reportbug/handle_bugscript -- gen_context(system_u:object_r:bin_t,s0)
>  /usr/share/sandbox/sandboxX.sh --      gen_context(system_u:object_r:bin_t,s0)
>  /usr/share/sectool/.*\.py      --      gen_context(system_u:object_r:bin_t,s0)
>  /usr/share/selinux/devel/policygentool -- gen_context(system_u:object_r:bin_t,s0)
> Index: refpolicy-2.20170402/policy/modules/kernel/files.fc
> ===================================================================
> --- refpolicy-2.20170402.orig/policy/modules/kernel/files.fc
> +++ refpolicy-2.20170402/policy/modules/kernel/files.fc
> @@ -215,6 +215,7 @@ HOME_ROOT/lost\+found/.*    <<none>>
>  ifdef(`distro_debian',`
>  # on Debian /lib/init/rw is a tmpfs used like /run
>  /usr/lib/init/rw(/.*)?         gen_context(system_u:object_r:var_run_t,s0-mls_systemhigh)
> +/run/resolvconf(/.*)? -d       gen_context(system_u:object_r:etc_t,s0)

in sysnetwork.fc there is an entry:
/run/resolvconf/.* -- gen_context(system_u:object_r:net_conf_t,s0)
this seems a bit inconvenient

>  ')
>
>  ifndef(`distro_redhat',`
> Index: refpolicy-2.20170402/policy/modules/kernel/terminal.fc
> ===================================================================
> --- refpolicy-2.20170402.orig/policy/modules/kernel/terminal.fc
> +++ refpolicy-2.20170402/policy/modules/kernel/terminal.fc
> @@ -14,6 +14,9 @@
>  /dev/ip2[^/]*          -c      gen_context(system_u:object_r:tty_device_t,s0)
>  /dev/isdn.*            -c      gen_context(system_u:object_r:tty_device_t,s0)
>  /dev/ptmx              -c      gen_context(system_u:object_r:ptmx_t,s0)
> +# if /dev/ptmx is a symlink to /dev/pts/ptmx then we need to have /dev/pts/ptmx
> +# relabelled before sshd etc are ready to accept connections
> +/dev/pts/ptmx          -c      gen_context(system_u:object_r:ptmx_t,s0)
>  /dev/rfcomm[0-9]+      -c      gen_context(system_u:object_r:tty_device_t,s0)
>  /dev/slamr[0-9]+       -c      gen_context(system_u:object_r:tty_device_t,s0)
>  /dev/tty               -c      gen_context(system_u:object_r:devtty_t,s0)
> @@ -24,7 +27,6 @@
>  /dev/pty/.*            -c      gen_context(system_u:object_r:bsdpty_device_t,s0)
>
>  /dev/pts               -d      gen_context(system_u:object_r:devpts_t,s0-mls_systemhigh)
> -/dev/pts/ptmx          -c      gen_context(system_u:object_r:devpts_t,s0)
>  /dev/pts/[0-9]+                -c      gen_context(system_u:object_r:user_devpts_t,s0)
>
>  /dev/tts/[^/]*         -c      gen_context(system_u:object_r:tty_device_t,s0)
> Index: refpolicy-2.20170402/policy/modules/services/xserver.fc
> ===================================================================
> --- refpolicy-2.20170402.orig/policy/modules/services/xserver.fc
> +++ refpolicy-2.20170402/policy/modules/services/xserver.fc
> @@ -32,6 +32,7 @@ HOME_DIR/\.Xauthority.*       --      gen_context(s
>  /etc/kde[34]?/kdm/backgroundrc gen_context(system_u:object_r:xdm_var_run_t,s0)
>
>  /etc/rc\.d/init\.d/x11-common -- gen_context(system_u:object_r:xdm_exec_t,s0)
> +/etc/sddm/Xsession     --      gen_context(system_u:object_r:xsession_exec_t,s0)
>
>  /etc/X11/[wx]dm/Xreset.* --    gen_context(system_u:object_r:xsession_exec_t,s0)
>  /etc/X11/[wxg]dm/Xsession --   gen_context(system_u:object_r:xsession_exec_t,s0)
> @@ -65,6 +66,7 @@ HOME_DIR/\.Xauthority.*       --      gen_context(s
>  /usr/bin/gdm-binary    --      gen_context(system_u:object_r:xdm_exec_t,s0)
>  /usr/bin/lxdm(-binary)? --     gen_context(system_u:object_r:xdm_exec_t,s0)
>  /usr/bin/[xkw]dm       --      gen_context(system_u:object_r:xdm_exec_t,s0)
> +/usr/bin/sddm          --      gen_context(system_u:object_r:xdm_exec_t,s0)
>  /usr/bin/gpe-dm                --      gen_context(system_u:object_r:xdm_exec_t,s0)
>  /usr/bin/iceauth       --      gen_context(system_u:object_r:iceauth_exec_t,s0)
>  /usr/bin/slim          --      gen_context(system_u:object_r:xdm_exec_t,s0)
> @@ -115,6 +117,7 @@ ifndef(`distro_debian',`
>  /var/lib/lxdm(/.*)?            gen_context(system_u:object_r:xdm_var_lib_t,s0)
>  /var/lib/[xkw]dm(/.*)?         gen_context(system_u:object_r:xdm_var_lib_t,s0)
>  /var/lib/xkb(/.*)?             gen_context(system_u:object_r:xkb_var_lib_t,s0)
> +/var/lib/sddm(/.*)?            gen_context(system_u:object_r:xkb_var_lib_t,s0)
>
>  /var/log/[kwx]dm\.log.*        --      gen_context(system_u:object_r:xserver_log_t,s0)
>  /var/log/lightdm(/.*)?         gen_context(system_u:object_r:xserver_log_t,s0)
> @@ -124,6 +127,7 @@ ifndef(`distro_debian',`
>  /var/log/XFree86.*     --      gen_context(system_u:object_r:xserver_log_t,s0)
>  /var/log/Xorg.*                --      gen_context(system_u:object_r:xserver_log_t,s0)
>
> +/run/sddm(/.*)?                        gen_context(system_u:object_r:xdm_var_run_t,s0)
>  /run/gdm(3)?(/.*)?             gen_context(system_u:object_r:xdm_var_run_t,s0)
>  /run/gdm(3)?\.pid      --      gen_context(system_u:object_r:xdm_var_run_t,s0)
>  /run/xdm\.pid  --      gen_context(system_u:object_r:xdm_var_run_t,s0)
> Index: refpolicy-2.20170402/policy/modules/system/init.fc
> ===================================================================
> --- refpolicy-2.20170402.orig/policy/modules/system/init.fc
> +++ refpolicy-2.20170402/policy/modules/system/init.fc
> @@ -38,7 +38,6 @@ ifdef(`distro_gentoo', `
>  /usr/libexec/dcc/start-.* --   gen_context(system_u:object_r:initrc_exec_t,s0)
>  /usr/libexec/dcc/stop-.* --    gen_context(system_u:object_r:initrc_exec_t,s0)
>
> -/usr/sbin/apachectl    --      gen_context(system_u:object_r:initrc_exec_t,s0)
>  /usr/sbin/init(ng)?    --      gen_context(system_u:object_r:init_exec_t,s0)
>  /usr/sbin/open_init_pty        --      gen_context(system_u:object_r:initrc_exec_t,s0)
>  /usr/sbin/upstart      --      gen_context(system_u:object_r:init_exec_t,s0)
> @@ -65,6 +64,10 @@ ifdef(`distro_gentoo', `
>  ifdef(`distro_debian',`
>  /run/hotkey-setup      --      gen_context(system_u:object_r:initrc_var_run_t,s0)
>  /run/kdm/.*            --      gen_context(system_u:object_r:initrc_var_run_t,s0)
> +/etc/network/if-pre-up\.d/.* --        gen_context(system_u:object_r:initrc_exec_t,s0)
> +/etc/network/if-up\.d/.* --    gen_context(system_u:object_r:initrc_exec_t,s0)
> +/etc/network/if-down\.d/.* --  gen_context(system_u:object_r:initrc_exec_t,s0)
> +/etc/network/if-post-down\.d/.* -- gen_context(system_u:object_r:initrc_exec_t,s0)
>  ')
>
>  ifdef(`distro_gentoo', `
> Index: refpolicy-2.20170402/policy/modules/system/libraries.fc
> ===================================================================
> --- refpolicy-2.20170402.orig/policy/modules/system/libraries.fc
> +++ refpolicy-2.20170402/policy/modules/system/libraries.fc
> @@ -105,6 +105,7 @@ ifdef(`distro_debian',`
>  /usr/(.*/)?dh-python/dh_pypy           --      gen_context(system_u:object_r:lib_t,s0)
>  ')
>
> +/usr/lib/postfix/lib.*so.*             --      gen_context(system_u:object_r:lib_t,s0)
>  /usr/lib/altivec/libavcodec\.so(\.[^/]*)* --   gen_context(system_u:object_r:textrel_shlib_t,s0)
>  /usr/lib/cedega/.+\.so(\.[^/]*)*       --      gen_context(system_u:object_r:textrel_shlib_t,s0)
>  /usr/lib/dovecot/(.*/)?lib.*\.so.*      --      gen_context(system_u:object_r:lib_t,s0)
> Index: refpolicy-2.20170402/policy/modules/system/lvm.fc
> ===================================================================
> --- refpolicy-2.20170402.orig/policy/modules/system/lvm.fc
> +++ refpolicy-2.20170402/policy/modules/system/lvm.fc
> @@ -42,6 +42,7 @@ ifdef(`distro_gentoo',`
>  /usr/sbin/lvdisplay            --      gen_context(system_u:object_r:lvm_exec_t,s0)
>  /usr/sbin/lvextend             --      gen_context(system_u:object_r:lvm_exec_t,s0)
>  /usr/sbin/lvm                  --      gen_context(system_u:object_r:lvm_exec_t,s0)
> +/usr/sbin/lvmetad              --      gen_context(system_u:object_r:lvm_exec_t,s0)
>  /usr/sbin/lvm\.static          --      gen_context(system_u:object_r:lvm_exec_t,s0)
>  /usr/sbin/lvmchange            --      gen_context(system_u:object_r:lvm_exec_t,s0)
>  /usr/sbin/lvmdiskscan          --      gen_context(system_u:object_r:lvm_exec_t,s0)
> @@ -93,3 +94,4 @@ ifdef(`distro_gentoo',`
>  /var/lock/lvm(/.*)?                    gen_context(system_u:object_r:lvm_lock_t,s0)
>  /run/multipathd\.sock          -s      gen_context(system_u:object_r:lvm_var_run_t,s0)
>  /run/dmevent.*                         gen_context(system_u:object_r:lvm_var_run_t,s0)
> +/run/lvm(/.*)?                         gen_context(system_u:object_r:lvm_var_run_t,s0)
> Index: refpolicy-2.20170402/policy/modules/system/udev.fc
> ===================================================================
> --- refpolicy-2.20170402.orig/policy/modules/system/udev.fc
> +++ refpolicy-2.20170402/policy/modules/system/udev.fc
> @@ -39,4 +39,5 @@ ifdef(`distro_redhat',`
>
>  ifdef(`distro_debian',`
>  /run/xen-hotplug -d    gen_context(system_u:object_r:udev_var_run_t,s0)
> +/run/console-setup(/.*)?       gen_context(system_u:object_r:udev_var_run_t,s0)
>  ')
> _______________________________________________
> refpolicy mailing list
> refpolicy at oss.tresys.com
> http://oss.tresys.com/mailman/listinfo/refpolicy

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [refpolicy] [PATCH] misc fc changes again
  2017-04-05 18:21 ` cgzones
@ 2017-04-06 20:58   ` Chris PeBenito
  2017-04-07  7:58     ` Dominick Grift
  0 siblings, 1 reply; 5+ messages in thread
From: Chris PeBenito @ 2017-04-06 20:58 UTC (permalink / raw)
  To: refpolicy

On 04/05/2017 02:21 PM, cgzones via refpolicy wrote:
> 2017-04-05 6:24 GMT+02:00 Russell Coker via refpolicy
> <refpolicy@oss.tresys.com>:

>> --- refpolicy-2.20170402.orig/policy/modules/kernel/files.fc
>> +++ refpolicy-2.20170402/policy/modules/kernel/files.fc
>> @@ -215,6 +215,7 @@ HOME_ROOT/lost\+found/.*    <<none>>
>>  ifdef(`distro_debian',`
>>  # on Debian /lib/init/rw is a tmpfs used like /run
>>  /usr/lib/init/rw(/.*)?         gen_context(system_u:object_r:var_run_t,s0-mls_systemhigh)
>> +/run/resolvconf(/.*)? -d       gen_context(system_u:object_r:etc_t,s0)

This only mentions the directories, which I think should remain etc_t, 
whereas below it only matches the files, so the files remain net_conf_t. 
  I think this is ok.


> in sysnetwork.fc there is an entry:
> /run/resolvconf/.* -- gen_context(system_u:object_r:net_conf_t,s0)
> this seems a bit inconvenient



-- 
Chris PeBenito

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [refpolicy] [PATCH] misc fc changes again
  2017-04-05  4:24 [refpolicy] [PATCH] misc fc changes again Russell Coker
  2017-04-05 18:21 ` cgzones
@ 2017-04-06 21:01 ` Chris PeBenito
  1 sibling, 0 replies; 5+ messages in thread
From: Chris PeBenito @ 2017-04-06 21:01 UTC (permalink / raw)
  To: refpolicy

On 04/05/2017 12:24 AM, Russell Coker via refpolicy wrote:
> Here's another copy of that patch, with the requested changes and without
> the /etc/ssl change.


I've merged this along with the escaping fix that cgzones pointed out.

> Index: refpolicy-2.20170402/policy/modules/contrib/acct.fc
> ===================================================================
> --- refpolicy-2.20170402.orig/policy/modules/contrib/acct.fc
> +++ refpolicy-2.20170402/policy/modules/contrib/acct.fc
> @@ -1,5 +1,3 @@
> -/etc/cron\.(daily|monthly)/acct	--	gen_context(system_u:object_r:acct_exec_t,s0)
> -
>  /etc/rc\.d/init\.d/psacct	--	gen_context(system_u:object_r:acct_initrc_exec_t,s0)
>
>  /usr/sbin/accton	--	gen_context(system_u:object_r:acct_exec_t,s0)
> Index: refpolicy-2.20170402/policy/modules/contrib/apache.fc
> ===================================================================
> --- refpolicy-2.20170402.orig/policy/modules/contrib/apache.fc
> +++ refpolicy-2.20170402/policy/modules/contrib/apache.fc
> @@ -86,6 +86,7 @@ ifdef(`distro_suse',`
>  /usr/share/mythtv/data(/.*)?	gen_context(system_u:object_r:httpd_sys_content_t,s0)
>  /usr/share/ntop/html(/.*)?	gen_context(system_u:object_r:httpd_sys_content_t,s0)
>  /usr/share/openca/htdocs(/.*)?	gen_context(system_u:object_r:httpd_sys_content_t,s0)
> +/usr/share/postfixadmin/templates_c(/.*)?	gen_context(system_u:object_r:httpd_sys_rw_content_t,s0)
>  /usr/share/selinux-policy[^/]*/html(/.*)?	gen_context(system_u:object_r:httpd_sys_content_t,s0)
>  /usr/share/wordpress/.*\.php	--	gen_context(system_u:object_r:httpd_sys_script_exec_t,s0)
>  /usr/share/wordpress-mu/wp-config\.php	--	gen_context(system_u:object_r:httpd_sys_script_exec_t,s0)
> Index: refpolicy-2.20170402/policy/modules/contrib/apt.fc
> ===================================================================
> --- refpolicy-2.20170402.orig/policy/modules/contrib/apt.fc
> +++ refpolicy-2.20170402/policy/modules/contrib/apt.fc
> @@ -14,6 +14,7 @@ ifndef(`distro_redhat',`
>
>  /var/lib/apt(/.*)?	gen_context(system_u:object_r:apt_var_lib_t,s0)
>  /var/lib/aptitude(/.*)?	gen_context(system_u:object_r:apt_var_lib_t,s0)
> +/var/lib/apt-xapian-inde(x)(/.*)?	gen_context(system_u:object_r:apt_var_lib_t,s0)
>
>  /var/lock/aptitude	gen_context(system_u:object_r:apt_lock_t,s0)
>
> Index: refpolicy-2.20170402/policy/modules/contrib/dirmngr.fc
> ===================================================================
> --- refpolicy-2.20170402.orig/policy/modules/contrib/dirmngr.fc
> +++ refpolicy-2.20170402/policy/modules/contrib/dirmngr.fc
> @@ -7,6 +7,7 @@
>  /var/log/dirmngr(/.*)?	gen_context(system_u:object_r:dirmngr_log_t,s0)
>
>  /var/lib/dirmngr(/.*)?	gen_context(system_u:object_r:dirmngr_var_lib_t,s0)
> +/var/cache/dirmngr(/.*)?	gen_context(system_u:object_r:dirmngr_var_lib_t,s0)
>
>  /run/dirmngr\.pid	--	gen_context(system_u:object_r:dirmngr_var_run_t,s0)
>
> Index: refpolicy-2.20170402/policy/modules/contrib/dpkg.fc
> ===================================================================
> --- refpolicy-2.20170402.orig/policy/modules/contrib/dpkg.fc
> +++ refpolicy-2.20170402/policy/modules/contrib/dpkg.fc
> @@ -4,6 +4,7 @@
>  /usr/bin/dpkg	--	gen_context(system_u:object_r:dpkg_exec_t,s0)
>  /usr/bin/dselect	--	gen_context(system_u:object_r:dpkg_exec_t,s0)
>
> +/var/lib/debtags(/.*)?	gen_context(system_u:object_r:dpkg_var_lib_t,s0)
>  /var/lib/dpkg(/.*)?	gen_context(system_u:object_r:dpkg_var_lib_t,s0)
>  /var/lib/dpkg/(meth)?lock	--	gen_context(system_u:object_r:dpkg_lock_t,s0)
>
> Index: refpolicy-2.20170402/policy/modules/kernel/corecommands.fc
> ===================================================================
> --- refpolicy-2.20170402.orig/policy/modules/kernel/corecommands.fc
> +++ refpolicy-2.20170402/policy/modules/kernel/corecommands.fc
> @@ -151,6 +151,7 @@ ifdef(`distro_gentoo',`
>  /usr/bin/zsh.*			--	gen_context(system_u:object_r:shell_exec_t,s0)
>
>  /usr/lib/(.*/)?bin(/.*)?		gen_context(system_u:object_r:bin_t,s0)
> +/usr/lib/postfix/configure-instance.sh -- gen_context(system_u:object_r:bin_t,s0)
>
>  /usr/(.*/)?sbin(/.*)?			gen_context(system_u:object_r:bin_t,s0)
>  /usr/lib/(.*/)?sbin(/.*)?		gen_context(system_u:object_r:bin_t,s0)
> @@ -158,6 +159,7 @@ ifdef(`distro_gentoo',`
>  /usr/lib/at-spi2-core(/.*)?		gen_context(system_u:object_r:bin_t,s0)
>  /usr/lib/avahi/avahi-daemon-check-dns\.sh	--	gen_context(system_u:object_r:bin_t,s0)
>  /usr/lib/ccache/bin(/.*)?		gen_context(system_u:object_r:bin_t,s0)
> +/usr/lib/dovecot/.+			gen_context(system_u:object_r:bin_t,s0)
>  /usr/lib/fence(/.*)?			gen_context(system_u:object_r:bin_t,s0)
>  /usr/lib/pgsql/test/regress/.*\.sh --	gen_context(system_u:object_r:bin_t,s0)
>  /usr/lib/qt.*/bin(/.*)?			gen_context(system_u:object_r:bin_t,s0)
> @@ -201,6 +203,7 @@ ifdef(`distro_gentoo',`
>  /usr/lib/rpm/rpmq		-- 	gen_context(system_u:object_r:bin_t,s0)
>  /usr/lib/rpm/rpmv		-- 	gen_context(system_u:object_r:bin_t,s0)
>  /usr/lib/security/pam_krb5/pam_krb5_storetmp -- gen_context(system_u:object_r:bin_t,s0)
> +/usr/lib/selinux/hll/pp		--	gen_context(system_u:object_r:bin_t,s0)
>  /usr/lib/sftp-server		--	gen_context(system_u:object_r:bin_t,s0)
>  /usr/lib/ssh(/.*)?			gen_context(system_u:object_r:bin_t,s0)
>  /usr/lib/sudo/sesh		--	gen_context(system_u:object_r:shell_exec_t,s0)
> @@ -259,6 +262,7 @@ ifdef(`distro_gentoo',`
>  /usr/sbin/sesh			--	gen_context(system_u:object_r:shell_exec_t,s0)
>  /usr/sbin/smrsh			--	gen_context(system_u:object_r:shell_exec_t,s0)
>
> +/usr/share/mdadm/checkarray	--	gen_context(system_u:object_r:bin_t,s0)
>  /usr/share/(.*/)?bin(/.*)?		gen_context(system_u:object_r:bin_t,s0)
>  /usr/share/ajaxterm/ajaxterm.py.* --	gen_context(system_u:object_r:bin_t,s0)
>  /usr/share/ajaxterm/qweb.py.* --	gen_context(system_u:object_r:bin_t,s0)
> @@ -289,6 +293,7 @@ ifdef(`distro_gentoo',`
>  /usr/share/printconf/util/print\.py --	gen_context(system_u:object_r:bin_t,s0)
>  /usr/share/PackageKit/pk-upgrade-distro\.sh -- 	gen_context(system_u:object_r:bin_t,s0)
>  /usr/share/PackageKit/helpers(/.*)?	gen_context(system_u:object_r:bin_t,s0)
> +/usr/share/reportbug/handle_bugscript -- gen_context(system_u:object_r:bin_t,s0)
>  /usr/share/sandbox/sandboxX.sh	--	gen_context(system_u:object_r:bin_t,s0)
>  /usr/share/sectool/.*\.py	--	gen_context(system_u:object_r:bin_t,s0)
>  /usr/share/selinux/devel/policygentool -- gen_context(system_u:object_r:bin_t,s0)
> Index: refpolicy-2.20170402/policy/modules/kernel/files.fc
> ===================================================================
> --- refpolicy-2.20170402.orig/policy/modules/kernel/files.fc
> +++ refpolicy-2.20170402/policy/modules/kernel/files.fc
> @@ -215,6 +215,7 @@ HOME_ROOT/lost\+found/.*	<<none>>
>  ifdef(`distro_debian',`
>  # on Debian /lib/init/rw is a tmpfs used like /run
>  /usr/lib/init/rw(/.*)?		gen_context(system_u:object_r:var_run_t,s0-mls_systemhigh)
> +/run/resolvconf(/.*)? -d	gen_context(system_u:object_r:etc_t,s0)
>  ')
>
>  ifndef(`distro_redhat',`
> Index: refpolicy-2.20170402/policy/modules/kernel/terminal.fc
> ===================================================================
> --- refpolicy-2.20170402.orig/policy/modules/kernel/terminal.fc
> +++ refpolicy-2.20170402/policy/modules/kernel/terminal.fc
> @@ -14,6 +14,9 @@
>  /dev/ip2[^/]*		-c	gen_context(system_u:object_r:tty_device_t,s0)
>  /dev/isdn.*		-c	gen_context(system_u:object_r:tty_device_t,s0)
>  /dev/ptmx		-c	gen_context(system_u:object_r:ptmx_t,s0)
> +# if /dev/ptmx is a symlink to /dev/pts/ptmx then we need to have /dev/pts/ptmx
> +# relabelled before sshd etc are ready to accept connections
> +/dev/pts/ptmx		-c	gen_context(system_u:object_r:ptmx_t,s0)
>  /dev/rfcomm[0-9]+	-c	gen_context(system_u:object_r:tty_device_t,s0)
>  /dev/slamr[0-9]+	-c	gen_context(system_u:object_r:tty_device_t,s0)
>  /dev/tty		-c	gen_context(system_u:object_r:devtty_t,s0)
> @@ -24,7 +27,6 @@
>  /dev/pty/.*		-c	gen_context(system_u:object_r:bsdpty_device_t,s0)
>
>  /dev/pts		-d	gen_context(system_u:object_r:devpts_t,s0-mls_systemhigh)
> -/dev/pts/ptmx		-c	gen_context(system_u:object_r:devpts_t,s0)
>  /dev/pts/[0-9]+		-c	gen_context(system_u:object_r:user_devpts_t,s0)
>
>  /dev/tts/[^/]*		-c	gen_context(system_u:object_r:tty_device_t,s0)
> Index: refpolicy-2.20170402/policy/modules/services/xserver.fc
> ===================================================================
> --- refpolicy-2.20170402.orig/policy/modules/services/xserver.fc
> +++ refpolicy-2.20170402/policy/modules/services/xserver.fc
> @@ -32,6 +32,7 @@ HOME_DIR/\.Xauthority.*	--	gen_context(s
>  /etc/kde[34]?/kdm/backgroundrc	gen_context(system_u:object_r:xdm_var_run_t,s0)
>
>  /etc/rc\.d/init\.d/x11-common -- gen_context(system_u:object_r:xdm_exec_t,s0)
> +/etc/sddm/Xsession	--	gen_context(system_u:object_r:xsession_exec_t,s0)
>
>  /etc/X11/[wx]dm/Xreset.* --	gen_context(system_u:object_r:xsession_exec_t,s0)
>  /etc/X11/[wxg]dm/Xsession --	gen_context(system_u:object_r:xsession_exec_t,s0)
> @@ -65,6 +66,7 @@ HOME_DIR/\.Xauthority.*	--	gen_context(s
>  /usr/bin/gdm-binary	--	gen_context(system_u:object_r:xdm_exec_t,s0)
>  /usr/bin/lxdm(-binary)? --	gen_context(system_u:object_r:xdm_exec_t,s0)
>  /usr/bin/[xkw]dm	--	gen_context(system_u:object_r:xdm_exec_t,s0)
> +/usr/bin/sddm		--	gen_context(system_u:object_r:xdm_exec_t,s0)
>  /usr/bin/gpe-dm		--	gen_context(system_u:object_r:xdm_exec_t,s0)
>  /usr/bin/iceauth	--	gen_context(system_u:object_r:iceauth_exec_t,s0)
>  /usr/bin/slim		--	gen_context(system_u:object_r:xdm_exec_t,s0)
> @@ -115,6 +117,7 @@ ifndef(`distro_debian',`
>  /var/lib/lxdm(/.*)?		gen_context(system_u:object_r:xdm_var_lib_t,s0)
>  /var/lib/[xkw]dm(/.*)?		gen_context(system_u:object_r:xdm_var_lib_t,s0)
>  /var/lib/xkb(/.*)?		gen_context(system_u:object_r:xkb_var_lib_t,s0)
> +/var/lib/sddm(/.*)?		gen_context(system_u:object_r:xkb_var_lib_t,s0)
>
>  /var/log/[kwx]dm\.log.*	--	gen_context(system_u:object_r:xserver_log_t,s0)
>  /var/log/lightdm(/.*)?		gen_context(system_u:object_r:xserver_log_t,s0)
> @@ -124,6 +127,7 @@ ifndef(`distro_debian',`
>  /var/log/XFree86.*	--	gen_context(system_u:object_r:xserver_log_t,s0)
>  /var/log/Xorg.*		--	gen_context(system_u:object_r:xserver_log_t,s0)
>
> +/run/sddm(/.*)?			gen_context(system_u:object_r:xdm_var_run_t,s0)
>  /run/gdm(3)?(/.*)?		gen_context(system_u:object_r:xdm_var_run_t,s0)
>  /run/gdm(3)?\.pid	--	gen_context(system_u:object_r:xdm_var_run_t,s0)
>  /run/xdm\.pid	--	gen_context(system_u:object_r:xdm_var_run_t,s0)
> Index: refpolicy-2.20170402/policy/modules/system/init.fc
> ===================================================================
> --- refpolicy-2.20170402.orig/policy/modules/system/init.fc
> +++ refpolicy-2.20170402/policy/modules/system/init.fc
> @@ -38,7 +38,6 @@ ifdef(`distro_gentoo', `
>  /usr/libexec/dcc/start-.* --	gen_context(system_u:object_r:initrc_exec_t,s0)
>  /usr/libexec/dcc/stop-.* --	gen_context(system_u:object_r:initrc_exec_t,s0)
>
> -/usr/sbin/apachectl	-- 	gen_context(system_u:object_r:initrc_exec_t,s0)
>  /usr/sbin/init(ng)?	--	gen_context(system_u:object_r:init_exec_t,s0)
>  /usr/sbin/open_init_pty	--	gen_context(system_u:object_r:initrc_exec_t,s0)
>  /usr/sbin/upstart	--	gen_context(system_u:object_r:init_exec_t,s0)
> @@ -65,6 +64,10 @@ ifdef(`distro_gentoo', `
>  ifdef(`distro_debian',`
>  /run/hotkey-setup	--	gen_context(system_u:object_r:initrc_var_run_t,s0)
>  /run/kdm/.*		--	gen_context(system_u:object_r:initrc_var_run_t,s0)
> +/etc/network/if-pre-up\.d/.* --	gen_context(system_u:object_r:initrc_exec_t,s0)
> +/etc/network/if-up\.d/.* --	gen_context(system_u:object_r:initrc_exec_t,s0)
> +/etc/network/if-down\.d/.* --	gen_context(system_u:object_r:initrc_exec_t,s0)
> +/etc/network/if-post-down\.d/.* -- gen_context(system_u:object_r:initrc_exec_t,s0)
>  ')
>
>  ifdef(`distro_gentoo', `
> Index: refpolicy-2.20170402/policy/modules/system/libraries.fc
> ===================================================================
> --- refpolicy-2.20170402.orig/policy/modules/system/libraries.fc
> +++ refpolicy-2.20170402/policy/modules/system/libraries.fc
> @@ -105,6 +105,7 @@ ifdef(`distro_debian',`
>  /usr/(.*/)?dh-python/dh_pypy		--	gen_context(system_u:object_r:lib_t,s0)
>  ')
>
> +/usr/lib/postfix/lib.*so.*		--	gen_context(system_u:object_r:lib_t,s0)
>  /usr/lib/altivec/libavcodec\.so(\.[^/]*)* --	gen_context(system_u:object_r:textrel_shlib_t,s0)
>  /usr/lib/cedega/.+\.so(\.[^/]*)*	--	gen_context(system_u:object_r:textrel_shlib_t,s0)
>  /usr/lib/dovecot/(.*/)?lib.*\.so.*      --      gen_context(system_u:object_r:lib_t,s0)
> Index: refpolicy-2.20170402/policy/modules/system/lvm.fc
> ===================================================================
> --- refpolicy-2.20170402.orig/policy/modules/system/lvm.fc
> +++ refpolicy-2.20170402/policy/modules/system/lvm.fc
> @@ -42,6 +42,7 @@ ifdef(`distro_gentoo',`
>  /usr/sbin/lvdisplay		--	gen_context(system_u:object_r:lvm_exec_t,s0)
>  /usr/sbin/lvextend		--	gen_context(system_u:object_r:lvm_exec_t,s0)
>  /usr/sbin/lvm			--	gen_context(system_u:object_r:lvm_exec_t,s0)
> +/usr/sbin/lvmetad		--	gen_context(system_u:object_r:lvm_exec_t,s0)
>  /usr/sbin/lvm\.static		--	gen_context(system_u:object_r:lvm_exec_t,s0)
>  /usr/sbin/lvmchange		--	gen_context(system_u:object_r:lvm_exec_t,s0)
>  /usr/sbin/lvmdiskscan		--	gen_context(system_u:object_r:lvm_exec_t,s0)
> @@ -93,3 +94,4 @@ ifdef(`distro_gentoo',`
>  /var/lock/lvm(/.*)?			gen_context(system_u:object_r:lvm_lock_t,s0)
>  /run/multipathd\.sock		-s	gen_context(system_u:object_r:lvm_var_run_t,s0)
>  /run/dmevent.*				gen_context(system_u:object_r:lvm_var_run_t,s0)
> +/run/lvm(/.*)?				gen_context(system_u:object_r:lvm_var_run_t,s0)
> Index: refpolicy-2.20170402/policy/modules/system/udev.fc
> ===================================================================
> --- refpolicy-2.20170402.orig/policy/modules/system/udev.fc
> +++ refpolicy-2.20170402/policy/modules/system/udev.fc
> @@ -39,4 +39,5 @@ ifdef(`distro_redhat',`
>
>  ifdef(`distro_debian',`
>  /run/xen-hotplug -d	gen_context(system_u:object_r:udev_var_run_t,s0)
> +/run/console-setup(/.*)?	gen_context(system_u:object_r:udev_var_run_t,s0)
>  ')
> _______________________________________________
> refpolicy mailing list
> refpolicy at oss.tresys.com
> http://oss.tresys.com/mailman/listinfo/refpolicy
>


-- 
Chris PeBenito

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [refpolicy] [PATCH] misc fc changes again
  2017-04-06 20:58   ` Chris PeBenito
@ 2017-04-07  7:58     ` Dominick Grift
  0 siblings, 0 replies; 5+ messages in thread
From: Dominick Grift @ 2017-04-07  7:58 UTC (permalink / raw)
  To: refpolicy

On Thu, Apr 06, 2017 at 04:58:24PM -0400, Chris PeBenito via refpolicy wrote:
> On 04/05/2017 02:21 PM, cgzones via refpolicy wrote:
> > 2017-04-05 6:24 GMT+02:00 Russell Coker via refpolicy
> > <refpolicy@oss.tresys.com>:
> 
> >> --- refpolicy-2.20170402.orig/policy/modules/kernel/files.fc
> >> +++ refpolicy-2.20170402/policy/modules/kernel/files.fc
> >> @@ -215,6 +215,7 @@ HOME_ROOT/lost\+found/.*    <<none>>
> >>  ifdef(`distro_debian',`
> >>  # on Debian /lib/init/rw is a tmpfs used like /run
> >>  /usr/lib/init/rw(/.*)?         gen_context(system_u:object_r:var_run_t,s0-mls_systemhigh)
> >> +/run/resolvconf(/.*)? -d       gen_context(system_u:object_r:etc_t,s0)
> 
> This only mentions the directories, which I think should remain etc_t, 
> whereas below it only matches the files, so the files remain net_conf_t. 
>   I think this is ok.
> 

I actually yesterday had to explicitly label /etc/sysconfig/network-scripts "network-config" where it use to be "etc_t"

this is because networkmanager creates various files in /etc that have random names (and then renames them)

resolv.conf.XXXX ifcfg-IFNAME keys-IFNAME

and i want to be able to differentiate between resolv.conf and ifcfg-/keys-

they are not eager to use setfscreatecon (and I also prefer transparency)

I think fedora (and maybe refpolicy) also has /etc/sysconfig/network-scripts labeled net_conf_t
It works but its kind of ugly.

But legacy issue. they shouldnt have put scripts in /etc/sysconfig/network-scripts in the first place

these issues can be tricky...

> 
> > in sysnetwork.fc there is an entry:
> > /run/resolvconf/.* -- gen_context(system_u:object_r:net_conf_t,s0)
> > this seems a bit inconvenient
> 
> 
> 
> -- 
> Chris PeBenito
> _______________________________________________
> refpolicy mailing list
> refpolicy at oss.tresys.com
> http://oss.tresys.com/mailman/listinfo/refpolicy

-- 
Key fingerprint = 5F4D 3CDB D3F8 3652 FBD8  02D5 3B6C 5F1D 2C7B 6B02
https://sks-keyservers.net/pks/lookup?op=get&search=0x3B6C5F1D2C7B6B02
Dominick Grift
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
Url : http://oss.tresys.com/pipermail/refpolicy/attachments/20170407/c38d8fa3/attachment-0001.bin 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-04-07  7:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-05  4:24 [refpolicy] [PATCH] misc fc changes again Russell Coker
2017-04-05 18:21 ` cgzones
2017-04-06 20:58   ` Chris PeBenito
2017-04-07  7:58     ` Dominick Grift
2017-04-06 21:01 ` Chris PeBenito

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.