summaryrefslogtreecommitdiffstats
path: root/patches/source/mutt
diff options
context:
space:
mode:
Diffstat (limited to 'patches/source/mutt')
-rw-r--r--patches/source/mutt/doinst.sh13
-rw-r--r--patches/source/mutt/mutt.CVE-2014-9116.diff34
-rwxr-xr-xpatches/source/mutt/mutt.SlackBuild128
-rw-r--r--patches/source/mutt/slack-desc19
4 files changed, 194 insertions, 0 deletions
diff --git a/patches/source/mutt/doinst.sh b/patches/source/mutt/doinst.sh
new file mode 100644
index 00000000..830fa245
--- /dev/null
+++ b/patches/source/mutt/doinst.sh
@@ -0,0 +1,13 @@
+config() {
+ NEW="$1"
+ OLD="`dirname $NEW`/`basename $NEW .new`"
+ # If there's no config file by that name, mv it over:
+ if [ ! -r $OLD ]; then
+ mv $NEW $OLD
+ elif [ "`cat $OLD | md5sum`" = "`cat $NEW | md5sum`" ]; then # toss the redundant copy
+ rm $NEW
+ fi
+ # Otherwise, we leave the .new copy for the admin to consider...
+}
+
+config etc/mutt/Muttrc.new
diff --git a/patches/source/mutt/mutt.CVE-2014-9116.diff b/patches/source/mutt/mutt.CVE-2014-9116.diff
new file mode 100644
index 00000000..97f6fd81
--- /dev/null
+++ b/patches/source/mutt/mutt.CVE-2014-9116.diff
@@ -0,0 +1,34 @@
+# HG changeset patch
+# User Kevin McCarthy <kevin@8t8.us>
+# Date 1417472364 28800
+# Node ID 0aebf1df43598b442ac75ae4fe17875351854db0
+# Parent 5a86319adad0d17e4acaf8a580bfc9eb247547d0
+Revert write_one_header() to skip space and tab. (closes #3716)
+
+This patch fixes CVE-2014-9116 in the stable branch. It reverts
+write_one_header() to the pre [f251d523ca5a] code for skipping
+whitespace.
+
+Thanks to Antonio Radici and Tomas Hoger for their analysis and patches
+to mutt, which this patch is based off of.
+
+diff -r 5a86319adad0 -r 0aebf1df4359 sendlib.c
+--- a/sendlib.c Mon Jan 05 18:28:59 2015 -0800
++++ b/sendlib.c Mon Dec 01 14:19:24 2014 -0800
+@@ -1814,7 +1814,14 @@
+ {
+ tagbuf = mutt_substrdup (start, t);
+ /* skip over the colon separating the header field name and value */
+- t = skip_email_wsp(t + 1);
++ ++t;
++
++ /* skip over any leading whitespace (WSP, as defined in RFC5322)
++ * NOTE: skip_email_wsp() does the wrong thing here.
++ * See tickets 3609 and 3716. */
++ while (*t == ' ' || *t == '\t')
++ t++;
++
+ valbuf = mutt_substrdup (t, end);
+ }
+ dprint(4,(debugfile,"mwoh: buf[%s%s] too long, "
+
diff --git a/patches/source/mutt/mutt.SlackBuild b/patches/source/mutt/mutt.SlackBuild
new file mode 100755
index 00000000..ae00d580
--- /dev/null
+++ b/patches/source/mutt/mutt.SlackBuild
@@ -0,0 +1,128 @@
+#!/bin/sh
+# Copyright 2002-2015 Patrick J. Volkerding, Sebeka, Minnesota, USA
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+PKGNAM=mutt
+VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
+BUILD=${BUILD:-2_slack14.1}
+
+# Automatically determine the architecture we're building on:
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) export ARCH=i486 ;;
+ arm*) export ARCH=arm ;;
+ # Unless $ARCH is already set, use uname -m for all other archs:
+ *) export ARCH=$( uname -m ) ;;
+ esac
+fi
+
+TMP=${TMP:-/tmp}
+CWD=`pwd`
+NUMJOBS=${NUMJOBS:-" -j7 "}
+
+if [ "$ARCH" = "i386" ]; then
+ SLKCFLAGS="-O2 -march=i386 -mcpu=i686"
+elif [ "$ARCH" = "i486" ]; then
+ SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+elif [ "$ARCH" = "s390" ]; then
+ SLKCFLAGS="-O2"
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+else
+ SLKCFLAGS="-O2"
+fi
+
+PKG=$TMP/package-mutt
+rm -rf $PKG
+mkdir $PKG
+cd $TMP
+rm -rf mutt-$VERSION
+tar xvf $CWD/mutt-$VERSION.tar.?z* || exit 1
+cd mutt-$VERSION || exit 1
+chown -R root:root .
+
+zcat $CWD/mutt.CVE-2014-9116.diff.gz | patch -p1 --verbose || exit 1
+
+CFLAGS="$SLKCFLAGS" \
+./configure \
+ --prefix=/usr \
+ --mandir=/usr/man \
+ --docdir=/usr/doc/mutt-$VERSION \
+ --with-docdir=/usr/doc/mutt-$VERSION \
+ --sysconfdir=/etc/mutt \
+ --with-mailpath=/var/spool/mail \
+ --enable-pop \
+ --enable-imap \
+ --with-ssl \
+ --with-sasl \
+ --enable-smtp \
+ --enable-gpgme \
+ --enable-hcache \
+ --build=$ARCH-slackware-linux
+
+make $NUMJOBS || make || exit 1
+make install DESTDIR=$PKG || exit 1
+
+# Strip binaries:
+( cd $PKG
+ find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
+ find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
+)
+
+# Compress and link manpages, if any:
+if [ -d $PKG/usr/man ]; then
+ ( cd $PKG/usr/man
+ for manpagedir in $(find . -type d -name "man*") ; do
+ ( cd $manpagedir
+ for eachpage in $( find . -type l -maxdepth 1) ; do
+ ln -s $( readlink $eachpage ).gz $eachpage.gz
+ rm $eachpage
+ done
+ gzip -9 *.?
+ )
+ done
+ )
+fi
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh
+
+# This stuff is redundant or not useful to most people, IMHO.
+# If you want it, use the source, Luke.
+rm -f $PKG/usr/doc/mutt-$VERSION/*.html
+rm -f $PKG/etc/mutt/*.dist
+
+# This is an ancient artifact
+rm -f $PKG/usr/doc/mutt-$VERSION/samples/ca-bundle.crt
+
+# If there's a ChangeLog, installing at least part of the recent history
+# is useful, but don't let it get totally out of control:
+if [ -r ChangeLog ]; then
+ DOCSDIR=$(echo $PKG/usr/doc/${PKGNAM}-$VERSION)
+ cat ChangeLog | head -n 1000 > $DOCSDIR/ChangeLog
+ touch -r ChangeLog $DOCSDIR/ChangeLog
+fi
+
+mv $PKG/etc/mutt/Muttrc $PKG/etc/mutt/Muttrc.new
+
+cd $PKG
+/sbin/makepkg -l y -c n ../mutt-$VERSION-$ARCH-$BUILD.txz
+
diff --git a/patches/source/mutt/slack-desc b/patches/source/mutt/slack-desc
new file mode 100644
index 00000000..eda6d811
--- /dev/null
+++ b/patches/source/mutt/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description. Line
+# up the first '|' above the ':' following the base package name, and the '|' on
+# the right side marks the last column you can put a character in. You must make
+# exactly 11 lines for the formatting to be correct. It's also customary to
+# leave one space after the ':'.
+
+ |-----handy-ruler------------------------------------------------------|
+mutt: Mutt (the Mutt mail user agent)
+mutt:
+mutt: Mutt is a small but very powerful text-based MIME mail client. Mutt
+mutt: is highly configurable, and is well suited to the mail power user with
+mutt: advanced features like key bindings, keyboard macros, mail threading,
+mutt: regular expression searches and a powerful pattern matching language
+mutt: for selecting groups of messages.
+mutt:
+mutt:
+mutt:
+mutt: