aboutsummaryrefslogtreecommitdiff
path: root/mail/dma/files
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2016-08-20 16:39:51 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2016-08-20 16:39:51 +0000
commit2311550ca7b0fdc903223263effb8cf8f66da1fc (patch)
tree4d9f1ae3d59264dae7004ccee1f253ff76adca95 /mail/dma/files
parent05ee43e04752fcaf0e3d6eafd941cc6ac5cc9908 (diff)
downloadports-2311550ca7b0fdc903223263effb8cf8f66da1fc.tar.gz
ports-2311550ca7b0fdc903223263effb8cf8f66da1fc.zip
Incorporate a patch from upstream
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.
Notes
Notes: svn path=/head/; revision=420518
Diffstat (limited to 'mail/dma/files')
-rw-r--r--mail/dma/files/fix-security-hole.patch34
1 files changed, 34 insertions, 0 deletions
diff --git a/mail/dma/files/fix-security-hole.patch b/mail/dma/files/fix-security-hole.patch
new file mode 100644
index 000000000000..9efd7bd76985
--- /dev/null
+++ b/mail/dma/files/fix-security-hole.patch
@@ -0,0 +1,34 @@
+From f249aa412dd4a09881cb450390d1003815bd0013 Mon Sep 17 00:00:00 2001
+From: Zach Crownover <zachary.crownover@gmail.com>
+Date: Fri, 5 Aug 2016 15:24:27 -0700
+Subject: [PATCH] dma - Fix security hole (#46)
+
+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.
+---
+ dma-mbox-create.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/dma-mbox-create.c b/dma-mbox-create.c
+index 532a7af..45a4792 100644
+--- a/dma-mbox-create.c
++++ b/dma-mbox-create.c
+@@ -142,7 +142,7 @@ main(int argc, char **argv)
+ logfail(EX_CANTCREAT, "cannot build mbox path for `%s/%s'", _PATH_MAILDIR, user);
+ }
+
+- f = open(fn, O_RDONLY|O_CREAT, 0600);
++ f = open(fn, O_RDONLY|O_CREAT|O_NOFOLLOW, 0600);
+ if (f < 0)
+ logfail(EX_NOINPUT, "cannt open mbox `%s'", fn);
+