Skip to contentSkip to conversation

addition for xdm.te

DISCUSSION Russell Coker 2 participants 6 messages Mar 21, 2002 SELinux security module

lore
Share & tools
lore
#0 lore raw

domain_auto_trans(initrc_t, xdm_exec_t, xdm_t)

Signature · 9 lines
If you send email to me or to a mailing list that I use which has >4 lines
of legalistic junk at the end then you are specifically authorizing me to do
whatever I wish with the message and all other messages from your domain, by
posting the message you agree that your long legalistic sig is void.

--
You have received this message because you are subscribed to the selinux 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 1 line · Russell Coker

domain_auto_trans(initrc_t, xdm_exec_t, xdm_t)

Why? Do some people start xdm from an rc script? If not, then there is no reason to provide a transition from initrc_t. There is already a transition in init.te to handle xdm being started directly by init, as configured in /etc/inittab:
domain_auto_trans(init_t, xdm_exec_t, xdm_t)

We could move the above domain_auto_trans rule from init.te to xdm.te to provide better encapsulation of xdm_t. In general, it is debateable whether it is better to place the rule in the source domain's .te file or the target domain's .te file. Originally, the convention was to place the rule in the source domain's .te file, listing all outgoing transitions from a domain. I chose to distribute the rules for big "multiplexor" domains among the target domain .te files in the last release to make it easier to add new daemons and user domains without needing to update a central source domain .te file each time, but the other domains still tend to follow the original convention.

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

--
You have received this message because you are subscribed to the selinux list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

#2 lore raw
Quoted 4 lines · Stephen Smalley
Quoted 1 line · Russell Coker

domain_auto_trans(initrc_t, xdm_exec_t, xdm_t)

Why? Do some people start xdm from an rc script? If not, then there is

Yes, I think that most people who don't use Red Hat use an rc script.

The whole thing of changing run-levels to stop and start an xdm is a Red Hatism (although it may be a mistake they copied from Slackware).

Quoted 5 lines

no reason to provide a transition from initrc_t. There is already a transition in init.te to handle xdm being started directly by init, as configured in /etc/inittab:
domain_auto_trans(init_t, xdm_exec_t, xdm_t)

Quoted 10 lines

We could move the above domain_auto_trans rule from init.te to xdm.te to provide better encapsulation of xdm_t. In general, it is debateable whether it is better to place the rule in the source domain's .te file or the target domain's .te file. Originally, the convention was to place the rule in the source domain's .te file, listing all outgoing transitions from a domain. I chose to distribute the rules for big "multiplexor" domains among the target domain .te files in the last release to make it easier to add new daemons and user domains without needing to update a central source domain .te file each time, but the other domains still tend to follow the original convention.

I think it makes more sense to have all the xdm policy in the xdm file. Then someone who doesn't use a xdm type program can remove the file and everything else will be fine.

Regarding the file contexts. What if we had the file contexts lines in the .te files? We could have them prefixed by "###" so that they don't get parsed as domain rules but can be easily recognised in the policy.conf. Then it would be a simple matter of:
grep ^### policy.conf | cut -c 4-200 > file_contexts

Or if ### in config files is too grungy for you then put the following in the macro file:
define(file_context', ###')dnl

Signature · 9 lines
If you send email to me or to a mailing list that I use which has >4 lines
of legalistic junk at the end then you are specifically authorizing me to do
whatever I wish with the message and all other messages from your domain, by
posting the message you agree that your long legalistic sig is void.

--
You have received this message because you are subscribed to the selinux list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#3 lore raw
Quoted 9 lines · Russell Coker

Regarding the file contexts. What if we had the file contexts lines in the .te files? We could have them prefixed by "###" so that they don't get parsed as domain rules but can be easily recognised in the policy.conf. Then it would be a simple matter of:
grep ^### policy.conf | cut -c 4-200 > file_contexts

Or if ### in config files is too grungy for you then put the following in the macro file:
define(file_context', ###')dnl

I'd rather keep them as separate .fc files under the setfiles directory, as in the archive that I sent earlier. The file contexts configuration is logically separate from the example policy configuration, and I'd like to keep it physically separate as well.

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

--
You have received this message because you are subscribed to the selinux list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

#4 lore raw
In reply to Russell Coker
Quoted 3 lines · Russell Coker

I think it makes more sense to have all the xdm policy in the xdm file. Then someone who doesn't use a xdm type program can remove the file and everything else will be fine.

This isn't as straightforward as it might appear. Consider the xdm-related rules in user_macros.te and netscape_macros.te. We can relocate those rules to xdm.te through the use of type attributes (to cover all user domains and all netscape domains), but you then have a little piece of the netscape policy in the xdm.te file. Perhaps that is more acceptable than having a little piece of the xdm policy in the netscape_macros.te file.

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

--
You have received this message because you are subscribed to the selinux list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

#5 lore raw
Quoted 5 lines · Stephen Smalley
Quoted 3 lines · Russell Coker

I think it makes more sense to have all the xdm policy in the xdm file. Then someone who doesn't use a xdm type program can remove the file and everything else will be fine.

Quoted 7 lines

This isn't as straightforward as it might appear. Consider the xdm-related rules in user_macros.te and netscape_macros.te. We can relocate those rules to xdm.te through the use of type attributes (to cover all user domains and all netscape domains), but you then have a little piece of the netscape policy in the xdm.te file. Perhaps that is more acceptable than having a little piece of the xdm policy in the netscape_macros.te file.

What if you have some shell code such as the following to generate m4 macro definitions:
( cd domains/program/ ; for n in * ; do echo "define(\`$n')"; done )

Then in netscape.te you can have:
ifdef(xdm.te', ...

Or in xdm.te you can have:
ifdef(netscape.te', ...

While we're at it we could use similar m4 code to use those generated macros in file_contexts to make it adapt to the policy files you have installed.

It may be almost as straightforward as it appears! ;)

Signature · 9 lines
If you send email to me or to a mailing list that I use which has >4 lines
of legalistic junk at the end then you are specifically authorizing me to do
whatever I wish with the message and all other messages from your domain, by
posting the message you agree that your long legalistic sig is void.

--
You have received this message because you are subscribed to the selinux list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.