Policy format: apostrophe in comments
What about this bug? It complains about not being able to use apostrophe in the policy config. Any chance this will be fixed, or should I leave it alone? I ask because I was confused what was wrong with my policy when adding apostr. comments.
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=146553
Signature · 8 lines
Ivan Gyurdiev <[email protected]> Cornell University -- 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.
Quoted 6 lines · Ivan Gyurdiev
What about this bug? It complains about not being able to use apostrophe in the policy config. Any chance this will be fixed, or should I leave it alone? I ask because I was confused what was wrong with my policy when adding apostr. comments.
Yes, that has bothered me as well; it is a curious property of m4 that it interprets quotes even within comments. An option would be to use the m4 changequote builtin to change the start-quote and end-quote delimiters, but that would require rewriting all actual uses of the existing quote characters in the existing policy to use the new delimiters. Obviously not my highest priority, but I'd be willing to consider patches that make such a change.
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.
Quoted 7 lines · Stephen Smalley
Quoted 5 lines · Ivan Gyurdiev
What about this bug? It complains about not being able to use apostrophe in the policy config. Any chance this will be fixed, or should I leave it alone? I ask because I was confused what was wrong with my policy when adding apostr. comments.
Quoted 5 lines
Yes, that has bothered me as well; it is a curious property of m4 that it interprets quotes even within comments.
I thought this as well. I discovered, with some help from Gary Vaughan at gnu.org, that what I thought was a comment was actually embedded in a quoted string. For example:
define(only_trans',
#
# Allow the user's process to transition.
#
allow $1 $3:process transition;
')
The comment is actually _in_ the quoted string, so the apostrophe in the comment matches the end delimeter of the string and problems occur. It should really be written as:
define(`only_trans',
#
# Allow the user's process to transition.
#
`
allow $1 $3:process transition;
')
Quoted 5 lines
An option would be to use
the m4 changequote builtin to change the start-quote and end-quote delimiters, but that would require rewriting all actual uses of the existing quote characters in the existing policy to use the new delimiters.
Changing the quote delimeter was the suggestion I received from Gary, but you are always going to end up vulnerable because of what someone puts into what they believe is a comment line.
Obviously not my highest priority, but I'd be willing to
Quoted 2 lines
consider patches that make such a change.
David
Signature · 12 lines
__________________________________ David Caplan 410 290 1411 x105 [email protected] Tresys Technology, LLC 8840 Stanford Blvd., Suite 2100 Columbia, MD 21045 -- 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.