Research Menu

.
Skip Search Box

SELinux Mailing List

Re: using procmail under SE-Linux

From: Stephen Smalley <sds_at_epoch.ncsc.mil>
Date: Fri, 19 Nov 2004 13:43:45 -0500


On Thu, 2004-11-18 at 23:06, Colin Walters wrote:
> However, I've learned a lot about SELinux since then, and I think a
> better approach would be to use security_compute_relabel. Then the
> policy itself can specify the type to use, via type_transition. For
> example:
>
> type_transition postfix_local_t user_home_dir_t:dir user_procmail_t.
>
> So procmail would compute the domain to use like this, in pseudocode:
>
> newcon = security_compute_relabel (getcon (),
> getfilecon (getpwent (getuid ())->pw_dir))
> setexeccon(newcon)
>
> To do this right, you create a postfix_user_domain($1) macro, call it
> from base_user_macros.te (and probably ifdef(`procmail.te')).
>
> I think this is arguably cleaner than having another config file
> in /etc.

Nit: That would be security_compute_create(), which internally consults type_transition rules. security_compute_relabel() is for relabeling and consults type_change rules.

However, I think you would actually just use get_default_context(), and define appropriate entries in default_contexts for procmail.

-- 
Stephen Smalley <sds@epoch.ncsc.mil>
National Security Agency


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.
Received on Fri 19 Nov 2004 - 13:53:28 EST
 

Date Posted: Jan 15, 2009 | Last Modified: Jan 15, 2009 | Last Reviewed: Jan 15, 2009

 
bottom

National Security Agency / Central Security Service