Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

when mounting fails while using setuid=user,drop_privileges, the mountpoint ends up in an unusable state #286

Open
calestyo opened this issue Nov 23, 2023 · 0 comments

Comments

@calestyo
Copy link

Hey.

When mounting a filesystem via e.g.:

# /usr/sbin/mount.fuse3 user@host:/ /mnt -w -t fuse.sshfs -o nouser,nodev,noexec,nosuid,noatime,default_permissions,auto_unmount,setuid=someuser,drop_privileges,reconnect,idmap=user,disable_hardlink,IdentityFile=/etc/foo/ssh/id_ed25519,ServerAliveInterval=4,ServerAliveCountMax=2,ConnectTimeout=8,ControlPath=none
read: Connection reset by peer

fails (in the above a example because /etc/foo/ssh wasn't readabe by someuser), the mount point remains in a state like:

d????????? ? ?    ?      ?            ? /mnt

which does not happen if drop_privileges is not used.

It dos not show up in /proc/mounts but does so in /proc/self/mountinfo as `someuser´.

Repeating the mount, even when the permission problem has been solved, while it's still in that ???? state, causes:

fuse: failed to access mountpoint /mnt: Transport endpoint is not connected

Only way to clean that up is to call an umount on the mountpoint.

Would be nice if the failed mount could be cleaned up, even if drop_privileges, which is important if one e.g. wants to use setuid=user but on a dir that is not owned by user, with the background, that some process should not be able to write into that location, when it's not mounted (in order to catch that error).

Thanks,
Chris.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant