summaryrefslogtreecommitdiffstats
path: root/usr.sbin/smtpd
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2020-02-25 17:03:13 +0000
committermillert <millert@openbsd.org>2020-02-25 17:03:13 +0000
commit1d4bec263d3cb6ea55cff348bfe147e740a56714 (patch)
treee526ffa147327e94a0109ef4b0cf78e1e6b999d3 /usr.sbin/smtpd
parenttraditional nslookup would not fatal if the server name was undiscoverable. (diff)
downloadwireguard-openbsd-1d4bec263d3cb6ea55cff348bfe147e740a56714.tar.xz
wireguard-openbsd-1d4bec263d3cb6ea55cff348bfe147e740a56714.zip
fsqueue_envelope_dump() returns 0 on temporary failure, not -1.
We should only exit the loop that creates the queue file if we successfully created the file or we've exceeded the max number of tries. From gilles@ based on feedback from Qualys.
Diffstat (limited to 'usr.sbin/smtpd')
-rw-r--r--usr.sbin/smtpd/queue_fs.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/usr.sbin/smtpd/queue_fs.c b/usr.sbin/smtpd/queue_fs.c
index d1cd4800a9e..924bd2617c2 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.19 2019/06/28 13:32:51 deraadt Exp $ */
+/* $OpenBSD: queue_fs.c,v 1.20 2020/02/25 17:03:13 millert Exp $ */
/*
* Copyright (c) 2011 Gilles Chehade <gilles@poolp.org>
@@ -228,8 +228,7 @@ queue_fs_envelope_create(uint32_t msgid, const char *buf, size_t len,
fsqueue_envelope_incoming_path(*evpid, path,
sizeof(path));
- r = fsqueue_envelope_dump(path, buf, len, 0, 0);
- if (r >= 0)
+ if ((r = fsqueue_envelope_dump(path, buf, len, 0, 0)) != 0)
goto done;
}
r = 0;