Skip to contentSkip to conversation

ls --context of /selinux

DISCUSSION Russell Coker 3 participants 3 messages Sep 2, 2003 SELinux security module

lore
Share & tools
lore
#0 lore raw

What are the plans regarding "ls --context /selinux"?

Currently the lgetxattr() system call returns -1 (EOPNOTSUPP) and the current ls patch (taken from Dan's repository) refuses to even allow "ls -l" because of it (probably a bug in ls as I imagine that there will always be file systems that don't support it).

Will "ls --context /selinux" ever work?

Signature · 10 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.
#1 lore raw
Quoted 8 lines · Russell Coker

What are the plans regarding "ls --context /selinux"?

Currently the lgetxattr() system call returns -1 (EOPNOTSUPP) and the current ls patch (taken from Dan's repository) refuses to even allow "ls -l" because of it (probably a bug in ls as I imagine that there will always be file systems that don't support it).

Will "ls --context /selinux" ever work?

Since SELinux migrated to using xattr, the utilities can only get and set the contexts of files in a filesystem if it provides an xattr handler. There doesn't seem to be any reason to support getting or setting contexts on selinuxfs entries, so I wouldn't expect us to implement an xattr handler for it. The 'ls' in the patched coreutils from the NSA SELinux site simply displays (null) in the context field for such filesystems; I'm not sure why Dan has changed the behavior in his latest patch. There will always be at least some filesystem types that will not provide xattr handlers, so it does need to cleanly handle this case.

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.
#2 lore raw

I have recieved a bug report on this, so I am fixing and should have a new rpm today.

Dan

Quoted 24 lines · Stephen Smalley
Quoted 7 lines · Russell Coker

What are the plans regarding "ls --context /selinux"?

Currently the lgetxattr() system call returns -1 (EOPNOTSUPP) and the current ls patch (taken from Dan's repository) refuses to even allow "ls -l" because of it (probably a bug in ls as I imagine that there will always be file systems that don't support it).

Will "ls --context /selinux" ever work?

Since SELinux migrated to using xattr, the utilities can only get and set the contexts of files in a filesystem if it provides an xattr handler. There doesn't seem to be any reason to support getting or setting contexts on selinuxfs entries, so I wouldn't expect us to implement an xattr handler for it. The 'ls' in the patched coreutils from the NSA SELinux site simply displays (null) in the context field for such filesystems; I'm not sure why Dan has changed the behavior in his latest patch. There will always be at least some filesystem types that will not provide xattr handlers, so it does need to cleanly handle this case.