Mountpoint does not have to exist on macOS

macFUSE will create the mounpoint (in case it does not exist) before
mounting the volume. This allows unprivileged users to mount volumes
under /Volumes.
This commit is contained in:
Benjamin Fleischer 2025-03-08 23:26:32 +01:00
parent a9eb71cb1c
commit ed0825440c
1 changed files with 10 additions and 0 deletions

10
sshfs.c
View File

@ -3798,6 +3798,16 @@ static int sshfs_opt_proc(void *data, const char *arg, int key,
sshfs.mountpoint = strdup(arg); sshfs.mountpoint = strdup(arg);
} else { } else {
sshfs.mountpoint = realpath(arg, NULL); sshfs.mountpoint = realpath(arg, NULL);
#ifdef __APPLE__
if (!sshfs.mountpoint) {
/*
* The mountpoint does not exist, yet.
* macFUSE will try to create it before
* mounting the volume.
*/
sshfs.mountpoint = strdup(arg);
}
#endif
} }
#endif #endif
if (!sshfs.mountpoint) { if (!sshfs.mountpoint) {