summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2015-01-16 16:04:38 +0000
committerderaadt <deraadt@openbsd.org>2015-01-16 16:04:38 +0000
commitefb9420f786b6f0ead36a3a16b3aee0c4f372fb6 (patch)
tree52c8c9ce8f21fca9193306332f36d6e6cc7229d4
parentmanage spacing in a simpler way, removing some useless macros mandoc warns about (diff)
downloadwireguard-openbsd-efb9420f786b6f0ead36a3a16b3aee0c4f372fb6.tar.xz
wireguard-openbsd-efb9420f786b6f0ead36a3a16b3aee0c4f372fb6.zip
change to <limits.h> universe. The only changes in the binary are due
to the heavy use of assert. ok millert
-rw-r--r--usr.sbin/ldapd/ber.c6
-rw-r--r--usr.sbin/ldapd/btree.c3
-rw-r--r--usr.sbin/ldapd/control.c3
-rw-r--r--usr.sbin/ldapd/imsgev.c1
-rw-r--r--usr.sbin/ldapd/ldapd.c4
-rw-r--r--usr.sbin/ldapd/ldapd.h5
-rw-r--r--usr.sbin/ldapd/ldape.c4
-rw-r--r--usr.sbin/ldapd/ssl.c7
8 files changed, 15 insertions, 18 deletions
diff --git a/usr.sbin/ldapd/ber.c b/usr.sbin/ldapd/ber.c
index 91f2596c6a8..95af0fc4992 100644
--- a/usr.sbin/ldapd/ber.c
+++ b/usr.sbin/ldapd/ber.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ber.c,v 1.6 2011/01/08 19:42:45 martinh Exp $ */
+/* $OpenBSD: ber.c,v 1.7 2015/01/16 16:04:38 deraadt Exp $ */
/*
* Copyright (c) 2007 Reyk Floeter <reyk@vantronix.net>
@@ -19,7 +19,6 @@
*/
#include <sys/types.h>
-#include <sys/param.h>
#include <errno.h>
#include <limits.h>
@@ -32,6 +31,7 @@
#include "ber.h"
+#define MINIMUM(a, b) (((a) < (b)) ? (a) : (b))
#define BER_TYPE_CONSTRUCTED 0x20 /* otherwise primitive */
#define BER_TYPE_SINGLE_MAX 30
@@ -1170,7 +1170,7 @@ ber_readbuf(struct ber *b, void *buf, size_t nbytes)
return -1;
sz = b->br_rend - b->br_rptr;
- len = MIN(nbytes, sz);
+ len = MINIMUM(nbytes, sz);
if (len == 0) {
errno = ECANCELED;
return (-1); /* end of buffer and parser wants more data */
diff --git a/usr.sbin/ldapd/btree.c b/usr.sbin/ldapd/btree.c
index deecbcc74d0..cbba2ba5c54 100644
--- a/usr.sbin/ldapd/btree.c
+++ b/usr.sbin/ldapd/btree.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: btree.c,v 1.31 2013/11/02 13:31:51 deraadt Exp $ */
+/* $OpenBSD: btree.c,v 1.32 2015/01/16 16:04:38 deraadt Exp $ */
/*
* Copyright (c) 2009, 2010 Martin Hedenfalk <martin@bzero.se>
@@ -20,7 +20,6 @@
#include <sys/tree.h>
#include <sys/stat.h>
#include <sys/queue.h>
-#include <sys/param.h>
#include <sys/uio.h>
#include <assert.h>
diff --git a/usr.sbin/ldapd/control.c b/usr.sbin/ldapd/control.c
index d13f404a352..e72139441d5 100644
--- a/usr.sbin/ldapd/control.c
+++ b/usr.sbin/ldapd/control.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: control.c,v 1.9 2013/11/02 13:31:51 deraadt Exp $ */
+/* $OpenBSD: control.c,v 1.10 2015/01/16 16:04:38 deraadt Exp $ */
/*
* Copyright (c) 2010 Martin Hedenfalk <martin@bzero.se>
@@ -18,7 +18,6 @@
*/
#include <sys/queue.h>
-#include <sys/param.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/socket.h>
diff --git a/usr.sbin/ldapd/imsgev.c b/usr.sbin/ldapd/imsgev.c
index 6daa4d1d397..57c26a5e1f7 100644
--- a/usr.sbin/ldapd/imsgev.c
+++ b/usr.sbin/ldapd/imsgev.c
@@ -14,7 +14,6 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/param.h>
#include <sys/queue.h>
#include <sys/socket.h>
#include <sys/uio.h>
diff --git a/usr.sbin/ldapd/ldapd.c b/usr.sbin/ldapd/ldapd.c
index 4dfd3557fe5..4d379a49f64 100644
--- a/usr.sbin/ldapd/ldapd.c
+++ b/usr.sbin/ldapd/ldapd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ldapd.c,v 1.11 2014/08/25 07:50:26 doug Exp $ */
+/* $OpenBSD: ldapd.c,v 1.12 2015/01/16 16:04:38 deraadt Exp $ */
/*
* Copyright (c) 2009, 2010 Martin Hedenfalk <martin@bzero.se>
@@ -351,7 +351,7 @@ ldapd_open_request(struct imsgev *iev, struct imsg *imsg)
fatal("invalid size of open request");
/* make sure path is null-terminated */
- oreq->path[MAXPATHLEN] = '\0';
+ oreq->path[PATH_MAX] = '\0';
if (strncmp(oreq->path, DATADIR, strlen(DATADIR)) != 0) {
log_warnx("refusing to open file %s", oreq->path);
diff --git a/usr.sbin/ldapd/ldapd.h b/usr.sbin/ldapd/ldapd.h
index 3fb655ca6b7..144db1b7937 100644
--- a/usr.sbin/ldapd/ldapd.h
+++ b/usr.sbin/ldapd/ldapd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ldapd.h,v 1.23 2012/06/16 00:08:32 jmatthew Exp $ */
+/* $OpenBSD: ldapd.h,v 1.24 2015/01/16 16:04:38 deraadt Exp $ */
/*
* Copyright (c) 2009, 2010 Martin Hedenfalk <martin@bzero.se>
@@ -24,7 +24,6 @@
#include <sys/tree.h>
#include <sys/types.h>
#include <sys/uio.h>
-#include <sys/param.h>
#include <event.h>
#include <imsg.h>
@@ -285,7 +284,7 @@ struct auth_res
};
struct open_req {
- char path[MAXPATHLEN+1];
+ char path[PATH_MAX+1];
unsigned int rdonly;
};
diff --git a/usr.sbin/ldapd/ldape.c b/usr.sbin/ldapd/ldape.c
index b13fdb01455..58a698fcf14 100644
--- a/usr.sbin/ldapd/ldape.c
+++ b/usr.sbin/ldapd/ldape.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ldape.c,v 1.18 2013/11/02 13:31:51 deraadt Exp $ */
+/* $OpenBSD: ldape.c,v 1.19 2015/01/16 16:04:38 deraadt Exp $ */
/*
* Copyright (c) 2009, 2010 Martin Hedenfalk <martin@bzero.se>
@@ -530,7 +530,7 @@ ldape_open_result(struct imsg *imsg)
fatal("invalid size of open result");
/* make sure path is null-terminated */
- oreq->path[MAXPATHLEN] = '\0';
+ oreq->path[PATH_MAX] = '\0';
log_debug("open(%s) returned fd %d", oreq->path, imsg->fd);
diff --git a/usr.sbin/ldapd/ssl.c b/usr.sbin/ldapd/ssl.c
index 2f2e0404da4..759a18f291a 100644
--- a/usr.sbin/ldapd/ssl.c
+++ b/usr.sbin/ldapd/ssl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssl.c,v 1.7 2014/07/11 06:06:25 jsg Exp $ */
+/* $OpenBSD: ssl.c,v 1.8 2015/01/16 16:04:38 deraadt Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org>
@@ -20,7 +20,6 @@
#include <sys/types.h>
#include <sys/queue.h>
#include <sys/tree.h>
-#include <sys/param.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/time.h>
@@ -40,6 +39,8 @@
#include <openssl/dh.h>
#include <openssl/bn.h>
+#define MINIMUM(a, b) (((a) < (b)) ? (a) : (b))
+
#include "ldapd.h"
#define SSL_CIPHERS "HIGH:!aNULL"
@@ -78,7 +79,7 @@ ssl_read(int fd, short event, void *p)
}
if (bufev->wm_read.high != 0)
- howmuch = MIN(sizeof(rbuf), bufev->wm_read.high);
+ howmuch = MINIMUM(sizeof(rbuf), bufev->wm_read.high);
ret = SSL_read(s->s_ssl, rbuf, howmuch);
if (ret <= 0) {