- 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
This commit is contained in:
parent
b7f827ae45
commit
f80c3deaaf
|
@ -25,6 +25,10 @@
|
||||||
remove a debug() that pollutes stderr on client connecting to a server
|
remove a debug() that pollutes stderr on client connecting to a server
|
||||||
in debug mode (channel_close_fds is called transitively from the session
|
in debug mode (channel_close_fds is called transitively from the session
|
||||||
code post-fork); bz#1719, ok dtucker
|
code post-fork); bz#1719, ok dtucker
|
||||||
|
- 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
|
||||||
|
|
||||||
20101124
|
20101124
|
||||||
- (dtucker) [platform.c session.c] Move the getluid call out of session.c and
|
- (dtucker) [platform.c session.c] Move the getluid call out of session.c and
|
||||||
|
|
|
@ -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
|
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
|
||||||
* All rights reserved
|
* All rights reserved
|
||||||
|
@ -1569,8 +1569,6 @@ launch_login(struct passwd *pw, const char *hostname)
|
||||||
static void
|
static void
|
||||||
child_close_fds(void)
|
child_close_fds(void)
|
||||||
{
|
{
|
||||||
int i;
|
|
||||||
|
|
||||||
if (packet_get_connection_in() == packet_get_connection_out())
|
if (packet_get_connection_in() == packet_get_connection_out())
|
||||||
close(packet_get_connection_in());
|
close(packet_get_connection_in());
|
||||||
else {
|
else {
|
||||||
|
@ -1596,8 +1594,7 @@ child_close_fds(void)
|
||||||
* initgroups, because at least on Solaris 2.3 it leaves file
|
* initgroups, because at least on Solaris 2.3 it leaves file
|
||||||
* descriptors open.
|
* descriptors open.
|
||||||
*/
|
*/
|
||||||
for (i = 3; i < 64; i++)
|
closefrom(STDERR_FILENO + 1);
|
||||||
close(i);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue