Menu

#119 mkmountpoint: directory exists check does not work properly for FUSE filesystems

pam_mount
open
nobody
None
5
2017-05-02
2017-05-02
Floris
No

When using pam_mount to connect to a sshfs/FUSE file system mkmountpoint tries to create the mount point even if it already exists.

(mount.c:309): mkmountpoint: checking /home
(mount.c:309): mkmountpoint: checking /home/tester
(mount.c:345): mkdir /home/tester failed: File exists
(pam_mount.c:522): mount of sshfs#tester@server: failed

This is caused by you using the stat() system call to check for directory existence.
However with FUSE file systems even the root user does not have permission to stat() FUSE mounts created by an user, unless mounted with "allow_root"

I think that if stat fails with errno==EACCES you should treat it as if the directory already exists.

Discussion


Log in to post a comment.

MongoDB Logo MongoDB
Gen AI apps are built with MongoDB Atlas
Atlas offers built-in vector search and global availability across 125+ regions. Start building AI apps faster, all in one place.