aboutsummaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorCasper Ti. Vector <CasperVector@gmail.com>2017-07-28 17:29:46 +0800
committerCasper Ti. Vector <CasperVector@gmail.com>2017-07-29 13:44:26 +0800
commitbad5940cdd56c7a86265efc00f8685dccefa6b47 (patch)
treeb7dd8d01d368271990f4e65a0119696e8a5a54bb /contrib
parentMerge pull request #790 from bsdsx/check_SSL_OP_NO_CLIENT_RENEGOTIATION (diff)
downloadOpenSMTPD-bad5940cdd56c7a86265efc00f8685dccefa6b47.tar.xz
OpenSMTPD-bad5940cdd56c7a86265efc00f8685dccefa6b47.zip
getlock(): bail out immediately if mail spool does not exist.
Diffstat (limited to 'contrib')
-rw-r--r--contrib/libexec/mail.local/locking.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/contrib/libexec/mail.local/locking.c b/contrib/libexec/mail.local/locking.c
index e16a61ad..ab6eb1a8 100644
--- a/contrib/libexec/mail.local/locking.c
+++ b/contrib/libexec/mail.local/locking.c
@@ -66,8 +66,9 @@ getlock(char *name, struct passwd *pw)
(void)snprintf(lpath, sizeof lpath, "%s/%s.lock",
_PATH_MAILDIR, name);
- if (stat(_PATH_MAILDIR, &sb) != -1 &&
- (sb.st_mode & S_IWOTH) == S_IWOTH) {
+ if (stat(_PATH_MAILDIR, &sb) == -1)
+ merr(FATAL, "%s: %s", _PATH_MAILDIR, strerror(errno));
+ if ((sb.st_mode & S_IWOTH) == S_IWOTH) {
/*
* We have a writeable spool, deal with it as
* securely as possible.