diff options
author | rwatson <rwatson@FreeBSD.org> | 2002-08-02 03:12:40 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2002-08-02 03:12:40 +0000 |
commit | 1fa5d0d92735b9331ec50d8101a6c705609e7373 (patch) | |
tree | 0178db361f7541a338223956f91bf012ce303fc2 /sys/fs/devfs/devfs_vnops.c | |
parent | fcd05421a144c13358ae318ae789fdeb09023a82 (diff) | |
download | FreeBSD-src-1fa5d0d92735b9331ec50d8101a6c705609e7373.zip FreeBSD-src-1fa5d0d92735b9331ec50d8101a6c705609e7373.tar.gz |
Introduce support for Mandatory Access Control and extensible
kernel access control.
Teach devfs how to respond to pathconf() _POSIX_MAC_PRESENT queries,
allowing it to indicate to user processes that individual vnode labels
are available.
Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs
Diffstat (limited to 'sys/fs/devfs/devfs_vnops.c')
-rw-r--r-- | sys/fs/devfs/devfs_vnops.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/fs/devfs/devfs_vnops.c b/sys/fs/devfs/devfs_vnops.c index 1b403d7..9ac3745 100644 --- a/sys/fs/devfs/devfs_vnops.c +++ b/sys/fs/devfs/devfs_vnops.c @@ -509,6 +509,17 @@ devfs_pathconf(ap) case _PC_PATH_MAX: *ap->a_retval = PATH_MAX; return (0); + case _POSIX_MAC_PRESENT: +#ifdef MAC + /* + * If MAC is enabled, devfs automatically supports + * trivial non-persistant label storage. + */ + *ap->a_retval = 1; +#else + *ap->a_retval = 0; +#endif /* MAC */ + return (0); default: return (vop_stdpathconf(ap)); } |