Skip to content

Commit 35c6d85

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. Subitted upstream here libfuse/sshfs#314
1 parent 9329f4b commit 35c6d85

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

patches/30-stdiomode.patch

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
From d78a624756d080c80a35886ba3615e809bbdb56b Mon Sep 17 00:00:00 2001
2+
From: Emmanuel Dreyfus <[email protected]>
3+
Date: Wed, 20 Nov 2024 16:00:40 +0100
4+
Subject: [PATCH] Windows native OpenSSH fix
5+
6+
Windows native OpenSSH has alternative behavior for standard I/O
7+
descriptors, which can be selected through the OPENSSH_STDIO_MODE
8+
environement variable. Setting it to "nonsock" is required for
9+
sshfs compatibility.
10+
11+
See https://github.com/PowerShell/openssh-portable/pull/759
12+
for details.
13+
---
14+
sshfs.c | 7 +++++++
15+
1 file changed, 7 insertions(+)
16+
17+
diff --git a/sshfs.c b/sshfs.c
18+
index 89c57606..809568ad 100644
19+
--- a/sshfs.c
20+
+++ b/sshfs.c
21+
@@ -1227,6 +1227,13 @@ static int start_ssh(struct conn *conn)
22+
fprintf(stderr, "\n");
23+
}
24+
25+
+#if defined(__CYGWIN__)
26+
+ /*
27+
+ * Windows native OpenSSH stdio behavior. For details check
28+
+ * https://github.com/PowerShell/openssh-portable/pull/759
29+
+ */
30+
+ putenv("OPENSSH_STDIO_MODE=nonsock");
31+
+#endif
32+
execvp(sshfs.ssh_args.argv[0], sshfs.ssh_args.argv);
33+
fprintf(stderr, "failed to execute '%s': %s\n",
34+
sshfs.ssh_args.argv[0], strerror(errno));

0 commit comments

Comments
 (0)