Skip to contentSkip to conversation

seref: patch: postfix and roles

PATCH Serge E. Hallyn 2 participants 2 messages Feb 11, 2006 – Feb 14, 2006 SELinux security module

lore
Share & tools
lore
#0 lore raw

Been trying to send mail as a local user, but user_r was not permitted to associate with postfix_postdrop_t.

Additionally I needed the TODO section uncommented on my system...

thanks,
-serge

policy/modules/services/postfix.if +8 -0
Index: refpolicy/policy/modules/services/postfix.if
===================================================================
@@ -393,3 +393,11 @@ interface(`postfix_domtrans_user_mail_ha
 
 	typeattribute $1 postfix_user_domtrans;
 ')
+
+interface(`postfix_role_associate',`
+	gen_require(`
+		role $1;
+	')
+	role $1 types { postfix_postdrop_t };
+	# role $1 types { postfix_postdrop_t postfix_postqueue_t };
+')
policy/modules/services/mta.if +2 -3
Index: refpolicy/policy/modules/services/mta.if
===================================================================
@@ -224,13 +224,13 @@ template(`mta_per_userdomain_template',`
 		allow $1_mail_t self:capability dac_override;
 		postfix_read_config($1_mail_t)
 		postfix_list_spool($1_mail_t)
+		postfix_role_associate($1_r)
 	')
 
-	ifdef(`TODO',`
 	# Read user temporary files.
 	allow $1_mail_t $1_tmp_t:file r_file_perms;
 	dontaudit $1_mail_t $1_tmp_t:file append;
-	ifdef(`postfix.te',`
+	optional_policy(`postfix',`
 		# postfix seems to need write access if the file handle is opened read/write
 		allow $1_mail_t $1_tmp_t:file write;
 	')
@@ -240,7 +240,6 @@ template(`mta_per_userdomain_template',`
 	# if you do not want to allow dead.letter then use the following instead
 	#allow $1_mail_t { $1_home_dir_t $1_home_t }:dir r_dir_perms;
 	#allow $1_mail_t $1_home_t:file r_file_perms;
-	') dnl end TODO
 ')
 
 ########################################

--
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.

#1 lore raw
Quoted 4 lines · Serge E. Hallyn

Been trying to send mail as a local user, but user_r was not permitted to associate with postfix_postdrop_t.

Additionally I needed the TODO section uncommented on my system...

Merged. I changed the implementation to use userdom interfaces rather than $1_tmp_t since the mta module doesn't know that the user's tmp type can be derived by doing $1_tmp_t. Same thing for roles ($1_r) but the role is passed in as a parameter ($3); however, in this case, postfix has its own per userdomain template, so I moved the role part there.

Signature · 9 lines
Chris PeBenito
Tresys Technology, LLC
(410) 290-1411 x150


--
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.