View | Details | Raw Unified | Return to bug 223 | Differences between
and this patch

Collapse All | Expand All

(-)ssh.c (+11 lines)
Lines 149-154 Link Here
149
/* # of replies received for global requests */
149
/* # of replies received for global requests */
150
static int client_global_request_id = 0;
150
static int client_global_request_id = 0;
151
151
152
/* pid of proxycommand child process */
153
pid_t proxy_command_pid = 0;
154
152
/* Prints a help message to the user.  This function never returns. */
155
/* Prints a help message to the user.  This function never returns. */
153
156
154
static void
157
static void
Lines 786-791 Link Here
786
789
787
	exit_status = compat20 ? ssh_session2() : ssh_session();
790
	exit_status = compat20 ? ssh_session2() : ssh_session();
788
	packet_close();
791
	packet_close();
792
793
	/* Send TERM signal proxy command if used */
794
	if (proxy_command_pid) {
795
		debug("Killing ProxyCommand pid:%d", (int)proxy_command_pid);
796
		if (kill(proxy_command_pid, SIGTERM))
797
			waitpid(proxy_command_pid, &i, WNOHANG);
798
	}
799
789
	return exit_status;
800
	return exit_status;
790
}
801
}
791
802
(-)sshconnect.c (+8 lines)
Lines 38-43 Link Here
38
38
39
extern Options options;
39
extern Options options;
40
extern char *__progname;
40
extern char *__progname;
41
extern pid_t proxy_command_pid;
41
42
42
#ifndef INET6_ADDRSTRLEN		/* for non IPv6 machines */
43
#ifndef INET6_ADDRSTRLEN		/* for non IPv6 machines */
43
#define INET6_ADDRSTRLEN 46
44
#define INET6_ADDRSTRLEN 46
Lines 84-89 Link Here
84
	/* Build the final command string in the buffer by making the
85
	/* Build the final command string in the buffer by making the
85
	   appropriate substitutions to the given proxy command. */
86
	   appropriate substitutions to the given proxy command. */
86
	buffer_init(&command);
87
	buffer_init(&command);
88
89
	/* have shell exec proxy command to prevent extra sh -c processes
90
	   on some platforms (eg Solaris) */
91
	buffer_append(&command, "exec ", 5);
92
87
	for (cp = proxy_command; *cp; cp++) {
93
	for (cp = proxy_command; *cp; cp++) {
88
		if (cp[0] == '%' && cp[1] == '%') {
94
		if (cp[0] == '%' && cp[1] == '%') {
89
			buffer_append(&command, "%", 1);
95
			buffer_append(&command, "%", 1);
Lines 150-155 Link Here
150
	/* Parent. */
156
	/* Parent. */
151
	if (pid < 0)
157
	if (pid < 0)
152
		fatal("fork failed: %.100s", strerror(errno));
158
		fatal("fork failed: %.100s", strerror(errno));
159
	else
160
		proxy_command_pid = pid; /* save pid to clean up later */
153
161
154
	/* Close child side of the descriptors. */
162
	/* Close child side of the descriptors. */
155
	close(pin[0]);
163
	close(pin[0]);

Return to bug 223