Bugzilla – Attachment 3157 Details for
Bug 2831
ProxyJump self-exec construction ignores path-to-self, exec's wrong ssh
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Prefer to use argv[0] for ProxyJump ssh binary
bz2831.diff (text/plain), 948 bytes, created by
Damien Miller
on 2018-05-25 17:06:35 AEST
(
hide
)
Description:
Prefer to use argv[0] for ProxyJump ssh binary
Filename:
MIME Type:
Creator:
Damien Miller
Created:
2018-05-25 17:06:35 AEST
Size:
948 bytes
patch
obsolete
>diff --git a/ssh.c b/ssh.c >index 90cce2a..9273f90 100644 >--- a/ssh.c >+++ b/ssh.c >@@ -1140,6 +1140,14 @@ main(int ac, char **av) > */ > if (options.jump_host != NULL) { > char port_s[8]; >+ const char *sshbin = argv0; >+ >+ /* >+ * Try to use SSH indicated by argv[0], but fall back to >+ * "ssh" if it appears unavailable. >+ */ >+ if (strchr(argv0, '/') != NULL && access(argv0, X_OK) != 0) >+ sshbin = "ssh"; > > /* Consistency check */ > if (options.proxy_command != NULL) >@@ -1148,7 +1156,8 @@ main(int ac, char **av) > options.proxy_use_fdpass = 0; > snprintf(port_s, sizeof(port_s), "%d", options.jump_port); > xasprintf(&options.proxy_command, >- "ssh%s%s%s%s%s%s%s%s%s%.*s -W '[%%h]:%%p' %s", >+ "%s%s%s%s%s%s%s%s%s%s%.*s -W '[%%h]:%%p' %s", >+ sshbin, > /* Optional "-l user" argument if jump_user set */ > options.jump_user == NULL ? "" : " -l ", > options.jump_user == NULL ? "" : options.jump_user,
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
dtucker
:
ok+
Actions:
View
|
Diff
Attachments on
bug 2831
: 3157