diff options
author | 2004-03-31 10:47:16 +0000 | |
---|---|---|
committer | 2004-03-31 10:47:16 +0000 | |
commit | d7c6b8cf03234113cc5f34acf8dea7490f0bc222 (patch) | |
tree | 6dd081a2193057543dd16a8ac4c384ff0477349a | |
parent | it is no longer required to have local-address set with tcp md5sig, (diff) | |
download | wireguard-openbsd-d7c6b8cf03234113cc5f34acf8dea7490f0bc222.tar.xz wireguard-openbsd-d7c6b8cf03234113cc5f34acf8dea7490f0bc222.zip |
Don't assume closefrom(2) exists everywhere. hshoexer@, markus@ ok.
-rw-r--r-- | sbin/isakmpd/isakmpd.c | 8 | ||||
-rw-r--r-- | sbin/isakmpd/sysdep/openbsd/Makefile.sysdep | 3 |
2 files changed, 9 insertions, 2 deletions
diff --git a/sbin/isakmpd/isakmpd.c b/sbin/isakmpd/isakmpd.c index ec6a0cd0351..12ae94e2ed0 100644 --- a/sbin/isakmpd/isakmpd.c +++ b/sbin/isakmpd/isakmpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isakmpd.c,v 1.58 2004/03/19 14:04:43 hshoexer Exp $ */ +/* $OpenBSD: isakmpd.c,v 1.59 2004/03/31 10:47:16 ho Exp $ */ /* $EOM: isakmpd.c,v 1.54 2000/10/05 09:28:22 niklas Exp $ */ /* @@ -363,7 +363,13 @@ main (int argc, char *argv[]) size_t mask_size; struct timeval tv, *timeout; +#if defined (HAVE_CLOSEFROM) && (!defined (OpenBSD) || (OpenBSD >= 200405)) closefrom (STDERR_FILENO + 1); +#else + m = getdtablesize (); + for (n = STDERR_FILENO + 1; n < m; n++) + (void)close (n); +#endif /* Make sure init() won't alloc fd 0, 1 or 2, as daemon() will close them. */ for (n = 0; n <= 2; n++) diff --git a/sbin/isakmpd/sysdep/openbsd/Makefile.sysdep b/sbin/isakmpd/sysdep/openbsd/Makefile.sysdep index 81d86dc57f2..837ac27cd15 100644 --- a/sbin/isakmpd/sysdep/openbsd/Makefile.sysdep +++ b/sbin/isakmpd/sysdep/openbsd/Makefile.sysdep @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.sysdep,v 1.22 2003/06/03 14:53:11 ho Exp $ +# $OpenBSD: Makefile.sysdep,v 1.23 2004/03/31 10:47:16 ho Exp $ # $EOM: Makefile.sysdep,v 1.18 2001/01/26 10:55:22 niklas Exp $ # @@ -33,6 +33,7 @@ IPSEC_SRCS= pf_key_v2.c IPSEC_CFLAGS= -DUSE_PF_KEY_V2 CFLAGS+= -DHAVE_GETNAMEINFO -DHAVE_GETIFADDRS -DHAVE_PCAP +CFLAGS+= -DHAVE_CLOSEFROM USE_LIBCRYPTO= defined |