summaryrefslogtreecommitdiff
path: root/usr.bin/ssh/session.c
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2010-11-25 04:10:10 +0000
committerDamien Miller <djm@cvs.openbsd.org>2010-11-25 04:10:10 +0000
commita36726dfb327c2a2b2d1124c057b2ecd598ed1ec (patch)
treed29eb3fbdca11bf38716b1868cde17c9bdd572fc /usr.bin/ssh/session.c
parent5665b42b023f140e61b4e89591dbd7b010bde0cf (diff)
replace close() loop for fds 3->64 with closefrom();
ok markus deraadt dtucker
Diffstat (limited to 'usr.bin/ssh/session.c')
-rw-r--r--usr.bin/ssh/session.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/usr.bin/ssh/session.c b/usr.bin/ssh/session.c
index 4aa3cde56ad..952dc5fe9f6 100644
--- a/usr.bin/ssh/session.c
+++ b/usr.bin/ssh/session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: session.c,v 1.257 2010/11/13 23:27:50 djm Exp $ */
+/* $OpenBSD: session.c,v 1.258 2010/11/25 04:10:09 djm Exp $ */
/*
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
* All rights reserved
@@ -1252,8 +1252,6 @@ launch_login(struct passwd *pw, const char *hostname)
static void
child_close_fds(void)
{
- int i;
-
if (packet_get_connection_in() == packet_get_connection_out())
close(packet_get_connection_in());
else {
@@ -1279,8 +1277,7 @@ child_close_fds(void)
* initgroups, because at least on Solaris 2.3 it leaves file
* descriptors open.
*/
- for (i = 3; i < 64; i++)
- close(i);
+ closefrom(STDERR_FILENO + 1);
}
/*