Skip to contentSkip to conversation

distro.tun

PATCH Russell Coker 2 participants 6 messages Aug 19, 2004 – Aug 20, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

The attached patch makes the distro tunable macros define to their same values. This is useful because distributions have many files named after the distribution and sometimes the file needs a different label to other files in the same directory.

Of course we could have names like (r)edhat in file names, but I think that this is the most convenient solution which will cause the least confusion.

Signature · 4 lines
http://www.coker.com.au/selinux/   My NSA Security Enhanced Linux packages
http://www.coker.com.au/bonnie++/  Bonnie++ hard drive benchmark
http://www.coker.com.au/postal/    Postal SMTP/POP benchmark
http://www.coker.com.au/~russell/  My home page
distro.tun renamed from usr/src/se/policy/tunables/distro.tun +4 -4
@@ -5,10 +5,10 @@
 # appropriate ifdefs.
 
 
-dnl define(`redhat')
+dnl define(`redhat', `redhat')
 
-dnl define(`suse')
+dnl define(`suse', `suse')
 
-dnl define(`gentoo')
+dnl define(`gentoo', `gentoo')
 
-dnl define(`debian')
+dnl define(`debian', `debian')
#1 lore raw
Quoted 7 lines · Russell Coker

The attached patch makes the distro tunable macros define to their same values. This is useful because distributions have many files named after the distribution and sometimes the file needs a different label to other files in the same directory.

Of course we could have names like (r)edhat in file names, but I think that this is the most convenient solution which will cause the least confusion.

My previous patch was bogus, I should know better than to send a patch untested late at night even if it's trivial.

It put m4 into an infinite loop.

Now we can do a macro definition such as the following:
define(redhat, `redhat')

But this means that if you pass "redhat" without the ' M4 quotes to a macro it can still go into an infinite loop. To get this to work with full_user_role(redhat) we need to change most instances of "$1" to "$1'" in the macros files.

By using "redhat", "debian", "gentoo", and "suse" as flag macros we are essentially making them reserved words. I think that the most practical solution to this problem is to use "USING_REDHAT" etc as the flag macros. The chance of someone wanting a user role named USING_REDHAT_r is quite low, while the incidence of people wanting a redhat_r role is much higher.

Signature · 4 lines
http://www.coker.com.au/selinux/   My NSA Security Enhanced Linux packages
http://www.coker.com.au/bonnie++/  Bonnie++ hard drive benchmark
http://www.coker.com.au/postal/    Postal SMTP/POP benchmark
http://www.coker.com.au/~russell/  My home page

# Distro-specific customizations.

# Comment out all but the one that matches your distro.
# The policy .te files can then wrap distro-specific customizations with

# appropriate ifdefs.

dnl define(redhat, `redhat')

dnl define(suse, `suse')

dnl define(gentoo, `gentoo')

dnl define(debian, `debian')

#2 lore raw
Quoted 22 lines · Russell Coker
Quoted 7 lines · Russell Coker

The attached patch makes the distro tunable macros define to their same values. This is useful because distributions have many files named after the distribution and sometimes the file needs a different label to other files in the same directory.

Of course we could have names like (r)edhat in file names, but I think that this is the most convenient solution which will cause the least confusion.

My previous patch was bogus, I should know better than to send a patch untested late at night even if it's trivial.

It put m4 into an infinite loop.

Now we can do a macro definition such as the following:
define(redhat, `redhat')

But this means that if you pass "redhat" without the ' M4 quotes to a macro it can still go into an infinite loop. To get this to work with full_user_role(redhat) we need to change most instances of "$1" to "$1'" in the macros files.

Quoted 5 lines

By using "redhat", "debian", "gentoo", and "suse" as flag macros we are essentially making them reserved words. I think that the most practical solution to this problem is to use "USING_REDHAT" etc as the flag macros. The chance of someone wanting a user role named USING_REDHAT_r is quite low, while the incidence of people wanting a redhat_r role is much higher.

distro_redhat, distro_debian, distro_gentoo, distro_suse. No need to shout.

Signature · 8 lines
Stephen Smalley <[email protected]>
National Security Agency


--
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.
#3 lore raw
Quoted 9 lines · Stephen Smalley
Quoted 6 lines

By using "redhat", "debian", "gentoo", and "suse" as flag macros we are essentially making them reserved words. I think that the most practical solution to this problem is to use "USING_REDHAT" etc as the flag macros. The chance of someone wanting a user role named USING_REDHAT_r is quite low, while the incidence of people wanting a redhat_r role is much higher.

distro_redhat, distro_debian, distro_gentoo, distro_suse. No need to shout.

I think that there is a need to shout. As there is currently no upper-case used in the policy the chance of someone using the string "USING_REDHAT" or "DISTRO_REDHAT" is lower than that of "using_redhat" or "distro_redhat".

Signature · 9 lines
http://www.coker.com.au/selinux/   My NSA Security Enhanced Linux packages
http://www.coker.com.au/bonnie++/  Bonnie++ hard drive benchmark
http://www.coker.com.au/postal/    Postal SMTP/POP benchmark
http://www.coker.com.au/~russell/  My home page

--
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.
#4 lore raw
Quoted 3 lines · Russell Coker

I think that there is a need to shout. As there is currently no upper-case used in the policy the chance of someone using the string "USING_REDHAT" or "DISTRO_REDHAT" is lower than that of "using_redhat" or "distro_redhat".

This rationale would lead us to uppercasing all tunables and possibly even the program used flags. Overkill.

Signature · 8 lines
Stephen Smalley <[email protected]>
National Security Agency


--
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.
#5 lore raw
In reply to Stephen Smalley
Quoted 1 line · Stephen Smalley

distro_redhat, distro_debian, distro_gentoo, distro_suse.

Patch committed to sourceforge CVS.

Signature · 8 lines
Stephen Smalley <[email protected]>
National Security Agency


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