]> git.ipfire.org Git - people/stevee/selinux-policy.git/commitdiff
Allow clamd to read spamd pid file
authorMiroslav Grepl <mgrepl@redhat.com>
Mon, 28 Nov 2011 13:09:15 +0000 (14:09 +0100)
committerMiroslav Grepl <mgrepl@redhat.com>
Mon, 28 Nov 2011 13:10:12 +0000 (14:10 +0100)
 * needs to read /var/spool/MIMEDefang/*

policy/modules/services/clamav.te
policy/modules/services/spamassassin.if

index 4bc077f5cb1a941a5c2bbec8e5c962fe640ef85d..4c06224df0377c8478bf8ede9116f23bba65522b 100644 (file)
@@ -163,6 +163,7 @@ optional_policy(`
 
 optional_policy(`
        spamd_stream_connect(clamd_t)
+       spamd_read_pid(clamd_t)
 ')
 
 tunable_policy(`clamd_use_jit',`
index 85e8212d42e0432f50bd3fa97ce46e94b856783d..4aac595322b356948364e00feca31090d94bdc7b 100644 (file)
@@ -294,6 +294,25 @@ interface(`spamassassin_dontaudit_getattr_spamd_tmp_sockets',`
        dontaudit $1 spamd_tmp_t:sock_file getattr_sock_file_perms;
 ')
 
+#######################################
+## <summary>
+##  Read spamd pid file.
+## </summary>
+## <param name="domain">
+##  <summary>
+##  Domain allowed to connect.
+##  </summary>
+## </param>
+#
+interface(`spamd_read_pid',`
+    gen_require(`
+        type spamd_t, spamd_var_run_t;
+    ')
+
+    files_search_pids($1)
+    read_files_pattern($1, spamd_var_run_t, spamd_var_run_t)
+')
+
 ########################################
 ## <summary>
 ##     Connect to run spamd.