Skip to content

Commit

Permalink
Let mount_osxfuse create mount point
Browse files Browse the repository at this point in the history
In macOS 10.12 the permissions of the root-owned /Volumes directory
have changed from 1777 (rwxrwxrwt) to 1755 (rwxr-xr-t). As a result
admin privileges are required to create mount points in /Volumes.

In order to allow non-admin users to mount FUSE volumes in /Volumes
mount_osxfuse will create non-existent mount points.
  • Loading branch information
bfleischer committed Aug 22, 2016
1 parent 6229092 commit 4ff5ecf
Showing 1 changed file with 6 additions and 18 deletions.
24 changes: 6 additions & 18 deletions lib/helper.c
Expand Up @@ -8,7 +8,7 @@

/*
* Copyright (c) 2006-2008 Amit Singh/Google Inc.
* Copyright (c) 2011-2012 Benjamin Fleischer
* Copyright (c) 2011-2016 Benjamin Fleischer
*/

#include "config.h"
Expand Down Expand Up @@ -120,28 +120,16 @@ static int fuse_helper_opt_proc(void *data, const char *arg, int key,
if (!hopts->mountpoint) {
char mountpoint[PATH_MAX];
if (realpath(arg, mountpoint) == NULL) {
#ifdef __APPLE__
return fuse_opt_add_opt(&hopts->mountpoint,
arg);
#else /* !__APPLE__ */
fprintf(stderr,
"fuse: bad mount point `%s': %s\n",
arg, strerror(errno));
return -1;
#endif /* !__APPLE__ */
}
#ifdef __APPLE__
else {
struct stat sb;
if (stat(mountpoint, &sb) != 0) {
fprintf(stderr,
"fuse: failed to stat mount point `%s': %s\n",
mountpoint, strerror(errno));
return -1;
}
if ((sb.st_mode & S_IFMT) != S_IFDIR) {
fprintf(stderr,
"fuse: mount point is not a directory `%s'\n",
mountpoint);
return -1;
}
}
#endif
return fuse_opt_add_opt(&hopts->mountpoint, mountpoint);
} else {
fprintf(stderr, "fuse: invalid argument `%s'\n", arg);
Expand Down

0 comments on commit 4ff5ecf

Please sign in to comment.