diff options
author | Amadeusz Piotr Żołnowski <aidecoe@gentoo.org> | 2012-02-29 07:41:24 +0000 |
---|---|---|
committer | Amadeusz Piotr Żołnowski <aidecoe@gentoo.org> | 2012-02-29 07:41:24 +0000 |
commit | 64f38ca3c18065a2b55ee3ecaf80c1e07e451830 (patch) | |
tree | 15de1dcf80e0bc78729ddeb69ec0694cbb1d7322 /net-mail | |
parent | net-mail/notmuch: Depend on >=glib-2.22. (diff) | |
download | gentoo-2-64f38ca3c18065a2b55ee3ecaf80c1e07e451830.tar.gz gentoo-2-64f38ca3c18065a2b55ee3ecaf80c1e07e451830.tar.bz2 gentoo-2-64f38ca3c18065a2b55ee3ecaf80c1e07e451830.zip |
net-mail/notmuch-0.10.2: Fixes bug #406175 and bug #406177.
Fixes bug #406175 (security fix for Emacs UI) and bug #406177 (Python bindings
tests used to fail). I have backported patches from 0.11.1 and 0.11 releases.
(Portage version: 2.1.10.48/cvs/Linux x86_64)
Diffstat (limited to 'net-mail')
-rw-r--r-- | net-mail/notmuch/ChangeLog | 12 | ||||
-rw-r--r-- | net-mail/notmuch/files/0.10.2-emacsui-mml-tags-quoting-fix.patch | 56 | ||||
-rw-r--r-- | net-mail/notmuch/files/0.10.2-emacsui-mml-tags-quoting-test.patch | 49 | ||||
-rw-r--r-- | net-mail/notmuch/files/0.10.2-lib-call-g_mime_init-db-open.patch | 55 | ||||
-rw-r--r-- | net-mail/notmuch/notmuch-0.10.2-r2.ebuild | 129 |
5 files changed, 300 insertions, 1 deletions
diff --git a/net-mail/notmuch/ChangeLog b/net-mail/notmuch/ChangeLog index 9e15bac62fff..6283064bc0f6 100644 --- a/net-mail/notmuch/ChangeLog +++ b/net-mail/notmuch/ChangeLog @@ -1,6 +1,16 @@ # ChangeLog for net-mail/notmuch # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-mail/notmuch/ChangeLog,v 1.27 2012/02/29 07:36:13 aidecoe Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-mail/notmuch/ChangeLog,v 1.28 2012/02/29 07:41:23 aidecoe Exp $ + +*notmuch-0.10.2-r2 (29 Feb 2012) + + 29 Feb 2012; Amadeusz Żołnowski <aidecoe@gentoo.org> + +files/0.10.2-emacsui-mml-tags-quoting-fix.patch, + +files/0.10.2-emacsui-mml-tags-quoting-test.patch, + +files/0.10.2-lib-call-g_mime_init-db-open.patch, +notmuch-0.10.2-r2.ebuild: + Fixes bug #406175 (security fix for Emacs UI) and bug #406177 (Python + bindings tests used to fail). I have backported patches from 0.11.1 and 0.11 + releases. 28 Feb 2012; Amadeusz Żołnowski <aidecoe@gentoo.org> notmuch-0.10.2.ebuild, notmuch-0.10.2-r1.ebuild, notmuch-0.11.1-r1.ebuild, notmuch-0.11.1-r2.ebuild: diff --git a/net-mail/notmuch/files/0.10.2-emacsui-mml-tags-quoting-fix.patch b/net-mail/notmuch/files/0.10.2-emacsui-mml-tags-quoting-fix.patch new file mode 100644 index 000000000000..e6d8099f8d4e --- /dev/null +++ b/net-mail/notmuch/files/0.10.2-emacsui-mml-tags-quoting-fix.patch @@ -0,0 +1,56 @@ +From 52a5f9e1756a5f69570bf694fe3e384cbef84eb9 Mon Sep 17 00:00:00 2001 +From: Aaron Ecay <aaronecay@gmail.com> +Date: Fri, 3 Feb 2012 11:24:08 +0100 +Subject: [PATCH 2/4] emacs: quote MML tags in replies +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Emacs message-mode uses certain text strings to indicate how to attach +files to outgoing mail. If these are present in the text of an email, +and a user is tricked into replying to the message, the user’s files +could be exposed. + +Edited-by: Pieter Praet <pieter@praet.org>: Rebased to release branch. + +Conflicts: + + NEWS +--- + emacs/notmuch-mua.el | 7 ++++++- + test/emacs | 1 - + 2 files changed, 6 insertions(+), 2 deletions(-) + +diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el +index 8824b08..a123c71 100644 +--- a/emacs/notmuch-mua.el ++++ b/emacs/notmuch-mua.el +@@ -109,7 +109,12 @@ list." + (insert body)) + (set-buffer-modified-p nil) + +- (message-goto-body)) ++ (message-goto-body) ++ ;; Original message may contain (malicious) MML tags. We must ++ ;; properly quote them in the reply. Note that using `point-max' ++ ;; instead of `mark' here is wrong. The buffer may include user's ++ ;; signature which should not be MML-quoted. ++ (mml-quote-region (point) (point-max))) + + (defun notmuch-mua-forward-message () + (message-forward) +diff --git a/test/emacs b/test/emacs +index a8f4be4..ad8941c 100755 +--- a/test/emacs ++++ b/test/emacs +@@ -253,7 +253,6 @@ EOF + test_expect_equal_file OUTPUT EXPECTED + + test_begin_subtest "Quote MML tags in reply" +-test_subtest_known_broken + message_id='test-emacs-mml-quoting@message.id' + add_message [id]="$message_id" \ + "[subject]='$test_subtest_name'" \ +-- +1.7.8.4 + diff --git a/net-mail/notmuch/files/0.10.2-emacsui-mml-tags-quoting-test.patch b/net-mail/notmuch/files/0.10.2-emacsui-mml-tags-quoting-test.patch new file mode 100644 index 000000000000..b293814d1a9e --- /dev/null +++ b/net-mail/notmuch/files/0.10.2-emacsui-mml-tags-quoting-test.patch @@ -0,0 +1,49 @@ +From 1c34ca30118ee8c7fb08228bfb211ff1a7f4f260 Mon Sep 17 00:00:00 2001 +From: Aaron Ecay <aaronecay@gmail.com> +Date: Fri, 3 Feb 2012 11:24:07 +0100 +Subject: [PATCH 1/4] test: add tests for quoting of MML tags in replies + +The test is broken at this time; the next commit will introduce a fix. + +Edited-by: Pieter Praet <pieter@praet.org>: + Rebased to release branch, moved expected output into the actual test, + and fixed "Fcc:" line. +--- + test/emacs | 21 +++++++++++++++++++++ + 1 files changed, 21 insertions(+), 0 deletions(-) + +diff --git a/test/emacs b/test/emacs +index 75a0a74..a8f4be4 100755 +--- a/test/emacs ++++ b/test/emacs +@@ -252,6 +252,27 @@ On 01 Jan 2000 12:00:00 -0000, Notmuch Test Suite <test_suite@notmuchmail.org> w + EOF + test_expect_equal_file OUTPUT EXPECTED + ++test_begin_subtest "Quote MML tags in reply" ++test_subtest_known_broken ++message_id='test-emacs-mml-quoting@message.id' ++add_message [id]="$message_id" \ ++ "[subject]='$test_subtest_name'" \ ++ '[body]="<#part disposition=inline>"' ++test_emacs "(notmuch-show \"id:$message_id\") ++ (notmuch-show-reply) ++ (test-output)" ++cat <<EOF >EXPECTED ++From: Notmuch Test Suite <test_suite@notmuchmail.org> ++To: ++Subject: Re: Quote MML tags in reply ++In-Reply-To: <test-emacs-mml-quoting@message.id> ++Fcc: ${MAIL_DIR}/sent ++--text follows this line-- ++On Tue, 05 Jan 2001 15:43:57 -0000, Notmuch Test Suite <test_suite@notmuchmail.org> wrote: ++> <#!part disposition=inline> ++EOF ++test_expect_equal_file OUTPUT EXPECTED ++ + test_begin_subtest "Save attachment from within emacs using notmuch-show-save-attachments" + # save as archive to test that Emacs does not re-compress .gz + test_emacs '(let ((standard-input "\"attachment1.gz\"")) +-- +1.7.8.4 + diff --git a/net-mail/notmuch/files/0.10.2-lib-call-g_mime_init-db-open.patch b/net-mail/notmuch/files/0.10.2-lib-call-g_mime_init-db-open.patch new file mode 100644 index 000000000000..7521e39b0358 --- /dev/null +++ b/net-mail/notmuch/files/0.10.2-lib-call-g_mime_init-db-open.patch @@ -0,0 +1,55 @@ +From 5f4dad1b12e224f06576e5ed9e71b3f9f16a13f1 Mon Sep 17 00:00:00 2001 +From: Kazuo Teramoto <kaz.rag@gmail.com> +Date: Sat, 31 Dec 2011 02:37:41 -0200 +Subject: [PATCH 3/3] lib: call g_mime_init() from notmuch_database_open() + +As reported in +id:"CAEbOPGyuHnz4BPtDutnTPUHcP3eYcRCRkXhYoJR43RUMw671+g@mail.gmail.com" +sometimes gmime tries to access a NULL pointer, e.g. g_mime_iconv_open() +tries to access iconv_cache that is NULL if g_mime_init() is not called. +This causes notmuch to segfault when calling gmime functions. + +Calling g_mime_init() initializes iconv_cache and others variables needed +by gmime, making sure they are initialized when notmuch calls gmime +functions. +--- + lib/database.cc | 9 +++++++++ + 1 files changed, 9 insertions(+), 0 deletions(-) + +diff --git a/lib/database.cc b/lib/database.cc +index 98f101e..df6c8d0 100644 +--- a/lib/database.cc ++++ b/lib/database.cc +@@ -28,6 +28,8 @@ + #include <glib.h> /* g_free, GPtrArray, GHashTable */ + #include <glib-object.h> /* g_type_init */ + ++#include <gmime/gmime.h> /* g_mime_init */ ++ + using namespace std; + + #define ARRAY_SIZE(arr) (sizeof (arr) / sizeof (arr[0])) +@@ -581,6 +583,7 @@ notmuch_database_open (const char *path, + struct stat st; + int err; + unsigned int i, version; ++ static int initialized = 0; + + if (asprintf (¬much_path, "%s/%s", path, ".notmuch") == -1) { + notmuch_path = NULL; +@@ -604,6 +607,12 @@ notmuch_database_open (const char *path, + /* Initialize the GLib type system and threads */ + g_type_init (); + ++ /* Initialize gmime */ ++ if (! initialized) { ++ g_mime_init (0); ++ initialized = 1; ++ } ++ + notmuch = talloc (NULL, notmuch_database_t); + notmuch->exception_reported = FALSE; + notmuch->path = talloc_strdup (notmuch, path); +-- +1.7.8.4 + diff --git a/net-mail/notmuch/notmuch-0.10.2-r2.ebuild b/net-mail/notmuch/notmuch-0.10.2-r2.ebuild new file mode 100644 index 000000000000..7ed4b01fd586 --- /dev/null +++ b/net-mail/notmuch/notmuch-0.10.2-r2.ebuild @@ -0,0 +1,129 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-mail/notmuch/notmuch-0.10.2-r2.ebuild,v 1.1 2012/02/29 07:41:23 aidecoe Exp $ + +EAPI=4 + +PYTHON_DEPEND="python? 2:2.6" +SUPPORT_PYTHON_ABIS="1" +RESTRICT_PYTHON_ABIS="2.[45] 3.*" + +inherit elisp-common distutils +inherit autotools-utils + +DESCRIPTION="The mail indexer" +HOMEPAGE="http://notmuchmail.org/" +SRC_URI="${HOMEPAGE}/releases/${P}.tar.gz" + +LICENSE="GPL-3" +SLOT="0" +KEYWORDS="~amd64 ~x86" +REQUIRED_USE="test? ( crypt emacs )" +IUSE="bash-completion crypt debug doc emacs python test vim zsh-completion" + +CDEPEND=" + >=dev-libs/glib-2.22 + dev-libs/gmime:2.4 + dev-libs/xapian + doc? ( python? ( dev-python/sphinx ) ) + sys-libs/talloc + debug? ( dev-util/valgrind ) + emacs? ( >=virtual/emacs-23 ) + x86? ( >=dev-libs/xapian-1.2.7-r2 ) + vim? ( || ( >=app-editors/vim-7.0 >=app-editors/gvim-7.0 ) ) + " +DEPEND="${CDEPEND} + dev-util/pkgconfig + test? ( app-misc/dtach sys-devel/gdb ) + " +RDEPEND="${CDEPEND} + crypt? ( app-crypt/gnupg ) + zsh-completion? ( app-shells/zsh ) + " + +PATCHES=( + "${FILESDIR}/${PV}-fix-test-build.patch" + "${FILESDIR}/${PV}-emacsui-mml-tags-quoting-test.patch" + "${FILESDIR}/${PV}-emacsui-mml-tags-quoting-fix.patch" + "${FILESDIR}/${PV}-lib-call-g_mime_init-db-open.patch" + ) +DOCS=( AUTHORS NEWS README TODO ) +SITEFILE="50${PN}-gentoo.el" + +bindings() { + if use $1; then + pushd bindings/$1 || die + shift + $@ + popd || die + fi +} + +pkg_setup() { + if use emacs; then + elisp-need-emacs 23 || die "Emacs version too low" + fi + use python && python_pkg_setup +} + +src_prepare() { + autotools-utils_src_prepare + bindings python distutils_src_prepare +} + +src_configure() { + local myeconfargs=( + --bashcompletiondir="${ROOT}/usr/share/bash-completion" + --emacslispdir="${ROOT}/${SITELISP}/${PN}" + --emacsetcdir="${ROOT}/${SITEETC}/${PN}" + --zshcompletiondir="${ROOT}/usr/share/zsh/site-functions" + $(use_with bash-completion) + $(use_with emacs) + $(use_with zsh-completion) + ) + autotools-utils_src_configure +} + +src_compile() { + autotools-utils_src_compile + bindings python distutils_src_compile + + if use doc; then + pydocs() { + pushd docs || die + emake html + mv html ../python || die + popd || die + } + LD_LIBRARY_PATH="${WORKDIR}/${PF}_build/lib" bindings python pydocs + fi +} + +src_install() { + autotools-utils_src_install + + if use emacs; then + elisp-site-file-install "${FILESDIR}/${SITEFILE}" || die + fi + + if use vim; then + insinto /usr/share/vim/vimfiles + doins -r vim/plugin vim/syntax + fi + + DOCS="" bindings python distutils_src_install + + if use doc; then + bindings python dohtml -r python + fi +} + +pkg_postinst() { + use emacs && elisp-site-regen + use python && distutils_pkg_postinst +} + +pkg_postrm() { + use emacs && elisp-site-regen + use python && distutils_pkg_postrm +} |