summaryrefslogtreecommitdiff
path: root/session.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2010-12-01 12:02:59 +1100
committerDamien Miller <djm@mindrot.org>2010-12-01 12:02:59 +1100
commitf80c3deaafcb8194ba95e219f1b70e418bea3542 (patch)
tree917f9021b36f84ff2659718dba7056fcf31beacc /session.c
parentb7f827ae4586f6637bcad36b65ebafb51e727f36 (diff)
- djm@cvs.openbsd.org 2010/11/25 04:10:09
[session.c] replace close() loop for fds 3->64 with closefrom(); ok markus deraadt dtucker
Diffstat (limited to 'session.c')
-rw-r--r--session.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/session.c b/session.c
index 3758f0fd1..fff31b02e 100644
--- a/session.c
+++ b/session.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: session.c,v 1.257 2010/11/13 23:27:50 djm Exp $ */ 1/* $OpenBSD: session.c,v 1.258 2010/11/25 04:10:09 djm Exp $ */
2/* 2/*
3 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 3 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
4 * All rights reserved 4 * All rights reserved
@@ -1569,8 +1569,6 @@ launch_login(struct passwd *pw, const char *hostname)
1569static void 1569static void
1570child_close_fds(void) 1570child_close_fds(void)
1571{ 1571{
1572 int i;
1573
1574 if (packet_get_connection_in() == packet_get_connection_out()) 1572 if (packet_get_connection_in() == packet_get_connection_out())
1575 close(packet_get_connection_in()); 1573 close(packet_get_connection_in());
1576 else { 1574 else {
@@ -1596,8 +1594,7 @@ child_close_fds(void)
1596 * initgroups, because at least on Solaris 2.3 it leaves file 1594 * initgroups, because at least on Solaris 2.3 it leaves file
1597 * descriptors open. 1595 * descriptors open.
1598 */ 1596 */
1599 for (i = 3; i < 64; i++) 1597 closefrom(STDERR_FILENO + 1);
1600 close(i);
1601} 1598}
1602 1599
1603/* 1600/*