Skip to contentSkip to conversation

var_run_domain enhancement

PATCH Chris PeBenito 2 participants 2 messages Dec 22, 2003 SELinux security module

lore
Share & tools
lore
#0 lore raw

Attached is a patch to add an optional second argument to the var_run_domain macro. It makes it possible to specify the classes to use, and if $2 isn't specified, it defaults to file so current usages don't break. This is useful if a daemon puts a sock_file in /var/run, instead of a pid file, for example.

macros/global_macros.te | 10 ++++++++--

1 files changed, 8 insertions(+), 2 deletions(-)
Signature · 8 lines
Chris PeBenito
<[email protected]>
Developer,
Hardened Gentoo Linux
Embedded Gentoo Linux
 
Public Key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xE6AF9243
Key fingerprint = B0E6 877A 883F A57A 8E6A  CB00 BC8E E42D E6AF 9243
macros/global_macros.te +8 -2
diff -urN policy-1.4.orig/macros/global_macros.te policy-1.4/macros/global_macros.te
@@ -277,11 +277,17 @@
 ')dnl
 
 # allow a domain to create its own files under /var/run and to create files
-# in directories that are created for it.  For sock_file etc you need to add
-# your own rules
+# in directories that are created for it.  $2 is an optional list of 
+# classes to use; default is file.
 define(`var_run_domain', `
 type $1_var_run_t alias var_run_$1_t, file_type, sysadmfile, pidfile;
+
+ifelse(`$2', `', `
 file_type_auto_trans($1_t, var_run_t, $1_var_run_t, file)
+', `
+file_type_auto_trans($1_t, var_run_t, $1_var_run_t, $2)
+')
+
 allow $1_t $1_var_run_t:dir rw_dir_perms;
 ')
 
#1 lore raw
Quoted 2 lines · Chris PeBenito

Attached is a patch to add an optional second argument to the var_run_domain macro. It makes it possible to specify the classes to

OK, I've put that in my tree.

Signature · 10 lines
http://www.coker.com.au/selinux/   My NSA Security Enhanced Linux packages
http://www.coker.com.au/bonnie++/  Bonnie++ hard drive benchmark
http://www.coker.com.au/postal/    Postal SMTP/POP benchmark
http://www.coker.com.au/~russell/  My home page


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.