From 653de120c8081db43a253809897a0ad325cbe50c Mon Sep 17 00:00:00 2001 From: Nikolaus Rath Date: Thu, 3 Aug 2017 18:48:37 +0200 Subject: Don't check st_mode of mountpoint It is not clear what this check is supposed to achieve, and it seems to fail in some situations (cf issue #57). Fixes: #57. --- sshfs.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) (limited to 'sshfs.c') diff --git a/sshfs.c b/sshfs.c index 4f041e0..fdb00d3 100644 --- a/sshfs.c +++ b/sshfs.c @@ -279,7 +279,6 @@ struct sshfs { int ext_statvfs; int ext_hardlink; int ext_fsync; - mode_t mnt_mode; struct fuse_operations *op; /* statistics */ @@ -1650,16 +1649,11 @@ static int sftp_check_root(const char *base_path) if (!(flags & SSH_FILEXFER_ATTR_PERMISSIONS)) goto out; - if (S_ISDIR(sshfs.mnt_mode) && !S_ISDIR(stbuf.st_mode)) { + if (!S_ISDIR(stbuf.st_mode)) { fprintf(stderr, "%s:%s: Not a directory\n", sshfs.host, remote_dir); goto out; } - if ((sshfs.mnt_mode ^ stbuf.st_mode) & S_IFMT) { - fprintf(stderr, "%s:%s: type of file differs from mountpoint\n", - sshfs.host, remote_dir); - goto out; - } err = 0; @@ -3998,17 +3992,6 @@ int main(int argc, char *argv[]) g_free(tmp); g_free(fsname); -#if !defined(__APPLE__) && !defined(__CYGWIN__) - res = stat(sshfs.mountpoint, &st); - if (res == -1) { - perror(sshfs.mountpoint); - exit(1); - } - sshfs.mnt_mode = st.st_mode; -#else - sshfs.mnt_mode = S_IFDIR | 0755; -#endif - if(sshfs.dir_cache) sshfs.op = cache_wrap(&sshfs_oper); else -- cgit v1.2.3