Handling labeling on filesystems that don't support SELinux

Sean E. Millichamp sean at bruenor.org
Thu Nov 6 19:13:05 UTC 2008


I have been working on SELinux support for Puppet.  One issue that has
cropped up is the behavior on filesystems which don't support SELinux.

They all appear to get a default label, some seem to allow changing the
label (VFAT) in a non-persistent manner, some seem to throw "not
supported" errors (NFS).

How can I detect if a file is on a filesystem which supports SELinux
without trying to update the label?

The best idea so far as been to parse /proc/mounts and use that to
determine what type of filesystem a file lives on, then check it against
a whitelist (which would include ext3, xfs, ?) but it seems like there
has to be a cleaner/simpler way.

What I would like would be a "getfilecon" call that returns the real
label, ignoring any mount-time defaults.

Any ideas?

Thanks,
Sean





More information about the fedora-selinux-list mailing list