summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorghen <ghen@pkgsrc.org>2006-12-11 14:07:43 +0000
committerghen <ghen@pkgsrc.org>2006-12-11 14:07:43 +0000
commit2a0bc8b49fa9cc059055de4003339f627c7b55be (patch)
tree7b5ea3c23b90273b6a5e8f0ee3d9f56f901c3822
parent3f52b396f3f529dcd4aa215575dab3af131f85f8 (diff)
downloadpkgsrc-2a0bc8b49fa9cc059055de4003339f627c7b55be.tar.gz
Pullup ticket 1954 - requested by salo
security fix for mutt-devel - pkgsrc/mail/mutt-devel/Makefile 1.53,1.55 - pkgsrc/mail/mutt-devel/distinfo 1.35,1.36 - pkgsrc/mail/mutt-devel/patches/patch-ae 1.7,1.8 Module Name: pkgsrc Committed By: tonio Date: Fri Nov 3 18:19:07 UTC 2006 Modified Files: pkgsrc/mail/mutt-devel: Makefile distinfo Added Files: pkgsrc/mail/mutt-devel/patches: patch-ae Log Message: Make sure that a temporary has been opened with proper permissions. Fixes the security problem reported in CVE-2006-5298. Patch from tron@ for the mail/mutt package --- Module Name: pkgsrc Committed By: salo Date: Mon Dec 11 12:47:13 UTC 2006 Modified Files: pkgsrc/mail/mutt-devel: Makefile distinfo pkgsrc/mail/mutt-devel/patches: patch-ae Log Message: Use official upstream patch for CVE-2006-5297 and CVE-2006-5298 security issues from mutt GIT repo. Bump PKGREVISION.
-rw-r--r--mail/mutt-devel/Makefile3
-rw-r--r--mail/mutt-devel/distinfo3
-rw-r--r--mail/mutt-devel/patches/patch-ae91
3 files changed, 95 insertions, 2 deletions
diff --git a/mail/mutt-devel/Makefile b/mail/mutt-devel/Makefile
index 5d3d9bae670..3edd69bdecb 100644
--- a/mail/mutt-devel/Makefile
+++ b/mail/mutt-devel/Makefile
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.52 2006/08/16 10:42:05 tonio Exp $
+# $NetBSD: Makefile,v 1.52.2.1 2006/12/11 14:07:43 ghen Exp $
DISTNAME= mutt-1.5.13
+PKGREVISION= 2
CATEGORIES= mail
MUTT_SITES= ftp://ftp.mutt.org/mutt/ \
ftp://ftp.stealth.net/pub/mirrors/ftp.mutt.org/pub/mutt/ \
diff --git a/mail/mutt-devel/distinfo b/mail/mutt-devel/distinfo
index 3011ef31dc5..fbddee1a5ae 100644
--- a/mail/mutt-devel/distinfo
+++ b/mail/mutt-devel/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.34 2006/08/19 18:43:02 tonio Exp $
+$NetBSD: distinfo,v 1.34.2.1 2006/12/11 14:07:43 ghen Exp $
SHA1 (mutt-1.5.13.tar.gz) = 6d5b88d33e1727bf0342c31f06d55d7a3d2d4e0a
RMD160 (mutt-1.5.13.tar.gz) = 9327b7f928aad78a20c2395629113ac2519bb945
@@ -10,6 +10,7 @@ SHA1 (patch-aa) = 59d89dce24110be2927c8a1ea1fa5b780d644372
SHA1 (patch-ab) = 67e0deb5af56830397d897979ac806f9c16fdbda
SHA1 (patch-ac) = b48ff9f66ff2b483b5aa0c312e08bd22c7cf03be
SHA1 (patch-ad) = ecfa994c7c5e494b6eb7356327b96de6559146fc
+SHA1 (patch-ae) = 1ff6efde4e7d380008c466800d6164b51a4b3414
SHA1 (patch-ag) = 84637d95fa9aa0cf58a6e6b2c82b783efa21cf66
SHA1 (patch-ah) = 4227c5768b900e58fa4a679e6ad67efc974a70b5
SHA1 (patch-ai) = 7d9883198a22615fb1792a41fce3ee9821f48f08
diff --git a/mail/mutt-devel/patches/patch-ae b/mail/mutt-devel/patches/patch-ae
new file mode 100644
index 00000000000..6c7cc2a2e95
--- /dev/null
+++ b/mail/mutt-devel/patches/patch-ae
@@ -0,0 +1,91 @@
+$NetBSD: patch-ae,v 1.6.2.1 2006/12/11 14:07:43 ghen Exp $
+
+Security fixes for CVE-2006-5297 and CVE-2006-5298, from mutt git.
+
+--- lib.c.orig 2006-05-18 20:44:29.000000000 +0200
++++ lib.c 2006-12-11 13:39:27.000000000 +0100
+@@ -481,13 +481,84 @@ int safe_rename (const char *src, const
+ return 0;
+ }
+
++/* Create a temporary directory next to a file name */
++
++int mutt_mkwrapdir (const char *path, char *newfile, size_t nflen,
++ char *newdir, size_t ndlen)
++{
++ const char *basename;
++ char parent[_POSIX_PATH_MAX];
++ char *p;
++ int rv;
++
++ strfcpy (parent, NONULL (path), sizeof (parent));
++
++ if ((p = strrchr (parent, '/')))
++ {
++ *p = '\0';
++ basename = p + 1;
++ }
++ else
++ {
++ strfcpy (parent, ".", sizeof (parent));
++ basename = path;
++ }
++
++ do
++ {
++ snprintf (newdir, ndlen, "%s/%s", parent, ".muttXXXXXX");
++ mktemp (newdir);
++ }
++ while ((rv = mkdir (newdir, 0700)) == -1 && errno == EEXIST);
++
++ if (rv == -1)
++ return -1;
++
++ snprintf (newfile, nflen, "%s/%s", newdir, NONULL(basename));
++ return 0;
++}
++
++int mutt_put_file_in_place (const char *path, const char *safe_file, const char *safe_dir)
++{
++ int rv;
++
++ rv = safe_rename (safe_file, path);
++ unlink (safe_file);
++ rmdir (safe_dir);
++ return rv;
++}
++
+ int safe_open (const char *path, int flags)
+ {
+ struct stat osb, nsb;
+ int fd;
+
++ if (flags & O_EXCL)
++ {
++ char safe_file[_POSIX_PATH_MAX];
++ char safe_dir[_POSIX_PATH_MAX];
++
++ if (mutt_mkwrapdir (path, safe_file, sizeof (safe_file),
++ safe_dir, sizeof (safe_dir)) == -1)
++ return -1;
++
++ if ((fd = open (safe_file, flags, 0600)) < 0)
++ {
++ rmdir (safe_dir);
++ return fd;
++ }
++
++ if (mutt_put_file_in_place (path, safe_file, safe_dir) == -1)
++ {
++ close (fd);
++ return -1;
++ }
++ }
++ else
++ {
+ if ((fd = open (path, flags, 0600)) < 0)
+ return fd;
++ }
+
+ /* make sure the file is not symlink */
+ if (lstat (path, &osb) < 0 || fstat (fd, &nsb) < 0 ||