Bugzilla – Attachment 1912 Details for
Bug 1808
"SetupCommand" invoked before connecting
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch against 5.1p1 adding the SetupCommand config option
setupcommand.diff (text/plain), 3.75 KB, created by
Helmut Grohne
on 2010-08-24 07:16:31 AEST
(
hide
)
Description:
patch against 5.1p1 adding the SetupCommand config option
Filename:
MIME Type:
Creator:
Helmut Grohne
Created:
2010-08-24 07:16:31 AEST
Size:
3.75 KB
patch
obsolete
>--- openssh-5.1p1.orig/ssh.c >+++ openssh-5.1p1/ssh.c >@@ -684,6 +689,22 @@ > xfree(options.proxy_command); > options.proxy_command = NULL; > } >+ if (options.setup_command != NULL) { >+ char thishost[NI_MAXHOST]; >+ >+ if (gethostname(thishost, sizeof(thishost)) == -1) >+ fatal("gethostname: %s", strerror(errno)); >+ snprintf(buf, sizeof(buf), "%d", options.port); >+ debug3("expanding LocalCommand: %s", options.local_command); >+ cp = options.setup_command; >+ options.setup_command = percent_expand(cp, "d", pw->pw_dir, >+ "h", options.hostname? options.hostname : host, >+ "l", thishost, "n", host, "r", options.user, "p", buf, >+ "u", pw->pw_name, (char *)NULL); >+ debug3("expanded LocalCommand: %s", options.local_command); >+ xfree(cp); >+ } >+ > if (options.control_path != NULL && > strcmp(options.control_path, "none") == 0) { > xfree(options.control_path); >@@ -709,6 +730,10 @@ > muxclient(options.control_path); > > timeout_ms = options.connection_timeout * 1000; >+ /* Execute a setup command */ >+ if (options.setup_command != NULL && >+ options.permit_local_command) >+ ssh_local_cmd(options.setup_command); > > /* Open a connection to the remote host. */ > if (ssh_connect(host, &hostaddr, options.port, >--- openssh-5.1p1.orig/readconf.c >+++ openssh-5.1p1/readconf.c >@@ -116,6 +118,7 @@ > oChallengeResponseAuthentication, oXAuthLocation, > oIdentityFile, oHostName, oPort, oCipher, oRemoteForward, oLocalForward, > oUser, oHost, oEscapeChar, oRhostsRSAAuthentication, oProxyCommand, >+ oSetupCommand, > oGlobalKnownHostsFile, oUserKnownHostsFile, oConnectionAttempts, > oBatchMode, oCheckHostIP, oStrictHostKeyChecking, oCompression, > oCompressionLevel, oTCPKeepAlive, oNumberOfPasswordPrompts, >@@ -177,6 +189,7 @@ > { "hostname", oHostName }, > { "hostkeyalias", oHostKeyAlias }, > { "proxycommand", oProxyCommand }, >+ { "setupcommand", oSetupCommand }, > { "port", oPort }, > { "cipher", oCipher }, > { "ciphers", oCiphers }, >@@ -613,6 +640,10 @@ > *charptr = xstrdup(s + len); > return 0; > >+ case oSetupCommand: >+ charptr = &options->setup_command; >+ goto parse_command; >+ > case oPort: > intptr = &options->port; > parse_int: >@@ -1042,6 +1097,7 @@ > options->hostname = NULL; > options->host_key_alias = NULL; > options->proxy_command = NULL; >+ options->setup_command = NULL; > options->user = NULL; > options->escape_char = -1; > options->system_hostfile = NULL; >@@ -1210,6 +1277,7 @@ > options->visual_host_key = 0; > /* options->local_command should not be set by default */ > /* options->proxy_command should not be set by default */ >+ /* options->setup_command should not be set by default */ > /* options->user will be set in the main program if appropriate */ > /* options->hostname will be set in the main program if appropriate */ > /* options->host_key_alias should not be set by default */ > >--- openssh-5.1p1.orig/ssh_config.5 >+++ openssh-5.1p1/ssh_config.5 >@@ -619,6 +660,13 @@ > This directive is ignored unless > .Cm PermitLocalCommand > has been enabled. >+.It Cm SetupCommand >+Specifies a command before connecting to the server. >+It has the same syntax as >+.Cm LocalCommand >+and is also ignored unless >+.Cm PermitLocalCommand >+has been enabled. > .It Cm LocalForward > Specifies that a TCP port on the local machine be forwarded over > the secure channel to the specified host and port from the remote machine. >--- openssh-5.1p1.orig/readconf.h >+++ openssh-5.1p1/readconf.h >@@ -74,6 +77,7 @@ > char *hostname; /* Real host to connect. */ > char *host_key_alias; /* hostname alias for .ssh/known_hosts */ > char *proxy_command; /* Proxy command for connecting the host. */ >+ char *setup_command; /* Setup command before connecting the host. */ > char *user; /* User to log in as. */ > int escape_char; /* Escape character; -2 = none */
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
Actions:
View
|
Diff
Attachments on
bug 1808
: 1912