View | Details | Raw Unified | Return to bug 1808
Collapse All | Expand All

(-)file_not_specified_in_diff (-4 / +40 lines)
Line  Link Here
0
-- openssh-5.1p1.orig/ssh.c
0
++ openssh-5.1p1/ssh.c
Lines 684-689 Link Here
684
		xfree(options.proxy_command);
689
		xfree(options.proxy_command);
685
		options.proxy_command = NULL;
690
		options.proxy_command = NULL;
686
	}
691
	}
692
	if (options.setup_command != NULL) {
693
		char thishost[NI_MAXHOST];
694
695
		if (gethostname(thishost, sizeof(thishost)) == -1)
696
			fatal("gethostname: %s", strerror(errno));
697
		snprintf(buf, sizeof(buf), "%d", options.port);
698
		debug3("expanding LocalCommand: %s", options.local_command);
699
		cp = options.setup_command;
700
		options.setup_command = percent_expand(cp, "d", pw->pw_dir,
701
		    "h", options.hostname? options.hostname : host,
702
                    "l", thishost, "n", host, "r", options.user, "p", buf,
703
                    "u", pw->pw_name, (char *)NULL);
704
		debug3("expanded LocalCommand: %s", options.local_command);
705
		xfree(cp);
706
	}
707
687
	if (options.control_path != NULL &&
708
	if (options.control_path != NULL &&
688
	    strcmp(options.control_path, "none") == 0) {
709
	    strcmp(options.control_path, "none") == 0) {
689
		xfree(options.control_path);
710
		xfree(options.control_path);
Lines 709-714 Link Here
709
		muxclient(options.control_path);
730
		muxclient(options.control_path);
710
731
711
	timeout_ms = options.connection_timeout * 1000;
732
	timeout_ms = options.connection_timeout * 1000;
733
	/* Execute a setup command */
734
	if (options.setup_command != NULL &&
735
	    options.permit_local_command)
736
		ssh_local_cmd(options.setup_command);
712
737
713
	/* Open a connection to the remote host. */
738
	/* Open a connection to the remote host. */
714
	if (ssh_connect(host, &hostaddr, options.port,
739
	if (ssh_connect(host, &hostaddr, options.port,
715
-- openssh-5.1p1.orig/readconf.c
740
++ openssh-5.1p1/readconf.c
Lines 116-121 Link Here
116
	oChallengeResponseAuthentication, oXAuthLocation,
118
	oChallengeResponseAuthentication, oXAuthLocation,
117
	oIdentityFile, oHostName, oPort, oCipher, oRemoteForward, oLocalForward,
119
	oIdentityFile, oHostName, oPort, oCipher, oRemoteForward, oLocalForward,
118
	oUser, oHost, oEscapeChar, oRhostsRSAAuthentication, oProxyCommand,
120
	oUser, oHost, oEscapeChar, oRhostsRSAAuthentication, oProxyCommand,
121
	oSetupCommand,
119
	oGlobalKnownHostsFile, oUserKnownHostsFile, oConnectionAttempts,
122
	oGlobalKnownHostsFile, oUserKnownHostsFile, oConnectionAttempts,
120
	oBatchMode, oCheckHostIP, oStrictHostKeyChecking, oCompression,
123
	oBatchMode, oCheckHostIP, oStrictHostKeyChecking, oCompression,
121
	oCompressionLevel, oTCPKeepAlive, oNumberOfPasswordPrompts,
124
	oCompressionLevel, oTCPKeepAlive, oNumberOfPasswordPrompts,
Lines 177-182 Link Here
177
	{ "hostname", oHostName },
189
	{ "hostname", oHostName },
178
	{ "hostkeyalias", oHostKeyAlias },
190
	{ "hostkeyalias", oHostKeyAlias },
179
	{ "proxycommand", oProxyCommand },
191
	{ "proxycommand", oProxyCommand },
192
	{ "setupcommand", oSetupCommand },
180
	{ "port", oPort },
193
	{ "port", oPort },
181
	{ "cipher", oCipher },
194
	{ "cipher", oCipher },
182
	{ "ciphers", oCiphers },
195
	{ "ciphers", oCiphers },
Lines 613-618 Link Here
613
			*charptr = xstrdup(s + len);
640
			*charptr = xstrdup(s + len);
614
		return 0;
641
		return 0;
615
642
643
	case oSetupCommand:
644
		charptr = &options->setup_command;
645
		goto parse_command;
646
616
	case oPort:
647
	case oPort:
617
		intptr = &options->port;
648
		intptr = &options->port;
618
parse_int:
649
parse_int:
Lines 1042-1047 Link Here
1042
	options->hostname = NULL;
1097
	options->hostname = NULL;
1043
	options->host_key_alias = NULL;
1098
	options->host_key_alias = NULL;
1044
	options->proxy_command = NULL;
1099
	options->proxy_command = NULL;
1100
	options->setup_command = NULL;
1045
	options->user = NULL;
1101
	options->user = NULL;
1046
	options->escape_char = -1;
1102
	options->escape_char = -1;
1047
	options->system_hostfile = NULL;
1103
	options->system_hostfile = NULL;
Lines 1210-1215 Link Here
1210
		options->visual_host_key = 0;
1277
		options->visual_host_key = 0;
1211
	/* options->local_command should not be set by default */
1278
	/* options->local_command should not be set by default */
1212
	/* options->proxy_command should not be set by default */
1279
	/* options->proxy_command should not be set by default */
1280
	/* options->setup_command should not be set by default */
1213
	/* options->user will be set in the main program if appropriate */
1281
	/* options->user will be set in the main program if appropriate */
1214
	/* options->hostname will be set in the main program if appropriate */
1282
	/* options->hostname will be set in the main program if appropriate */
1215
	/* options->host_key_alias should not be set by default */
1283
	/* options->host_key_alias should not be set by default */
1216
1284
1217
-- openssh-5.1p1.orig/ssh_config.5
1285
++ openssh-5.1p1/ssh_config.5
Lines 619-624 Link Here
619
This directive is ignored unless
660
This directive is ignored unless
620
.Cm PermitLocalCommand
661
.Cm PermitLocalCommand
621
has been enabled.
662
has been enabled.
663
.It Cm SetupCommand
664
Specifies a command before connecting to the server.
665
It has the same syntax as
666
.Cm LocalCommand
667
and is also ignored unless
668
.Cm PermitLocalCommand
669
has been enabled.
622
.It Cm LocalForward
670
.It Cm LocalForward
623
Specifies that a TCP port on the local machine be forwarded over
671
Specifies that a TCP port on the local machine be forwarded over
624
the secure channel to the specified host and port from the remote machine.
672
the secure channel to the specified host and port from the remote machine.
625
-- openssh-5.1p1.orig/readconf.h
673
++ openssh-5.1p1/readconf.h
Lines 74-79 Link Here
74
	char   *hostname;	/* Real host to connect. */
77
	char   *hostname;	/* Real host to connect. */
75
	char   *host_key_alias;	/* hostname alias for .ssh/known_hosts */
78
	char   *host_key_alias;	/* hostname alias for .ssh/known_hosts */
76
	char   *proxy_command;	/* Proxy command for connecting the host. */
79
	char   *proxy_command;	/* Proxy command for connecting the host. */
80
	char   *setup_command;  /* Setup command before connecting the host. */
77
	char   *user;		/* User to log in as. */
81
	char   *user;		/* User to log in as. */
78
	int     escape_char;	/* Escape character; -2 = none */
82
	int     escape_char;	/* Escape character; -2 = none */

Return to bug 1808