Skip to content

Commit

Permalink
libfuse: pass security context options to kernel
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Dalvik Khertel authored and Miklos Szeredi committed Feb 8, 2013
1 parent c66e7f4 commit c52cafc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@

* libfuse: fix fs cleanup. Reported by Eric Wong

* libfuse: pass security context options to kernel. Patch by
Dalvik Khertel

2013-02-06 Miklos Szeredi <miklos@szeredi.hu>

* libfuse: set close-on-exec flag on pipe file descriptors. Patch
Expand Down
4 changes: 4 additions & 0 deletions lib/mount.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,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),
Expand Down

2 comments on commit c52cafc

@rhatdan
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did this every get merged?

@Nikratio
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, as you can easily check.

Please sign in to comment.