Skip to contentSkip to conversation

mta patch

PATCH Russell Coker 2 participants 2 messages Sep 21, 2002 – Sep 23, 2002 SELinux security module

lore
Share & tools
lore
#0 lore raw

The attached policy patch improves the support for qmail and postfix, the general support for mail servers other than Sendmail, and allows initrc_t programs to run mailx (IE to send mail from an initrc script).

Signature · 4 lines
There is no point PGP/GPG signing an email unless the signature can be
verified.  If you post to a list then don't sign the message unless your
key is available on public key servers and has been signed by someone
who is in the web of trust, otherwise you just waste bandwidth and CPU.
domains/program/initrc.te renamed from tmp/policy/domains/program/initrc.te +1 -1
diff -ru /tmp/policy/domains/program/initrc.te policy/domains/program/initrc.te
@@ -9,7 +9,7 @@
 # initrc_t is the domain of the init rc scripts.
 # initrc_exec_t is the type of the init program.
 #
-type initrc_t, domain, privlog, privowner;
+type initrc_t, domain, privlog, privowner, privmail;
 role system_r types initrc_t;
 every_domain(initrc_t)
 type initrc_exec_t, file_type, sysadmfile, exec_type;
domains/program/qmail.te renamed from tmp/policy/domains/program/qmail.te +1 -1
diff -ru /tmp/policy/domains/program/qmail.te policy/domains/program/qmail.te
@@ -140,7 +140,7 @@
 allow qmail_qread_t etc_qmail_t:dir search;
 allow qmail_qread_t privfd:fd use;
 
-daemon_sub_domain(qmail_inject_t, qmail_queue)
+daemon_sub_domain(qmail_inject_t, qmail_queue, `, mta_user_agent')
 role sysadm_r types qmail_queue_t;
 in_user_role(qmail_queue_t)
 allow qmail_inject_t qmail_queue_exec_t:file read;
file_contexts/program/postfix.fc renamed from tmp/policy/file_contexts/program/postfix.fc +1 -1
diff -ru /tmp/policy/file_contexts/program/postfix.fc policy/file_contexts/program/postfix.fc
@@ -7,7 +7,7 @@
 /usr/lib/postfix/local		system_u:object_r:postfix_local_exec_t
 /usr/lib/postfix/master		system_u:object_r:postfix_master_exec_t
 /usr/lib/postfix/pickup		system_u:object_r:postfix_pickup_exec_t
-/usr/lib/postfix/qmgr		system_u:object_r:postfix_qmgr_exec_t
+/usr/lib/postfix/(n)?qmgr	system_u:object_r:postfix_qmgr_exec_t
 /usr/lib/postfix/showq		system_u:object_r:postfix_showq_exec_t
 /usr/lib/postfix/smtp		system_u:object_r:postfix_smtp_exec_t
 /usr/lib/postfix/smtpd		system_u:object_r:postfix_smtpd_exec_t
macros/program/mta_macros.te renamed from tmp/policy/macros/program/mta_macros.te +2 -0
diff -ru /tmp/policy/macros/program/mta_macros.te policy/macros/program/mta_macros.te
@@ -62,6 +62,8 @@
 ')
 allow mta_user_agent $1_tmp_t:file { read getattr };
 
+allow mta_user_agent { $1_devpts_t $1_tty_device_t }:chr_file { read write };
+
 # Write to the user domain tty.
 allow $1_mail_t $1_tty_device_t:chr_file rw_file_perms;
 allow $1_mail_t $1_devpts_t:chr_file rw_file_perms;
#1 lore raw
Quoted 3 lines · Russell Coker

The attached policy patch improves the support for qmail and postfix, the general support for mail servers other than Sendmail, and allows initrc_t programs to run mailx (IE to send mail from an initrc script).

I've been omitting 'privmail' from initrc_t, as it creates a type transition conflict when using sendmail and it seems odd to me to have an rc script send mail. Is sending email from an rc script common?

--
Stephen D. Smalley, NAI Labs
[email protected]

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