aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Arlott <70171+nomis@users.noreply.github.com>2020-09-03 08:13:24 +0100
committerGitHub <noreply@github.com>2020-09-03 08:13:24 +0100
commit76ffb37444045eea5112d886a4b2a4faf6cfe034 (patch)
tree744976d990c6a3bd626d6e7854c9e0a43b684813
parenta96e52147482ac194c2476d00cfe16916fececb1 (diff)
downloadsshfs-76ffb37444045eea5112d886a4b2a4faf6cfe034.tar
sshfs-76ffb37444045eea5112d886a4b2a4faf6cfe034.tar.gz
sshfs-76ffb37444045eea5112d886a4b2a4faf6cfe034.tar.bz2
sshfs-76ffb37444045eea5112d886a4b2a4faf6cfe034.zip
Unset OLDPWD environment variable (#227)
If ssh is configured to use "Match exec" and the previous working directory is the mount point, then the shell (bash) hangs calling stat() on OLDPWD. Unset OLDPWD so that this doesn't happen. Fixes #206.
-rw-r--r--sshfs.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sshfs.c b/sshfs.c
index b102dbd..d5f2ff7 100644
--- a/sshfs.c
+++ b/sshfs.c
@@ -1189,6 +1189,12 @@ static int start_ssh(struct conn *conn)
_exit(0);
}
chdir("/");
+ /*
+ * Avoid processes hanging trying to stat() OLDPWD if it is in
+ * the mount point. This can be removed if sshfs opens the
+ * mount point after establishing the ssh connection.
+ */
+ unsetenv("OLDPWD");
if (sshfs.password_stdin) {
int sfd;