fuse: Add -oallow_other by default where possible
authorAndrew Deason <adeason@sinenomine.net>
Fri, 2 Dec 2011 22:06:42 +0000 (16:06 -0600)
committerDerrick Brashear <shadow@dementix.org>
Tue, 27 Dec 2011 04:21:24 +0000 (20:21 -0800)
By default, fuse mountpoints are only accessible by the same uid as
that which mounted the fuse filesystem. When we're running as root,
specify -oallow_other so by default anyone can access the afs
mountpoint.

Change-Id: Idc732a22136fbe6bc585b76ac6291d8518f1f9de
Reviewed-on: http://gerrit.openafs.org/6390
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

src/afsd/afsd_fuse.c

index 1bf5e86..de80b52 100644 (file)
@@ -545,6 +545,12 @@ main(int argc, char **argv)
         * in df/mount/mnttab/etc output. */
        fuse_opt_add_arg(&fuse_args, "-ouse_ino,fsname=AFS");
 
+       if (getuid() == 0) {
+           /* allow other users to access the mountpoint. only do this for
+            * root, since non-root may or may not be able to do this */
+           fuse_opt_add_arg(&fuse_args, "-oallow_other");
+       }
+
        code = uafs_Setup("/afs");
        if (code) {
                errno = code;