From 315054f4737a39489e0a14f3a92bff61f1592832 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Fri, 16 Jan 2015 06:40:24 +0000 Subject: Replace with and other less dirty headers where possible. Annotate lines with their current reasons. Switch to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where sensible to avoid pulling in the pollution. These are the files confirmed through binary verification. ok guenther, millert, doug (helped with the verification protocol) --- libexec/mail.local/locking.c | 9 +++++---- libexec/mail.local/mail.local.c | 7 ++++--- 2 files changed, 9 insertions(+), 7 deletions(-) (limited to 'libexec/mail.local') diff --git a/libexec/mail.local/locking.c b/libexec/mail.local/locking.c index a9a2a8d1881..191b2dfeed7 100644 --- a/libexec/mail.local/locking.c +++ b/libexec/mail.local/locking.c @@ -1,4 +1,4 @@ -/* $OpenBSD: locking.c,v 1.11 2014/01/17 21:42:47 tobias Exp $ */ +/* $OpenBSD: locking.c,v 1.12 2015/01/16 06:39:50 deraadt Exp $ */ /* * Copyright (c) 1996-1998 Theo de Raadt @@ -28,13 +28,14 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include +#include #include #include #include #include #include #include +#include #include #include #include @@ -43,7 +44,7 @@ #include "pathnames.h" #include "mail.local.h" -static char lpath[MAXPATHLEN]; +static char lpath[PATH_MAX]; void rellock(void) @@ -141,7 +142,7 @@ again: void baditem(char *path) { - char npath[MAXPATHLEN]; + char npath[PATH_MAX]; int fd; if (unlink(path) == 0) diff --git a/libexec/mail.local/mail.local.c b/libexec/mail.local/mail.local.c index 5c776327558..5231b44661d 100644 --- a/libexec/mail.local/mail.local.c +++ b/libexec/mail.local/mail.local.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mail.local.c,v 1.32 2009/10/27 23:59:31 deraadt Exp $ */ +/* $OpenBSD: mail.local.c,v 1.33 2015/01/16 06:39:50 deraadt Exp $ */ /*- * Copyright (c) 1996-1998 Theo de Raadt @@ -31,7 +31,7 @@ * SUCH DAMAGE. */ -#include +#include #include #include #include @@ -41,6 +41,7 @@ #include #include #include +#include #include #include #include @@ -171,7 +172,7 @@ deliver(int fd, char *name, int lockfile) struct stat sb, fsb; struct passwd *pw; int mbfd=-1, rval=1, lfd=-1; - char biffmsg[100], buf[8*1024], path[MAXPATHLEN]; + char biffmsg[100], buf[8*1024], path[PATH_MAX]; off_t curoff; size_t off; ssize_t nr, nw; -- cgit v1.2.3