From efe3b17b4651f0164ab40c2bca9d6cafc87fbd19 Mon Sep 17 00:00:00 2001 From: Tomi Ollila Date: Fri, 20 Feb 2015 11:25:13 +0200 Subject: [PATCH] Re: bug report: Emacs notmuch-mode fails attachments with spaces --- fc/4158495e77b5445facd0147322e32d1fd73b80 | 99 +++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 fc/4158495e77b5445facd0147322e32d1fd73b80 diff --git a/fc/4158495e77b5445facd0147322e32d1fd73b80 b/fc/4158495e77b5445facd0147322e32d1fd73b80 new file mode 100644 index 000000000..eda52480e --- /dev/null +++ b/fc/4158495e77b5445facd0147322e32d1fd73b80 @@ -0,0 +1,99 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 8312B431FD6 + for ; Fri, 20 Feb 2015 01:36:35 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 2.438 +X-Spam-Level: ** +X-Spam-Status: No, score=2.438 tagged_above=-999 required=5 + tests=[DNS_FROM_AHBL_RHSBL=2.438] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id UO0Igk1d6aJK for ; + Fri, 20 Feb 2015 01:36:32 -0800 (PST) +Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) + by olra.theworths.org (Postfix) with ESMTP id 390B6431FC9 + for ; Fri, 20 Feb 2015 01:36:32 -0800 (PST) +Received: from guru.guru-group.fi (localhost [IPv6:::1]) + by guru.guru-group.fi (Postfix) with ESMTP id AD21E100090; + Fri, 20 Feb 2015 11:25:13 +0200 (EET) +From: Tomi Ollila +To: Nils Dagsson Moskopp , + notmuch@notmuchmail.org +Subject: Re: bug report: Emacs notmuch-mode fails attachments with spaces +In-Reply-To: +References: <87twyurc78.fsf@dieweltistgarnichtso.net> + + <8761b9pu11.fsf@dieweltistgarnichtso.net> + +User-Agent: Notmuch/0.19+53~gb45d2f9 (http://notmuchmail.org) Emacs/24.3.1 + (x86_64-unknown-linux-gnu) +X-Face: HhBM'cA~ +MIME-Version: 1.0 +Content-Type: text/plain +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Fri, 20 Feb 2015 09:36:35 -0000 + +On Wed, Feb 11 2015, Tomi Ollila wrote: + +> On Tue, Feb 10 2015, Nils Dagsson Moskopp wrote: +> +>> Tomi Ollila writes: + +>> It seems to me that all of the following are true in this case: +>> +>> 1. Emacs executes the user's default shell to start zathura. +> +> That's stupid! it should run /bin/sh. +> +> I looked into emacs-23.1/lisp/gnus/mm-decode.el and while I could not +> pinpoint the exact location where this shell command was invoked, I +> found some similar code where emacs variable `shell-file-name` was used +> (M-x describe-variable shell-file-name returns "/bin/zsh" for me). +> +> So, you could just test by (setq shell-file-name "/bin/sh") (or +> just M-x set-variable shell-file-name /bin/sh in live emacs) and then +> test whether those pdf:s open right. +> +> we cannot do much how (mm in) emacs escapes those variables (and why it +> uses shell to execute that command line)... + +... but we could let-bind shell-file-name... + +> +> Tomi +> +>> +>> 2. For this, Emacs escapes the filename. +>> +>> 3. Emacs applies the wrong escaping to the filename. Note that single +>> quotes are interoperable between shells, while backslashes are not. +>> +>> 4. The rc(1) shell splits on spaces, as it knows no backslash escaping. +>> +>> 5. The shell executes zathura with three arguments, all bogus filenames. +>> +>> I cannot pinpoint where all this is happening, but I would suggest to +>> just execve() zathura with a single unescaped filename as its argument. +>> +>> Greetings, +>> -- +>> Nils Dagsson Moskopp // erlehmann -- 2.26.2