Skip to content

Commit

Permalink
Windows native OpenSSH fix
Browse files Browse the repository at this point in the history
Windows native OpenSSH has alternative behavior for standard I/O
descriptors, which can be selected through the OPENSSH_STDIO_MODE
environement variable. Setting it to "nonsock" is required for
sshfs compatibility.

See PowerShell/openssh-portable#759
for details.
  • Loading branch information
manu0401 committed Nov 20, 2024
1 parent ddf1e42 commit d78a624
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions sshfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1227,6 +1227,13 @@ static int start_ssh(struct conn *conn)
fprintf(stderr, "\n");
}

#if defined(__CYGWIN__)
/*
* Windows native OpenSSH stdio behavior. For details check
* https://github.com/PowerShell/openssh-portable/pull/759
*/
putenv("OPENSSH_STDIO_MODE=nonsock");
#endif
execvp(sshfs.ssh_args.argv[0], sshfs.ssh_args.argv);
fprintf(stderr, "failed to execute '%s': %s\n",
sshfs.ssh_args.argv[0], strerror(errno));
Expand Down

0 comments on commit d78a624

Please sign in to comment.