diff options
author | Casper Ti. Vector <CasperVector@gmail.com> | 2017-07-28 17:29:46 +0800 |
---|---|---|
committer | Casper Ti. Vector <CasperVector@gmail.com> | 2017-07-29 13:44:26 +0800 |
commit | bad5940cdd56c7a86265efc00f8685dccefa6b47 (patch) | |
tree | b7dd8d01d368271990f4e65a0119696e8a5a54bb /contrib | |
parent | Merge pull request #790 from bsdsx/check_SSL_OP_NO_CLIENT_RENEGOTIATION (diff) | |
download | OpenSMTPD-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.c | 5 |
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. |