libfuse: pass security context options to kernel
authorDalvik Khertel <khertel@outlook.com>
Thu, 9 Aug 2012 12:48:20 +0000 (12:48 +0000)
committerNikolaus Rath <Nikolaus@rath.org>
Mon, 20 Jun 2016 19:49:36 +0000 (12:49 -0700)
Mount can be used with an "-o context=" option in order to specify a
mountpoint-wide SELinux security context different from the default context
provided by the active SELinux policy.

This is useful in order to enable users to mount multiple sshfs targets under
distinct contexts, which is my main motivation for getting this patch mainlined.

Closes: #36
ChangeLog
lib/mount.c

index 18358dcd3c7e64f217a698533844116045731294..d18888d35857d532fbea2e31a6e0d1133120c26c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Unreleased Changes
+==================
+
+* Added SELinux support.
+
 FUSE 2.9.6 (2016-04-23)
 =======================
 
index ef8ffd439c3b4723431d425058716460dcd898cd..227a4082d99e586309a0379056bf370d45b885b8 100644 (file)
@@ -98,6 +98,10 @@ static const struct fuse_opt fuse_mount_opts[] = {
        FUSE_OPT_KEY("large_read",              KEY_KERN_OPT),
        FUSE_OPT_KEY("blksize=",                KEY_KERN_OPT),
        FUSE_OPT_KEY("default_permissions",     KEY_KERN_OPT),
+       FUSE_OPT_KEY("context=",                KEY_KERN_OPT),
+       FUSE_OPT_KEY("fscontext=",              KEY_KERN_OPT),
+       FUSE_OPT_KEY("defcontext=",             KEY_KERN_OPT),
+       FUSE_OPT_KEY("rootcontext=",            KEY_KERN_OPT),
        FUSE_OPT_KEY("max_read=",               KEY_KERN_OPT),
        FUSE_OPT_KEY("max_read=",               FUSE_OPT_KEY_KEEP),
        FUSE_OPT_KEY("user=",                   KEY_MTAB_OPT),