summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreric <eric@openbsd.org>2011-11-14 16:54:19 +0000
committereric <eric@openbsd.org>2011-11-14 16:54:19 +0000
commit01035ee8275c5ec4f0da244c9ce0829d321a96d1 (patch)
treedc15e9010a4a3cbec1e62be88ac2cab5811f2563
parentdale and i theorize that these days armish can safely be compiled (diff)
downloadwireguard-openbsd-01035ee8275c5ec4f0da244c9ce0829d321a96d1.tar.xz
wireguard-openbsd-01035ee8275c5ec4f0da244c9ce0829d321a96d1.zip
make sure that the offline directory has the right owner/perms
before enqueueing offline mail. ok gilles@
-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");