Skip to content

Commit d78a624

Browse files
committed
Windows native OpenSSH fix
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.
1 parent ddf1e42 commit d78a624

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

sshfs.c

+7
Original file line numberDiff line numberDiff line change
@@ -1227,6 +1227,13 @@ static int start_ssh(struct conn *conn)
12271227
fprintf(stderr, "\n");
12281228
}
12291229

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

0 commit comments

Comments
 (0)