mirror of
https://github.com/PowerShell/openssh-portable.git
synced 2025-07-28 16:24:39 +02:00
- djm@cvs.openbsd.org 2013/10/10 01:43:03
[sshd.c] bz#2139: fix re-exec fallback by ensuring that startup_pipe is correctly updated; ok dtucker@
This commit is contained in:
parent
73600e51af
commit
61ee4d68ca
@ -9,6 +9,10 @@
|
|||||||
- djm@cvs.openbsd.org 2013/10/10 00:53:25
|
- djm@cvs.openbsd.org 2013/10/10 00:53:25
|
||||||
[sftp-server.c]
|
[sftp-server.c]
|
||||||
add -Q, -P and -p to usage() before jmc@ catches me
|
add -Q, -P and -p to usage() before jmc@ catches me
|
||||||
|
- djm@cvs.openbsd.org 2013/10/10 01:43:03
|
||||||
|
[sshd.c]
|
||||||
|
bz#2139: fix re-exec fallback by ensuring that startup_pipe is correctly
|
||||||
|
updated; ok dtucker@
|
||||||
|
|
||||||
20131010
|
20131010
|
||||||
- (dtucker) OpenBSD CVS Sync
|
- (dtucker) OpenBSD CVS Sync
|
||||||
|
11
sshd.c
11
sshd.c
@ -1,4 +1,4 @@
|
|||||||
/* $OpenBSD: sshd.c,v 1.406 2013/09/02 22:00:34 deraadt Exp $ */
|
/* $OpenBSD: sshd.c,v 1.407 2013/10/10 01:43:03 djm Exp $ */
|
||||||
/*
|
/*
|
||||||
* Author: Tatu Ylonen <ylo@cs.hut.fi>
|
* Author: Tatu Ylonen <ylo@cs.hut.fi>
|
||||||
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
|
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
|
||||||
@ -1940,13 +1940,14 @@ main(int ac, char **av)
|
|||||||
dup2(STDIN_FILENO, STDOUT_FILENO);
|
dup2(STDIN_FILENO, STDOUT_FILENO);
|
||||||
if (startup_pipe == -1)
|
if (startup_pipe == -1)
|
||||||
close(REEXEC_STARTUP_PIPE_FD);
|
close(REEXEC_STARTUP_PIPE_FD);
|
||||||
else
|
else if (startup_pipe != REEXEC_STARTUP_PIPE_FD) {
|
||||||
dup2(startup_pipe, REEXEC_STARTUP_PIPE_FD);
|
dup2(startup_pipe, REEXEC_STARTUP_PIPE_FD);
|
||||||
|
close(startup_pipe);
|
||||||
|
startup_pipe = REEXEC_STARTUP_PIPE_FD;
|
||||||
|
}
|
||||||
|
|
||||||
dup2(config_s[1], REEXEC_CONFIG_PASS_FD);
|
dup2(config_s[1], REEXEC_CONFIG_PASS_FD);
|
||||||
close(config_s[1]);
|
close(config_s[1]);
|
||||||
if (startup_pipe != -1)
|
|
||||||
close(startup_pipe);
|
|
||||||
|
|
||||||
execv(rexec_argv[0], rexec_argv);
|
execv(rexec_argv[0], rexec_argv);
|
||||||
|
|
||||||
@ -1957,8 +1958,6 @@ main(int ac, char **av)
|
|||||||
options.log_facility, log_stderr);
|
options.log_facility, log_stderr);
|
||||||
|
|
||||||
/* Clean up fds */
|
/* Clean up fds */
|
||||||
startup_pipe = REEXEC_STARTUP_PIPE_FD;
|
|
||||||
close(config_s[1]);
|
|
||||||
close(REEXEC_CONFIG_PASS_FD);
|
close(REEXEC_CONFIG_PASS_FD);
|
||||||
newsock = sock_out = sock_in = dup(STDIN_FILENO);
|
newsock = sock_out = sock_in = dup(STDIN_FILENO);
|
||||||
if ((fd = open(_PATH_DEVNULL, O_RDWR, 0)) != -1) {
|
if ((fd = open(_PATH_DEVNULL, O_RDWR, 0)) != -1) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user