From ed0825440c48895b7e20cc1440bbafd8d9c88eb8 Mon Sep 17 00:00:00 2001 From: Benjamin Fleischer Date: Sat, 8 Mar 2025 23:26:32 +0100 Subject: [PATCH] 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. --- sshfs.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sshfs.c b/sshfs.c index ad8192c..676fd58 100644 --- a/sshfs.c +++ b/sshfs.c @@ -3798,6 +3798,16 @@ static int sshfs_opt_proc(void *data, const char *arg, int key, sshfs.mountpoint = strdup(arg); } else { 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 if (!sshfs.mountpoint) {