diff options
author | Zdenek Kotala <Zdenek.Kotala@Sun.COM> | 2009-02-26 17:52:56 +0100 |
---|---|---|
committer | Zdenek Kotala <Zdenek.Kotala@Sun.COM> | 2009-02-26 17:52:56 +0100 |
commit | 7a71c13f9776768e00d7d5ccc8c8adc8eeb6888d (patch) | |
tree | c82f4c7852d96ba7ca2202fedd14f8e882171bac | |
parent | cef310fd50f0f099f0a2bf114344d78cf47e3bdb (diff) | |
download | illumos-joyent-7a71c13f9776768e00d7d5ccc8c8adc8eeb6888d.tar.gz |
6797221 do_exec_no_pty() function contains file descriptor leak
-rw-r--r-- | usr/src/cmd/ssh/sshd/session.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/usr/src/cmd/ssh/sshd/session.c b/usr/src/cmd/ssh/sshd/session.c index 28476926e5..45a587566e 100644 --- a/usr/src/cmd/ssh/sshd/session.c +++ b/usr/src/cmd/ssh/sshd/session.c @@ -32,7 +32,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -556,6 +556,8 @@ do_exec_no_pty(Session *s, const char *command) if (compat20) { session_set_fds(s, pin[1], pout[0], s->is_subsystem ? -1 : perr[0]); + if (s->is_subsystem) + close(perr[0]); /* Don't close channel before sending exit-status! */ channel_set_wait_for_exit(s->chanid, 1); } else { @@ -574,6 +576,8 @@ do_exec_no_pty(Session *s, const char *command) */ if (compat20) { session_set_fds(s, inout[1], inout[1], s->is_subsystem ? -1 : err[1]); + if (s->is_subsystem) + close(err[1]); /* Don't close channel before sending exit-status! */ channel_set_wait_for_exit(s->chanid, 1); } else { |