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

Collapse All | Expand All

(-)ssh.c (+9 lines)
Lines 146-151 Link Here
146
/* # of replies received for global requests */
146
/* # of replies received for global requests */
147
static int client_global_request_id = 0;
147
static int client_global_request_id = 0;
148
148
149
/* pid of proxycommand child process */
150
pid_t proxy_command_pid = 0;
151
149
/* Prints a help message to the user.  This function never returns. */
152
/* Prints a help message to the user.  This function never returns. */
150
153
151
static void
154
static void
Lines 722-727 Link Here
722
725
723
	exit_status = compat20 ? ssh_session2() : ssh_session();
726
	exit_status = compat20 ? ssh_session2() : ssh_session();
724
	packet_close();
727
	packet_close();
728
729
	/* Send SIGHUP to proxy command if used. We don't wait() in case it hangs
730
	 * and instead rely on init to reap the child */
731
	if (proxy_command_pid)
732
		kill(proxy_command_pid, SIGHUP);
733
725
	return exit_status;
734
	return exit_status;
726
}
735
}
727
736
(-)sshconnect.c (+8 lines)
Lines 41-46 Link Here
41
extern char *__progname;
41
extern char *__progname;
42
extern uid_t original_real_uid;
42
extern uid_t original_real_uid;
43
extern uid_t original_effective_uid;
43
extern uid_t original_effective_uid;
44
extern pid_t proxy_command_pid;
44
45
45
#ifndef INET6_ADDRSTRLEN		/* for non IPv6 machines */
46
#ifndef INET6_ADDRSTRLEN		/* for non IPv6 machines */
46
#define INET6_ADDRSTRLEN 46
47
#define INET6_ADDRSTRLEN 46
Lines 67-72 Link Here
67
	/* Build the final command string in the buffer by making the
68
	/* Build the final command string in the buffer by making the
68
	   appropriate substitutions to the given proxy command. */
69
	   appropriate substitutions to the given proxy command. */
69
	buffer_init(&command);
70
	buffer_init(&command);
71
72
	/* have shell exec proxy command to prevent extra sh -c processes
73
	   on some platforms (eg Solaris) */
74
	buffer_append(&command, "exec ", 5);
75
70
	for (cp = proxy_command; *cp; cp++) {
76
	for (cp = proxy_command; *cp; cp++) {
71
		if (cp[0] == '%' && cp[1] == '%') {
77
		if (cp[0] == '%' && cp[1] == '%') {
72
			buffer_append(&command, "%", 1);
78
			buffer_append(&command, "%", 1);
Lines 134-139 Link Here
134
	/* Parent. */
140
	/* Parent. */
135
	if (pid < 0)
141
	if (pid < 0)
136
		fatal("fork failed: %.100s", strerror(errno));
142
		fatal("fork failed: %.100s", strerror(errno));
143
	else
144
		proxy_command_pid = pid; /* save pid to clean up later */
137
145
138
	/* Close child side of the descriptors. */
146
	/* Close child side of the descriptors. */
139
	close(pin[0]);
147
	close(pin[0]);

Return to bug 223