diff options
author | Eric Faurot <eric@cvs.openbsd.org> | 2011-11-14 16:54:20 +0000 |
---|---|---|
committer | Eric Faurot <eric@cvs.openbsd.org> | 2011-11-14 16:54:20 +0000 |
commit | e7ec402301f9aa441785e17fb8513d169e1c0646 (patch) | |
tree | f27deb88397b91aa472177da41a11eae58b26aed /usr.sbin | |
parent | 4ab7b6a2b0a5516442af3fb79998704b60c107f9 (diff) |
make sure that the offline directory has the right owner/perms
before enqueueing offline mail.
ok gilles@
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/smtpd/enqueue.c | 5 |
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"); |