From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 224C66DE02C3 for ; Fri, 16 Sep 2016 12:36:32 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.363 X-Spam-Level: X-Spam-Status: No, score=-0.363 tagged_above=-999 required=5 tests=[AWL=0.207, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fJ6HXY3Rv_jd for ; Fri, 16 Sep 2016 12:36:31 -0700 (PDT) Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by arlo.cworth.org (Postfix) with ESMTPS id 911CB6DE02B7 for ; Fri, 16 Sep 2016 12:36:30 -0700 (PDT) Received: by mail-wm0-f67.google.com with SMTP id b187so5136987wme.0 for ; Fri, 16 Sep 2016 12:36:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:in-reply-to:references:user-agent:date:message-id :mime-version; bh=a76AGjWb8brTxYTAJuxejfUA3wyInWyTzS2AErWvvOo=; b=SqcBnPua81v4mmHbgXXRL/6iONQ1zLT/NI0lUHixns2sby8DuX5qGl9HdrB2UJgLJ2 a2Yo/1Mono7GPtUa9BuFyf+7BRiCxb3yEfruyiz4acoflxRW5uGP3VmO/2yuQPnQ2izC 3fgAt9st443IAUJkhJgbeIioCHf14dUkmkhQlMm6N98TUN0xONy954iv5HBx7gaySAPW 3ZM4ez7cRj+DDPdd7yyM7iAMl4a+aN6+XRjDvyQFDz0+DzhA3WfdFS6bb5KJQU77tShe jah5Y+yF7z2Dek92SQU3lCVFSHNcqfjq2c/nse2Asb5oRRUw1C0NHL+7GuNWIax0LMr0 RK1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:in-reply-to:references :user-agent:date:message-id:mime-version; bh=a76AGjWb8brTxYTAJuxejfUA3wyInWyTzS2AErWvvOo=; b=h7+Zbkjy9U7cABmPE/8myBhOc6oHzQzDuCAAevEVxX+cq1EmiLRUbYATsAkjLi/r8N PfFP7jGdxK18sUiiMx9ywmLoPMPAavpP2sFHyhCF6bAjkLI4X5qpAV1wMI+qpmFiG6dS zLm6+4GlBD3+EY2hmrGBSkRM+YVD+frwnOYAvjNvWf8hpPlgqaIwlO0wppn4mG2CGcOO KGBioSFgtzV7pYjZLabkHiuEoAiu4M5S2SUidJKKg4+kkew3Imwsx+/zYbfE15lg9W3v mU0AzDt/dmngsv2WF5+wgiInVj338AYbcZ4DV1Z22tyIOuzTIzdNXt496/jYoEMfW20Y PzBg== X-Gm-Message-State: AE9vXwPOualfzIRutzgi52Rli607jPHeoV8illak2GGDpfCUMzFmceAaWgd79OUNNjAuyQ== X-Received: by 10.28.197.76 with SMTP id v73mr9319841wmf.100.1474054589192; Fri, 16 Sep 2016 12:36:29 -0700 (PDT) Received: from localhost (5751dfa2.skybroadband.com. [87.81.223.162]) by smtp.gmail.com with ESMTPSA id l3sm9790869wjp.17.2016.09.16.12.36.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Sep 2016 12:36:28 -0700 (PDT) From: Mark Walters To: Matt Armstrong , notmuch@notmuchmail.org, Tomi Ollila Subject: Re: [PATCH] emacs: notmuch-show: remove extraneous shell quoting In-Reply-To: References: <1473834053-17591-1-git-send-email-marmstrong@google.com> User-Agent: Notmuch/0.18.1+485~gca076ce (https://notmuchmail.org) Emacs/24.4.1 (x86_64-pc-linux-gnu) Date: Fri, 16 Sep 2016 20:36:27 +0100 Message-ID: <87lgyrbps4.fsf@qmul.ac.uk> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.22 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, 16 Sep 2016 19:36:32 -0000 Hi On Fri, 16 Sep 2016, Matt Armstrong wrote: > Tomi, thanks for your reply asking for some motivation behind this > patch. I can't reply directly to your message because, for some reason, > it doesn't appear in my mailbox (I discovered your message while reading > the mail archive on notmuchmail.org). > > The code dealing with this quoting issue was last touched in commit > b57d9635f50d5e9b53092218e81f6d2c391c363e, where Carl recognizes the > quoting is a bit of a hack and asks for a better fix. This is my > attempt. > > I am motivated by a concern for code health. I saw the quoting, did not > understand it, recognized it as probably wrong, investigated how the > quotes were actually passed from Emacs to the shell, and still believed > it wrong. > > I think this kind of flaw can be placed in the category of security fix. > Quoting issues often are. But, I'm not a security person. I think all the data being passed is generated by notmuch so I don't see a security issue. > By my reasoning, the rationale for the change is simple: > > a) It is the job of notmuch elisp to pass call-process the args in an > appropriate manner for notmuch-command (which is always a local > command). Because call-process takes a list of strings, and no shell is > involved, using shell quotes is wrong. It just so happens that Xapian > ignores the quotes, but taking advantage of that is not a great thing. > > b) If notmuch-command is doing something fancy, as is the case with the > "remote" script on https://notmuchmail.org/remoteusage/, it is the job > of that script to quote its own args properly for ssh. It looks like it > already does this. That one script does -- there are at least two others even on the wiki (see the links at the bottom of the above page) -- they also seem to be fine. But there could be other user scripts that do need the quoting. So the question is do we mind breaking a few currently working setups for the purpose of a mild cleanup. Since the current code is confusing I think a comment would be in order if we don't apply this patch. Best wishes Mark > So, the quoting is unnecessary on both accounts. > > > Matt Armstrong writes: > >> Remove shell quoting from notmuch-show--build-buffer. The args list >> is ultimately passed to call-process, which passes them verbatim to >> the subprocess (typically, notmuch). The quoting, intended for a >> shell, is unnecessary and confusing. > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > https://notmuchmail.org/mailman/listinfo/notmuch