All of lore.kernel.org
 help / color / mirror / Atom feed
* keywords in .fc files
@ 2015-02-11 10:57 Colin Powers
  2015-02-11 13:44 ` Stephen Smalley
  2015-02-11 13:47 ` Christopher J. PeBenito
  0 siblings, 2 replies; 3+ messages in thread
From: Colin Powers @ 2015-02-11 10:57 UTC (permalink / raw)
  To: SELinux@tycho.nsa.gov

Hi all,

We are trying in a .fc file to assign a label to a directory path containing the word 'include', e.g.

/opt/mydir/include(/.*)?		-d	gen_context(system_u:object_r:my_context_t,s0)

However it seems 'include(...)' is interpreted as a keyword/macro which causes a compilation error:
`/.*': No such file or directory

Is there a way around this, other than by doing something funny with the regex, like wildcarding one of the letters?

Cheers
Colin

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: keywords in .fc files
  2015-02-11 10:57 keywords in .fc files Colin Powers
@ 2015-02-11 13:44 ` Stephen Smalley
  2015-02-11 13:47 ` Christopher J. PeBenito
  1 sibling, 0 replies; 3+ messages in thread
From: Stephen Smalley @ 2015-02-11 13:44 UTC (permalink / raw)
  To: Colin Powers, SELinux@tycho.nsa.gov

On 02/11/2015 05:57 AM, Colin Powers wrote:
> Hi all,
> 
> We are trying in a .fc file to assign a label to a directory path containing the word 'include', e.g.
> 
> /opt/mydir/include(/.*)?		-d	gen_context(system_u:object_r:my_context_t,s0)
> 
> However it seems 'include(...)' is interpreted as a keyword/macro which causes a compilation error:
> `/.*': No such file or directory
> 
> Is there a way around this, other than by doing something funny with the regex, like wildcarding one of the letters?

I'm guessing that this is a result of passing the .fc file through m4 to
expand macros like gen_context().  So perhaps you could just quote it to
avoid expansion by m4?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: keywords in .fc files
  2015-02-11 10:57 keywords in .fc files Colin Powers
  2015-02-11 13:44 ` Stephen Smalley
@ 2015-02-11 13:47 ` Christopher J. PeBenito
  1 sibling, 0 replies; 3+ messages in thread
From: Christopher J. PeBenito @ 2015-02-11 13:47 UTC (permalink / raw)
  To: Colin Powers, SELinux@tycho.nsa.gov

On 2/11/2015 5:57 AM, Colin Powers wrote:
> Hi all,
> 
> We are trying in a .fc file to assign a label to a directory path containing the word 'include', e.g.
> 
> /opt/mydir/include(/.*)?		-d	gen_context(system_u:object_r:my_context_t,s0)
> 
> However it seems 'include(...)' is interpreted as a keyword/macro which causes a compilation error:
> `/.*': No such file or directory
> 
> Is there a way around this, other than by doing something funny with the regex, like wildcarding one of the letters?

You can do a "stupid m4 trick", by adding in an empty string
(backtick-apostraphe) before the open parenthesis:

/opt/mydir/include`'(/.*)?


For example:

$ cat test
/opt/mydir/include`'(/.*)?

$ m4 test
/opt/mydir/include(/.*)?


Note: Reference Policy questions should be asked on the refpolicy list
(http://oss.tresys.com/mailman/listinfo/refpolicy)

-- 
Chris PeBenito
Tresys Technology, LLC
www.tresys.com | oss.tresys.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-02-11 13:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-11 10:57 keywords in .fc files Colin Powers
2015-02-11 13:44 ` Stephen Smalley
2015-02-11 13:47 ` Christopher J. PeBenito

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.