diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-01-20 17:37:55 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-01-20 17:37:55 +0000 |
commit | ee84f1cbaf28a0c8511dd2de2685028d389414b2 (patch) | |
tree | 0f2893c7931f5e91baa8636ffb931a4c90730812 /usr.sbin/smtpd/queue_fs.c | |
parent | 52ef1f80c283aa859feb09537098b134f58707fc (diff) |
use <limits.h> comprehensively. For now try to push <> includes to
each .c file, and out of the .h files. To avoid overinclude.
ok gilles, in principle. If this has been done right, -portable should
become easier to maintain.
Diffstat (limited to 'usr.sbin/smtpd/queue_fs.c')
-rw-r--r-- | usr.sbin/smtpd/queue_fs.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/usr.sbin/smtpd/queue_fs.c b/usr.sbin/smtpd/queue_fs.c index 25a7f17b404..38d027cdcf2 100644 --- a/usr.sbin/smtpd/queue_fs.c +++ b/usr.sbin/smtpd/queue_fs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: queue_fs.c,v 1.7 2015/01/16 06:40:21 deraadt Exp $ */ +/* $OpenBSD: queue_fs.c,v 1.8 2015/01/20 17:37:54 deraadt Exp $ */ /* * Copyright (c) 2011 Gilles Chehade <gilles@poolp.org> @@ -76,7 +76,7 @@ static struct timespec startup; static int queue_fs_message_create(uint32_t *msgid) { - char rootdir[SMTPD_MAXPATHLEN]; + char rootdir[PATH_MAX]; struct stat sb; if (! fsqueue_check_space()) @@ -117,10 +117,10 @@ again: static int queue_fs_message_commit(uint32_t msgid, const char *path) { - char incomingdir[SMTPD_MAXPATHLEN]; - char queuedir[SMTPD_MAXPATHLEN]; - char msgdir[SMTPD_MAXPATHLEN]; - char msgpath[SMTPD_MAXPATHLEN]; + char incomingdir[PATH_MAX]; + char queuedir[PATH_MAX]; + char msgdir[PATH_MAX]; + char msgpath[PATH_MAX]; /* before-first, move the message content in the incoming directory */ fsqueue_message_incoming_path(msgid, msgpath, sizeof(msgpath)); @@ -175,7 +175,7 @@ static int queue_fs_message_fd_r(uint32_t msgid) { int fd; - char path[SMTPD_MAXPATHLEN]; + char path[PATH_MAX]; fsqueue_message_path(msgid, path, sizeof(path)); if (strlcat(path, PATH_MESSAGE, sizeof(path)) @@ -193,7 +193,7 @@ queue_fs_message_fd_r(uint32_t msgid) static int queue_fs_message_delete(uint32_t msgid) { - char path[SMTPD_MAXPATHLEN]; + char path[PATH_MAX]; struct stat sb; fsqueue_message_incoming_path(msgid, path, sizeof(path)); @@ -212,8 +212,8 @@ static int queue_fs_message_corrupt(uint32_t msgid) { struct stat sb; - char rootdir[SMTPD_MAXPATHLEN]; - char corruptdir[SMTPD_MAXPATHLEN]; + char rootdir[PATH_MAX]; + char corruptdir[PATH_MAX]; char buf[64]; int retry = 0; @@ -244,7 +244,7 @@ static int queue_fs_envelope_create(uint32_t msgid, const char *buf, size_t len, uint64_t *evpid) { - char path[SMTPD_MAXPATHLEN]; + char path[PATH_MAX]; int queued = 0, i, r = 0, *n; struct stat sb; @@ -286,7 +286,7 @@ done: static int queue_fs_envelope_load(uint64_t evpid, char *buf, size_t len) { - char pathname[SMTPD_MAXPATHLEN]; + char pathname[PATH_MAX]; FILE *fp; size_t r; @@ -316,7 +316,7 @@ queue_fs_envelope_load(uint64_t evpid, char *buf, size_t len) static int queue_fs_envelope_update(uint64_t evpid, const char *buf, size_t len) { - char dest[SMTPD_MAXPATHLEN]; + char dest[PATH_MAX]; fsqueue_envelope_path(evpid, dest, sizeof(dest)); @@ -326,7 +326,7 @@ queue_fs_envelope_update(uint64_t evpid, const char *buf, size_t len) static int queue_fs_envelope_delete(uint64_t evpid) { - char pathname[SMTPD_MAXPATHLEN]; + char pathname[PATH_MAX]; uint32_t msgid; int *n; @@ -538,7 +538,7 @@ fsqueue_message_incoming_path(uint32_t msgid, char *buf, size_t len) static void * fsqueue_qwalk_new(void) { - char path[SMTPD_MAXPATHLEN]; + char path[PATH_MAX]; char * const path_argv[] = { path, NULL }; struct qwalk *q; @@ -621,7 +621,7 @@ queue_fs_init(struct passwd *pw, int server, const char *conf) { unsigned int n; char *paths[] = { PATH_QUEUE, PATH_CORRUPT, PATH_INCOMING }; - char path[SMTPD_MAXPATHLEN]; + char path[PATH_MAX]; int ret; struct timeval tv; |