summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--configure.ac6
-rw-r--r--openbsd-compat/bsd-misc.c18
-rw-r--r--openbsd-compat/bsd-misc.h6
4 files changed, 28 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index e6903097c..87659375b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -14,6 +14,8 @@
14 - djm@cvs.openbsd.org 2004/06/25 01:25:12 14 - djm@cvs.openbsd.org 2004/06/25 01:25:12
15 [regress/test-exec.sh] 15 [regress/test-exec.sh]
16 clean reexec-specific junk out of text-exec.sh and simplify; idea markus@ 16 clean reexec-specific junk out of text-exec.sh and simplify; idea markus@
17 - (dtucker) [configure.ac openbsd-compat/misc.c [openbsd-compat/misc.h]
18 Add closefrom() for platforms that don't have it.
17 19
1820040623 2020040623
19 - (dtucker) [auth1.c] Ensure do_pam_account is called for Protocol 1 21 - (dtucker) [auth1.c] Ensure do_pam_account is called for Protocol 1
@@ -1416,4 +1418,4 @@
1416 - (djm) Trim deprecated options from INSTALL. Mention UsePAM 1418 - (djm) Trim deprecated options from INSTALL. Mention UsePAM
1417 - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu 1419 - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu
1418 1420
1419$Id: ChangeLog,v 1.3447 2004/06/25 03:46:08 dtucker Exp $ 1421$Id: ChangeLog,v 1.3448 2004/06/25 04:03:34 dtucker Exp $
diff --git a/configure.ac b/configure.ac
index 88c0c4687..1bf3ca66f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
1# $Id: configure.ac,v 1.221 2004/06/20 17:37:32 tim Exp $ 1# $Id: configure.ac,v 1.222 2004/06/25 04:03:34 dtucker Exp $
2# 2#
3# Copyright (c) 1999-2004 Damien Miller 3# Copyright (c) 1999-2004 Damien Miller
4# 4#
@@ -830,8 +830,8 @@ AC_ARG_WITH(tcp-wrappers,
830 830
831dnl Checks for library functions. Please keep in alphabetical order 831dnl Checks for library functions. Please keep in alphabetical order
832AC_CHECK_FUNCS(\ 832AC_CHECK_FUNCS(\
833 arc4random __b64_ntop b64_ntop __b64_pton b64_pton \ 833 arc4random __b64_ntop b64_ntop __b64_pton b64_pton bcopy \
834 bcopy bindresvport_sa clock fchmod fchown freeaddrinfo futimes \ 834 bindresvport_sa clock closefrom fchmod fchown freeaddrinfo futimes \
835 getaddrinfo getcwd getgrouplist getnameinfo getopt \ 835 getaddrinfo getcwd getgrouplist getnameinfo getopt \
836 getpeereid _getpty getrlimit getttyent glob inet_aton \ 836 getpeereid _getpty getrlimit getttyent glob inet_aton \
837 inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove \ 837 inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove \
diff --git a/openbsd-compat/bsd-misc.c b/openbsd-compat/bsd-misc.c
index 7b06786f5..c58cce0f4 100644
--- a/openbsd-compat/bsd-misc.c
+++ b/openbsd-compat/bsd-misc.c
@@ -17,7 +17,7 @@
17#include "includes.h" 17#include "includes.h"
18#include "xmalloc.h" 18#include "xmalloc.h"
19 19
20RCSID("$Id: bsd-misc.c,v 1.21 2004/02/17 05:49:55 djm Exp $"); 20RCSID("$Id: bsd-misc.c,v 1.22 2004/06/25 04:03:34 dtucker Exp $");
21 21
22/* 22/*
23 * NB. duplicate __progname in case it is an alias for argv[0] 23 * NB. duplicate __progname in case it is an alias for argv[0]
@@ -192,6 +192,22 @@ tcsendbreak(int fd, int duration)
192} 192}
193#endif /* HAVE_TCSENDBREAK */ 193#endif /* HAVE_TCSENDBREAK */
194 194
195#ifndef HAVE_CLOSEFROM
196int
197closefrom(int fd)
198{
199 int i, result = 0, err = 0;
200
201 for (i = fd; i < 128; i++)
202 if (close(i) != 0) {
203 err = errno;
204 result = -1;
205 }
206 errno = err;
207 return result;
208}
209#endif /* HAVE_CLOSEFROM */
210
195mysig_t 211mysig_t
196mysignal(int sig, mysig_t act) 212mysignal(int sig, mysig_t act)
197{ 213{
diff --git a/openbsd-compat/bsd-misc.h b/openbsd-compat/bsd-misc.h
index 009739b14..7027815d6 100644
--- a/openbsd-compat/bsd-misc.h
+++ b/openbsd-compat/bsd-misc.h
@@ -1,4 +1,4 @@
1/* $Id: bsd-misc.h,v 1.15 2004/03/08 11:59:03 dtucker Exp $ */ 1/* $Id: bsd-misc.h,v 1.16 2004/06/25 04:03:34 dtucker Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1999-2004 Damien Miller <djm@mindrot.org> 4 * Copyright (c) 1999-2004 Damien Miller <djm@mindrot.org>
@@ -93,6 +93,10 @@ int tcsendbreak(int, int);
93void unsetenv(const char *); 93void unsetenv(const char *);
94#endif 94#endif
95 95
96#ifndef HAVE_CLOSEFROM
97int closefrom(int);
98#endif
99
96/* wrapper for signal interface */ 100/* wrapper for signal interface */
97typedef void (*mysig_t)(int); 101typedef void (*mysig_t)(int);
98mysig_t mysignal(int sig, mysig_t act); 102mysig_t mysignal(int sig, mysig_t act);