Skip to contentSkip to conversation

Genfscon 'dash' issue

DISCUSSION korkishko Tymur 2 participants 2 messages Oct 10, 2008 SELinux security module

lore
Share & tools
lore
#0 lore raw

Hello!

I have Linux kernel 2.6.26 with a patch from NSA that allows genfscon support of security contexts for directories/files (others than / ). I use genfscon to label files/directories on cramfs filesystem(read-only filesystem) that does not support xattr.

It seems that current genfscon implementation does not support “–“(dash) in path names. If I try to compile policy containing this line:
genfscon cramfs /usr/sbin/an-app user_u:system_r:my_app_t

I will get an syntax error from checkpolicy aboutusing “– “ (dash) in the path:
ERROR ‘invalid type app’ at token ‘genfscon’ on line...

So, could you please suggest a way to fix theissue with “– “ (dash) and genfscon?

Unfortunately, it is not possible to change “–“(dash) to “_” (underbar) in path names.

Kindest regards,
Tymur Korkishko

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

#1 lore raw
Quoted 8 lines · korkishko Tymur

Hello!

I have Linux kernel 2.6.26 with a patch from NSA that allows genfscon support of security contexts for directories/files (others than / ). I use genfscon to label files/directories on cramfs filesystem(read-only filesystem) that does not support xattr.

It seems that current genfscon implementation does not support “–“(dash) in path names. If I try to compile policy containing this line:
genfscon cramfs /usr/sbin/an-app user_u:system_r:my_app_t

Quoted 6 lines

I will get an syntax error from checkpolicy aboutusing “– “ (dash) in the path:
ERROR ‘invalid type app’ at token ‘genfscon’ on line...

So, could you please suggest a way to fix theissue with “– “ (dash) and genfscon?

Unfortunately, it is not possible to change “–“(dash) to “_” (underbar) in path names.

You'd have to change policy_parse.y in checkpolicy; at present, it treats a "-" followed by an identifier as a file type flag (e.g. -d to only match directories, -b to only match block device files, ...) similar to the file_contexts specification.

Signature · 8 lines
Stephen Smalley
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.