diff options
author | bapt <bapt@FreeBSD.org> | 2016-08-22 07:08:00 +0000 |
---|---|---|
committer | bapt <bapt@FreeBSD.org> | 2016-08-22 07:08:00 +0000 |
commit | eaab8d99a5d1f39ace247d8cf82c208410d66b0f (patch) | |
tree | 686ee1f32f31581e315e67bc293217afe86d666d /contrib/dma/net.c | |
parent | deabaf2ffde2b7f97d6338ff385fe323ce29c367 (diff) | |
download | FreeBSD-src-eaab8d99a5d1f39ace247d8cf82c208410d66b0f.zip FreeBSD-src-eaab8d99a5d1f39ace247d8cf82c208410d66b0f.tar.gz |
Import Dragonfly Mail Agent snapshort from 20160806 aka v0.11+
Most important change being:
dma - Fix security hole
Affecting DragonFly 4.6 and earlier, Matt Dillon fixed this in base after
finding out from BSDNow Episode 152. Comments following were from his commit
which explains better than I. Just taking his change and putting it here as well.
* dma makes an age-old mistake of not properly checking whether a file
owned by a user is a symlink or not, a bug which the original mail.local
also had.
* Add O_NOFOLLOW to disallow symlinks.
Thanks-to: BSDNow Episode 152, made me dive dma to check when they talked
about the mail.local bug.
Diffstat (limited to 'contrib/dma/net.c')
-rw-r--r-- | contrib/dma/net.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/contrib/dma/net.c b/contrib/dma/net.c index 26935a8..47ee928 100644 --- a/contrib/dma/net.c +++ b/contrib/dma/net.c @@ -372,11 +372,13 @@ deliver_to_host(struct qitem *it, struct mx_hostentry *host) host->host, host->addr, c, neterr); \ snprintf(errmsg, sizeof(errmsg), "%s [%s] did not like our %s:\n%s", \ host->host, host->addr, c, neterr); \ - return (-1); \ + error = -1; \ + goto out; \ } else if (res != exp) { \ syslog(LOG_NOTICE, "remote delivery deferred: %s [%s] failed after %s: %s", \ host->host, host->addr, c, neterr); \ - return (1); \ + error = 1; \ + goto out; \ } /* Check first reply from remote host */ @@ -426,7 +428,8 @@ deliver_to_host(struct qitem *it, struct mx_hostentry *host) syslog(LOG_ERR, "remote delivery failed:" " SMTP login failed: %m"); snprintf(errmsg, sizeof(errmsg), "SMTP login to %s failed", host->host); - return (-1); + error = -1; + goto out; } /* SMTP login is not available, so try without */ else if (error > 0) { |