Skip to content

Commit

Permalink
Don't require mount point to exists on macOS
Browse files Browse the repository at this point in the history
By default volumes are mounted under /Volumes on macOS. Since macOS
10.12 the /Volumes directory is root-owned. In order to allow non-
privileged users to mount FUSE volumes under /Volumes FUSE will create
non-existent mount points automatically.

Fixes #27
  • Loading branch information
bfleischer committed Jul 7, 2017
1 parent 5c0dbfe commit f187961
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sshfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -4121,7 +4121,7 @@ int main(int argc, char *argv[])
char *mountpoint;
int multithreaded;
int foreground;
#if !defined(__CYGWIN__)
#if !defined(__APPLE__) && !defined(__CYGWIN__)
struct stat st;
#endif

Expand All @@ -4135,14 +4135,14 @@ int main(int argc, char *argv[])
foreground = 1;
}

#if !defined(__CYGWIN__)
#if !defined(__APPLE__) && !defined(__CYGWIN__)
res = stat(mountpoint, &st);
if (res == -1) {
perror(mountpoint);
exit(1);
}
sshfs.mnt_mode = st.st_mode;
#elif defined(__CYGWIN__)
#else
sshfs.mnt_mode = S_IFDIR | 0755;
#endif

Expand Down

0 comments on commit f187961

Please sign in to comment.