diff options
| author | 2009-01-28 11:27:57 +0000 | |
|---|---|---|
| committer | 2009-01-28 11:27:57 +0000 | |
| commit | 1bc2827f32a79be77a7404a60fcd3569233a1e68 (patch) | |
| tree | 64a81fe65dadbb5e5d29e0e322d136330fd56c60 /usr.sbin/smtpd/queue.c | |
| parent | Document the difference between RB_FIND and RB_NFIND in tree(3). (diff) | |
| download | wireguard-openbsd-1bc2827f32a79be77a7404a60fcd3569233a1e68.tar.xz wireguard-openbsd-1bc2827f32a79be77a7404a60fcd3569233a1e68.zip | |
add a struct path to struct message so that we can keep track of the RCPT
provided recipient even after aliases/forwards expansion, we'll need this
for loop detection.
message id and uid being MAXPATHLEN long is a waste, define MAX_ID_SIZE
which is currently set to 64 (but can probably be further reduced) and
make sure that structures and the few strlcpy's use the right define.
original idea by jacekm@ a while ago
Diffstat (limited to 'usr.sbin/smtpd/queue.c')
| -rw-r--r-- | usr.sbin/smtpd/queue.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.sbin/smtpd/queue.c b/usr.sbin/smtpd/queue.c index f1b41c8d800..2accb62fdb7 100644 --- a/usr.sbin/smtpd/queue.c +++ b/usr.sbin/smtpd/queue.c @@ -1,4 +1,4 @@ -/* $OpenBSD: queue.c,v 1.48 2009/01/27 22:48:29 gilles Exp $ */ +/* $OpenBSD: queue.c,v 1.49 2009/01/28 11:27:57 gilles Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -119,7 +119,7 @@ queue_dispatch_control(int sig, short event, void *p) ss.id = messagep->session_id; ss.code = 250; - bzero(ss.u.msgid, MAXPATHLEN); + bzero(ss.u.msgid, MAX_ID_SIZE); if (! enqueue_create_layout(ss.u.msgid)) ss.code = 421; @@ -217,7 +217,7 @@ queue_dispatch_smtp(int sig, short event, void *p) messagep = imsg.data; ss.id = messagep->session_id; ss.code = 250; - bzero(ss.u.msgid, MAXPATHLEN); + bzero(ss.u.msgid, MAX_ID_SIZE); if (! queue_create_incoming_layout(ss.u.msgid)) ss.code = 421; @@ -786,10 +786,10 @@ int queue_load_envelope(struct message *messagep, char *evpid) { char pathname[MAXPATHLEN]; - char msgid[MAXPATHLEN]; + char msgid[MAX_ID_SIZE]; FILE *fp; - if (strlcpy(msgid, evpid, MAXPATHLEN) >= MAXPATHLEN) + if (strlcpy(msgid, evpid, MAX_ID_SIZE) >= MAX_ID_SIZE) fatalx("queue_load_envelope: truncation"); *strrchr(msgid, '.') = '\0'; |
