summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd
diff options
context:
space:
mode:
authorEric Faurot <eric@cvs.openbsd.org>2011-11-14 16:54:20 +0000
committerEric Faurot <eric@cvs.openbsd.org>2011-11-14 16:54:20 +0000
commite7ec402301f9aa441785e17fb8513d169e1c0646 (patch)
treef27deb88397b91aa472177da41a11eae58b26aed /usr.sbin/smtpd
parent4ab7b6a2b0a5516442af3fb79998704b60c107f9 (diff)
make sure that the offline directory has the right owner/perms
before enqueueing offline mail. ok gilles@
Diffstat (limited to 'usr.sbin/smtpd')
-rw-r--r--usr.sbin/smtpd/enqueue.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.sbin/smtpd/enqueue.c b/usr.sbin/smtpd/enqueue.c
index f120fc64846..78ab6b796cb 100644
--- a/usr.sbin/smtpd/enqueue.c
+++ b/usr.sbin/smtpd/enqueue.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: enqueue.c,v 1.48 2011/11/02 12:01:20 eric Exp $ */
+/* $OpenBSD: enqueue.c,v 1.49 2011/11/14 16:54:19 eric Exp $ */
/*
* Copyright (c) 2005 Henning Brauer <henning@bulabula.org>
@@ -587,6 +587,9 @@ enqueue_offline(int argc, char *argv[])
FILE *fp;
int i, fd, ch;
+ if (ckdir(PATH_SPOOL PATH_OFFLINE, 01777, 0, 0, 0) == 0)
+ errx(1, "error in offline directory setup");
+
if (! bsnprintf(path, sizeof(path), "%s%s/%lld.XXXXXXXXXX", PATH_SPOOL,
PATH_OFFLINE, (long long int) time(NULL)))
err(1, "snprintf");