diff options
author | Otto Moerbeek <otto@cvs.openbsd.org> | 2009-11-02 20:03:02 +0000 |
---|---|---|
committer | Otto Moerbeek <otto@cvs.openbsd.org> | 2009-11-02 20:03:02 +0000 |
commit | cf7136775f8306405b4939d51f3d3d23e2f0f2ab (patch) | |
tree | 9690e430a88f0c24337069cad02d4170cd5e261c | |
parent | b4f491e27cbdfe4ace12920537151d3ef0a8367f (diff) |
we have closefrom(2), so use it; ok deraadt@ tedu@
-rw-r--r-- | usr.sbin/inetd/inetd.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/usr.sbin/inetd/inetd.c b/usr.sbin/inetd/inetd.c index 12b42897c9b..a6c5a5f3ab8 100644 --- a/usr.sbin/inetd/inetd.c +++ b/usr.sbin/inetd/inetd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: inetd.c,v 1.131 2009/10/27 23:59:51 deraadt Exp $ */ +/* $OpenBSD: inetd.c,v 1.132 2009/11/02 20:03:01 otto Exp $ */ /* * Copyright (c) 1983,1991 The Regents of the University of California. @@ -1977,8 +1977,7 @@ spawn(struct servtab *sep, int ctrl) dup2(STDIN_FILENO, STDOUT_FILENO); dup2(STDIN_FILENO, STDERR_FILENO); closelog(); - for (tmpint = rlim_nofile_cur-1; --tmpint > 2; ) - (void)close(tmpint); + closefrom(3); sigaction(SIGPIPE, &sapipe, NULL); execv(sep->se_server, sep->se_argv); if (sep->se_socktype != SOCK_STREAM) |