aboutsummaryrefslogtreecommitdiff
path: root/sshfs.c
diff options
context:
space:
mode:
authorPercy Jahn <email@percyjahn.de>2011-08-24 13:22:36 +0200
committerBenjamin Fleischer <fleiben@gmail.com>2012-01-22 10:44:45 +0100
commitf2086ccfbc5e2f84586fb4f68fd8482f0a750b8f (patch)
tree9d54df116a0a0f3c79f327f559cd5227062229da /sshfs.c
parentb4023a19dd7ec7a099d2e0df491547cf3bb6bec3 (diff)
downloadsshfs-f2086ccfbc5e2f84586fb4f68fd8482f0a750b8f.tar
sshfs-f2086ccfbc5e2f84586fb4f68fd8482f0a750b8f.tar.gz
sshfs-f2086ccfbc5e2f84586fb4f68fd8482f0a750b8f.tar.bz2
sshfs-f2086ccfbc5e2f84586fb4f68fd8482f0a750b8f.zip
sshfs: fstat workaround
Add "-oworkaround=fstat" for SFTP servers which don't support the FSTAT message.
Diffstat (limited to 'sshfs.c')
-rw-r--r--sshfs.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sshfs.c b/sshfs.c
index d124dcf..6d2183b 100644
--- a/sshfs.c
+++ b/sshfs.c
@@ -206,6 +206,7 @@ struct sshfs {
int nodelaysrv_workaround;
int truncate_workaround;
int buflimit_workaround;
+ int fstat_workaround;
int transform_symlinks;
int follow_symlinks;
int no_check_root;
@@ -364,11 +365,13 @@ static struct fuse_opt workaround_opts[] = {
SSHFS_OPT("none", nodelaysrv_workaround, 0),
SSHFS_OPT("none", truncate_workaround, 0),
SSHFS_OPT("none", buflimit_workaround, 0),
+ SSHFS_OPT("none", fstat_workaround, 0),
SSHFS_OPT("all", rename_workaround, 1),
SSHFS_OPT("all", nodelay_workaround, 1),
SSHFS_OPT("all", nodelaysrv_workaround, 1),
SSHFS_OPT("all", truncate_workaround, 1),
SSHFS_OPT("all", buflimit_workaround, 1),
+ SSHFS_OPT("all", fstat_workaround, 1),
SSHFS_OPT("rename", rename_workaround, 1),
SSHFS_OPT("norename", rename_workaround, 0),
SSHFS_OPT("nodelay", nodelay_workaround, 1),
@@ -379,6 +382,8 @@ static struct fuse_opt workaround_opts[] = {
SSHFS_OPT("notruncate", truncate_workaround, 0),
SSHFS_OPT("buflimit", buflimit_workaround, 1),
SSHFS_OPT("nobuflimit", buflimit_workaround, 0),
+ SSHFS_OPT("fstat", fstat_workaround, 1),
+ SSHFS_OPT("nofstat", fstat_workaround, 0),
FUSE_OPT_END
};
@@ -2808,6 +2813,9 @@ static int sshfs_fgetattr(const char *path, struct stat *stbuf,
if (!sshfs_file_is_conn(sf))
return -EIO;
+ if (sshfs.fstat_workaround)
+ return sshfs_getattr(path, stbuf);
+
buf_init(&buf, 0);
buf_add_buf(&buf, &sf->handle);
err = sftp_request(SSH_FXP_FSTAT, &buf, SSH_FXP_ATTRS, &outbuf);