diff options
author | 1999-10-03 19:17:40 +0000 | |
---|---|---|
committer | 1999-10-03 19:17:40 +0000 | |
commit | 0319c6ab67a1c277c079779dcdfff17f11bb14eb (patch) | |
tree | 6024c80b6c8c296f3443685e4715292a38c6e0e5 /usr.bin/ssh/serverloop.c | |
parent | Fix multiple problems in the FTS_NOCHDIR case (mycroft@netbsd.org): (diff) | |
download | wireguard-openbsd-0319c6ab67a1c277c079779dcdfff17f11bb14eb.tar.xz wireguard-openbsd-0319c6ab67a1c277c079779dcdfff17f11bb14eb.zip |
do not call shutdown() on pipes, ok: deraadt
Diffstat (limited to 'usr.bin/ssh/serverloop.c')
-rw-r--r-- | usr.bin/ssh/serverloop.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/usr.bin/ssh/serverloop.c b/usr.bin/ssh/serverloop.c index 5ce73db9da7..5fa749dceab 100644 --- a/usr.bin/ssh/serverloop.c +++ b/usr.bin/ssh/serverloop.c @@ -357,7 +357,11 @@ void process_output(fd_set *writeset) buffer_len(&stdin_buffer)); if (len <= 0) { +#ifdef USE_PIPES + close(fdin); +#else shutdown(fdin, 1); /* We will no longer send. */ +#endif fdin = -1; } else @@ -477,7 +481,11 @@ void server_loop(int pid, int fdin_arg, int fdout_arg, int fderr_arg) cause a real eof by closing fdin. */ if (stdin_eof && fdin != -1 && buffer_len(&stdin_buffer) == 0) { +#ifdef USE_PIPES + close(fdin); +#else shutdown(fdin, 1); /* We will no longer send. */ +#endif fdin = -1; } @@ -555,15 +563,27 @@ void server_loop(int pid, int fdin_arg, int fdout_arg, int fderr_arg) /* Close the file descriptors. */ if (fdout != -1) +#ifdef USE_PIPES + close(fdout); +#else shutdown(fdout, 0); +#endif fdout = -1; fdout_eof = 1; if (fderr != -1) +#ifdef USE_PIPES + close(fderr); +#else shutdown(fderr, 0); +#endif fderr = -1; fderr_eof = 1; if (fdin != -1) +#ifdef USE_PIPES + close(fdin); +#else shutdown(fdin, 1); +#endif fdin = -1; /* Stop listening for channels; this removes unix domain sockets. */ |