diff options
author | Simon Arlott <70171+nomis@users.noreply.github.com> | 2020-09-03 08:13:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-03 08:13:24 +0100 |
commit | 76ffb37444045eea5112d886a4b2a4faf6cfe034 (patch) | |
tree | 744976d990c6a3bd626d6e7854c9e0a43b684813 /sshfs.c | |
parent | a96e52147482ac194c2476d00cfe16916fececb1 (diff) | |
download | sshfs-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.
Diffstat (limited to 'sshfs.c')
-rw-r--r-- | sshfs.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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; |