aboutsummaryrefslogtreecommitdiff
path: root/sshfs.c
diff options
context:
space:
mode:
authorBenjamin Fleischer <fleiben@gmail.com>2017-07-07 23:30:17 +0200
committerBenjamin Fleischer <fleiben@gmail.com>2017-07-07 23:30:17 +0200
commitf187961c7a6a2433c8af7e758d8185568d8006a2 (patch)
tree76ddb6e61c2ffa5b0036bdaf3d01ab5f885a95aa /sshfs.c
parent5c0dbfe3eb40100f9277e863926f2e7d7c9a5a4c (diff)
downloadsshfs-f187961c7a6a2433c8af7e758d8185568d8006a2.tar
sshfs-f187961c7a6a2433c8af7e758d8185568d8006a2.tar.gz
sshfs-f187961c7a6a2433c8af7e758d8185568d8006a2.tar.bz2
sshfs-f187961c7a6a2433c8af7e758d8185568d8006a2.zip
Don't require mount point to exists on macOS
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 osxfuse/sshfs#27
Diffstat (limited to 'sshfs.c')
-rw-r--r--sshfs.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sshfs.c b/sshfs.c
index 2ef45d5..f116633 100644
--- a/sshfs.c
+++ b/sshfs.c
@@ -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
@@ -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