diff options
author | Nikolaus Rath <Nikolaus@rath.org> | 2017-08-03 18:48:37 +0200 |
---|---|---|
committer | Nikolaus Rath <Nikolaus@rath.org> | 2017-08-03 18:48:37 +0200 |
commit | 653de120c8081db43a253809897a0ad325cbe50c (patch) | |
tree | c8aa747f00b6734a639890cd97895fefdd920065 /sshfs.c | |
parent | 63300fd564de615ba70722347eea45afe1950a33 (diff) | |
download | sshfs-653de120c8081db43a253809897a0ad325cbe50c.tar sshfs-653de120c8081db43a253809897a0ad325cbe50c.tar.gz sshfs-653de120c8081db43a253809897a0ad325cbe50c.tar.bz2 sshfs-653de120c8081db43a253809897a0ad325cbe50c.zip |
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.
Diffstat (limited to 'sshfs.c')
-rw-r--r-- | sshfs.c | 19 |
1 files changed, 1 insertions, 18 deletions
@@ -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 |