diff options
author | Damien Miller <djm@mindrot.org> | 2010-12-01 12:02:59 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2010-12-01 12:02:59 +1100 |
commit | f80c3deaafcb8194ba95e219f1b70e418bea3542 (patch) | |
tree | 917f9021b36f84ff2659718dba7056fcf31beacc /session.c | |
parent | b7f827ae4586f6637bcad36b65ebafb51e727f36 (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.c | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -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) | |||
1569 | static void | 1569 | static void |
1570 | child_close_fds(void) | 1570 | child_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 | /* |