Skip to content

Commit

Permalink
allow /dev/fd/N as a mountpoint (#166)
Browse files Browse the repository at this point in the history
  • Loading branch information
DrDaveD authored and Nikratio committed Mar 31, 2019
1 parent d299217 commit 1dbc89f
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion sshfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -3471,7 +3471,19 @@ static int sshfs_opt_proc(void *data, const char *arg, int key,
}
}
#else
sshfs.mountpoint = realpath(arg, NULL);
int fd, len;
if (sscanf(arg, "/dev/fd/%u%n", &fd, &len) == 1 &&
len == strlen(arg)) {
/*
* Allow /dev/fd/N unchanged; it can be
* use for pre-mounting a generic fuse
* mountpoint to later be completely
* unprivileged with libfuse >= 3.3.0.
*/
sshfs.mountpoint = arg;
} else {
sshfs.mountpoint = realpath(arg, NULL);
}
#endif
if (!sshfs.mountpoint) {
fprintf(stderr, "sshfs: bad mount point `%s': %s\n",
Expand Down

0 comments on commit 1dbc89f

Please sign in to comment.