to the heavy use of assert.
ok millert
-/* $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>
*/
#include <sys/types.h>
-#include <sys/param.h>
#include <errno.h>
#include <limits.h>
#include "ber.h"
+#define MINIMUM(a, b) (((a) < (b)) ? (a) : (b))
#define BER_TYPE_CONSTRUCTED 0x20 /* otherwise primitive */
#define BER_TYPE_SINGLE_MAX 30
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 */
-/* $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>
#include <sys/tree.h>
#include <sys/stat.h>
#include <sys/queue.h>
-#include <sys/param.h>
#include <sys/uio.h>
#include <assert.h>
-/* $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>
*/
#include <sys/queue.h>
-#include <sys/param.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/socket.h>
* 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>
-/* $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>
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);
-/* $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>
#include <sys/tree.h>
#include <sys/types.h>
#include <sys/uio.h>
-#include <sys/param.h>
#include <event.h>
#include <imsg.h>
};
struct open_req {
- char path[MAXPATHLEN+1];
+ char path[PATH_MAX+1];
unsigned int rdonly;
};
-/* $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>
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);
-/* $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>
#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>
#include <openssl/dh.h>
#include <openssl/bn.h>
+#define MINIMUM(a, b) (((a) < (b)) ? (a) : (b))
+
#include "ldapd.h"
#define SSL_CIPHERS "HIGH:!aNULL"
}
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) {