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

(-)openssh-3.1p1/scp.c (-1 / +15 lines)
Lines 133-138 Link Here
133
/* This is the program to execute for the secured connection. ("ssh" or -S) */
133
/* This is the program to execute for the secured connection. ("ssh" or -S) */
134
char *ssh_program = _PATH_SSH_PROGRAM;
134
char *ssh_program = _PATH_SSH_PROGRAM;
135
135
136
/* esb: added the child PID so we can kill it if we get killed */
137
pid_t childpid;
138
static void killchild(int signo);
139
136
/*
140
/*
137
 * This function executes the given command as the specified user on the
141
 * This function executes the given command as the specified user on the
138
 * given host.  This returns < 0 if execution fails, and >= 0 otherwise. This
142
 * given host.  This returns < 0 if execution fails, and >= 0 otherwise. This
Lines 167-173 Link Here
167
	close(reserved[1]);
171
	close(reserved[1]);
168
172
169
	/* For a child to execute the command on the remote host using ssh. */
173
	/* For a child to execute the command on the remote host using ssh. */
170
	if (fork() == 0)  {
174
	/* esb */
175
	if ((childpid = fork()) == 0)  {
171
		/* Child. */
176
		/* Child. */
172
		close(pin[1]);
177
		close(pin[1]);
173
		close(pout[0]);
178
		close(pout[0]);
Lines 191-196 Link Here
191
	*fdout = pin[1];
196
	*fdout = pin[1];
192
	close(pout[1]);
197
	close(pout[1]);
193
	*fdin = pout[0];
198
	*fdin = pout[0];
199
	/* esb */
200
	(void) signal(SIGTERM, killchild);
194
	return 0;
201
	return 0;
195
}
202
}
196
203
Lines 1086-1091 Link Here
1086
	signal(SIGALRM, updateprogressmeter);
1093
	signal(SIGALRM, updateprogressmeter);
1087
	alarm(PROGRESSTIME);
1094
	alarm(PROGRESSTIME);
1088
	errno = save_errno;
1095
	errno = save_errno;
1096
}
1097
1098
static void
1099
killchild(int signo)
1100
{
1101
        kill (childpid, signo);
1102
	_exit(1);
1089
}
1103
}
1090
1104
1091
static int
1105
static int

Return to bug 241