diff options
| author | David Bremner <bremner@debian.org> | 2012-02-15 19:17:36 -0400 |
|---|---|---|
| committer | David Bremner <bremner@debian.org> | 2012-02-15 19:17:36 -0400 |
| commit | 242beef7fb76fb780479cbfe84df0def935c322c (patch) | |
| tree | 2ecb242ae0c3f1575253f3cba306513d587b2103 | |
| parent | 3cde7cf7cf3e01312992cc1aece7306e68b09b5d (diff) | |
| parent | f38bc44653ad910abb95add6b09321da11f50581 (diff) | |
Merge tag 'debian/0.11.1-1' into squeeze-backports
notmuch Debian 0.11.1-1 upload (same as 0.11.1)
Conflicts:
debian/changelog
| -rw-r--r-- | NEWS | 25 | ||||
| -rw-r--r-- | bindings/python/notmuch/database.py | 16 | ||||
| -rw-r--r-- | bindings/python/notmuch/filename.py | 2 | ||||
| -rw-r--r-- | bindings/python/notmuch/message.py | 6 | ||||
| -rw-r--r-- | bindings/python/notmuch/tag.py | 2 | ||||
| -rw-r--r-- | bindings/python/notmuch/thread.py | 6 | ||||
| -rw-r--r-- | bindings/python/notmuch/version.py | 2 | ||||
| -rw-r--r-- | debian/changelog | 8 | ||||
| -rw-r--r-- | emacs/notmuch-mua.el | 7 | ||||
| -rw-r--r-- | notmuch.1 | 2 | ||||
| -rwxr-xr-x | test/emacs | 20 | ||||
| -rw-r--r-- | version | 2 |
12 files changed, 78 insertions, 20 deletions
@@ -1,3 +1,28 @@ +Notmuch 0.11.1 (2012-02-03) +=========================== + +Bug-fix release. +---------------- + +Fix error handling in python bindings. + + The python bindings in 0.11 failed to detect NULL pointers being + returned from libnotmuch functions and thus failed to raise + exceptions to indicate the error condition. Any subsequent calls + into libnotmuch caused segmentation faults. + +Quote MML tags in replies + + MML tags are text codes that Emacs uses to indicate attachments + (among other things) in messages being composed. The Emacs + interface did not quote MML tags in the quoted text of a reply. + User could be tricked into replying to a maliciously formatted + message and not editing out the MML tags from the quoted text. This + could lead to files from the user's machine being attached to the + outgoing message. The Emacs interface now quotes these tags in + reply text, so that they do not effect outgoing messages. + + Notmuch 0.11 (2012-01-13) ========================= diff --git a/bindings/python/notmuch/database.py b/bindings/python/notmuch/database.py index 7923f768..0074ba36 100644 --- a/bindings/python/notmuch/database.py +++ b/bindings/python/notmuch/database.py @@ -168,7 +168,7 @@ class Database(object): res = Database._create(_str(path), Database.MODE.READ_WRITE) - if res is None: + if not res: raise NotmuchError( message="Could not create the specified database") self._db = res @@ -188,7 +188,7 @@ class Database(object): """ res = Database._open(_str(path), mode) - if res is None: + if not res: raise NotmuchError(message="Could not open the specified database") self._db = res @@ -645,7 +645,7 @@ class Query(object): self._db = db # create query, return None if too little mem available query_p = Query._create(db.db_p, _str(querystr)) - if query_p is None: + if not query_p: raise NullPointerError self._query = query_p @@ -679,7 +679,7 @@ class Query(object): self._assert_query_is_initialized() threads_p = Query._search_threads(self._query) - if threads_p is None: + if not threads_p: raise NullPointerError return Threads(threads_p, self) @@ -693,7 +693,7 @@ class Query(object): self._assert_query_is_initialized() msgs_p = Query._search_messages(self._query) - if msgs_p is None: + if not msgs_p: raise NullPointerError return Messages(msgs_p, self) @@ -759,7 +759,7 @@ class Directory(object): def _assert_dir_is_initialized(self): """Raises a NotmuchError(:attr:`STATUS`.NOT_INITIALIZED) if dir_p is None""" - if self._dir_p is None: + if not self._dir_p: raise NotmuchError(STATUS.NOT_INITIALIZED) def __init__(self, path, dir_p, parent): @@ -920,7 +920,7 @@ class Filenames(object): _move_to_next.restype = None def next(self): - if self._files_p is None: + if not self._files_p: raise NotmuchError(STATUS.NOT_INITIALIZED) if not self._valid(self._files_p): @@ -946,7 +946,7 @@ class Filenames(object): # NotmuchError(:attr:`STATUS`.NOT_INITIALIZED) for file in files: print file """ - if self._files_p is None: + if not self._files_p: raise NotmuchError(STATUS.NOT_INITIALIZED) i = 0 diff --git a/bindings/python/notmuch/filename.py b/bindings/python/notmuch/filename.py index a7cd7e63..f7313ec5 100644 --- a/bindings/python/notmuch/filename.py +++ b/bindings/python/notmuch/filename.py @@ -69,7 +69,7 @@ class Filenames(object): reference to it, so we can automatically delete the db object once all derived objects are dead. """ - if files_p is None: + if not files_p: raise NotmuchError(STATUS.NULL_POINTER) self._files = files_p diff --git a/bindings/python/notmuch/message.py b/bindings/python/notmuch/message.py index ce8e7181..5540df3e 100644 --- a/bindings/python/notmuch/message.py +++ b/bindings/python/notmuch/message.py @@ -116,7 +116,7 @@ class Messages(object): :TODO: Make the iterator work more than once and cache the tags in the Python object.(?) """ - if msgs_p is None: + if not msgs_p: raise NotmuchError(STATUS.NULL_POINTER) self._msgs = msgs_p @@ -321,7 +321,7 @@ class Message(object): automatically delete the parent object once all derived objects are dead. """ - if msg_p is None: + if not msg_p: raise NotmuchError(STATUS.NULL_POINTER) self._msg = msg_p #keep reference to parent, so we keep it alive @@ -380,7 +380,7 @@ class Message(object): msgs_p = Message._get_replies(self._msg) - if msgs_p is None: + if not msgs_p: return None return Messages(msgs_p, self) diff --git a/bindings/python/notmuch/tag.py b/bindings/python/notmuch/tag.py index 2fb7d328..4881db9f 100644 --- a/bindings/python/notmuch/tag.py +++ b/bindings/python/notmuch/tag.py @@ -70,7 +70,7 @@ class Tags(object): :TODO: Make the iterator optionally work more than once by cache the tags in the Python object(?) """ - if tags_p is None: + if not tags_p: raise NotmuchError(STATUS.NULL_POINTER) self._tags = tags_p diff --git a/bindings/python/notmuch/thread.py b/bindings/python/notmuch/thread.py index 5058846d..594fa522 100644 --- a/bindings/python/notmuch/thread.py +++ b/bindings/python/notmuch/thread.py @@ -97,7 +97,7 @@ class Threads(object): :TODO: Make the iterator work more than once and cache the tags in the Python object.(?) """ - if threads_p is None: + if not threads_p: raise NotmuchError(STATUS.NULL_POINTER) self._threads = threads_p @@ -227,7 +227,7 @@ class Thread(object): automatically delete the parent object once all derived objects are dead. """ - if thread_p is None: + if not thread_p: raise NotmuchError(STATUS.NULL_POINTER) self._thread = thread_p #keep reference to parent, so we keep it alive @@ -288,7 +288,7 @@ class Thread(object): msgs_p = Thread._get_toplevel_messages(self._thread) - if msgs_p is None: + if not msgs_p: raise NotmuchError(STATUS.NULL_POINTER) return Messages(msgs_p, self) diff --git a/bindings/python/notmuch/version.py b/bindings/python/notmuch/version.py index 59c396fe..ed40e7f8 100644 --- a/bindings/python/notmuch/version.py +++ b/bindings/python/notmuch/version.py @@ -1,2 +1,2 @@ # this file should be kept in sync with ../../../version -__VERSION__ = '0.11' +__VERSION__ = '0.11.1' diff --git a/debian/changelog b/debian/changelog index d954e8a2..e82e4dce 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +notmuch (0.11.1-1) unstable; urgency=low + + * Upstream bugfix release + - Fix error handling bug in python bindings + - Fix vulnerability in emacs reply handling + + -- David Bremner <bremner@debian.org> Fri, 03 Feb 2012 08:35:41 -0400 + notmuch (0.11-1~bpo60+1) squeeze-backports; urgency=low * Rebuild for squeeze-backports. diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el index 7114e48a..3e93d7c8 100644 --- a/emacs/notmuch-mua.el +++ b/emacs/notmuch-mua.el @@ -111,7 +111,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) @@ -16,7 +16,7 @@ .\" along with this program. If not, see http://www.gnu.org/licenses/ . .\" .\" Author: Carl Worth <cworth@cworth.org> -.TH NOTMUCH 1 2012-01-13 "Notmuch 0.11" +.TH NOTMUCH 1 2012-02-03 "Notmuch 0.11.1" .SH NAME notmuch \- thread-based email index, search, and tagging .SH SYNOPSIS @@ -273,6 +273,26 @@ 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" +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 +1 @@ -0.11 +0.11.1 |
