summaryrefslogtreecommitdiff
path: root/libexec/mail.local
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2015-01-16 06:40:24 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2015-01-16 06:40:24 +0000
commit315054f4737a39489e0a14f3a92bff61f1592832 (patch)
tree62bf010653374ce09b6beb4dfa0414a91457233b /libexec/mail.local
parent79e3d817585ca08a91e30ad14abe43e2ab70295f (diff)
Replace <sys/param.h> with <limits.h> and other less dirty headers where
possible. Annotate <sys/param.h> 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)
Diffstat (limited to 'libexec/mail.local')
-rw-r--r--libexec/mail.local/locking.c9
-rw-r--r--libexec/mail.local/mail.local.c7
2 files changed, 9 insertions, 7 deletions
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 <deraadt@theos.com>
@@ -28,13 +28,14 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/param.h>
+#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <pwd.h>
#include <syslog.h>
#include <time.h>
#include <unistd.h>
+#include <limits.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
@@ -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 <deraadt@theos.com>
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
+#include <sys/types.h>
#include <sys/stat.h>
#include <sys/socket.h>
#include <netinet/in.h>
@@ -41,6 +41,7 @@
#include <pwd.h>
#include <time.h>
#include <unistd.h>
+#include <limits.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
@@ -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;