Re: sanitization of args notmuch-cli in notmuch-emacs
[notmuch-archives.git] / bc / 0ec83630794a92a2c4effd005a898bd323eada
1 Return-Path: <tomi.ollila@iki.fi>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 25450429E2F\r
6         for <notmuch@notmuchmail.org>; Mon,  3 Feb 2014 12:37:09 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
12         autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id 8n2mu1HHpif8 for <notmuch@notmuchmail.org>;\r
16         Mon,  3 Feb 2014 12:36:41 -0800 (PST)\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
18         by olra.theworths.org (Postfix) with ESMTP id 7729B431FAF\r
19         for <notmuch@notmuchmail.org>; Mon,  3 Feb 2014 12:36:41 -0800 (PST)\r
20 Received: from guru.guru-group.fi (localhost [IPv6:::1])\r
21         by guru.guru-group.fi (Postfix) with ESMTP id 5AFC6100033;\r
22         Mon,  3 Feb 2014 22:36:32 +0200 (EET)\r
23 From: Tomi Ollila <tomi.ollila@iki.fi>\r
24 To: David Bremner <david@tethera.net>, notmuch@notmuchmail.org\r
25 Subject: Re: sanitization of args notmuch-cli in notmuch-emacs\r
26 In-Reply-To: <87wqhcxb5j.fsf@maritornes.cs.unb.ca>\r
27 References: <87wqhcxb5j.fsf@maritornes.cs.unb.ca>\r
28 User-Agent: Notmuch/0.17+55~g4397960 (http://notmuchmail.org) Emacs/24.3.1\r
29         (x86_64-unknown-linux-gnu)\r
30 X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
31         $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
32         !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
33 Date: Mon, 03 Feb 2014 22:36:30 +0200\r
34 Message-ID: <m2mwi8q6gh.fsf@guru.guru-group.fi>\r
35 MIME-Version: 1.0\r
36 Content-Type: text/plain; charset=utf-8\r
37 Content-Transfer-Encoding: quoted-printable\r
38 X-BeenThere: notmuch@notmuchmail.org\r
39 X-Mailman-Version: 2.1.13\r
40 Precedence: list\r
41 List-Id: "Use and development of the notmuch mail system."\r
42         <notmuch.notmuchmail.org>\r
43 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
44         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
45 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
46 List-Post: <mailto:notmuch@notmuchmail.org>\r
47 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
48 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
49         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
50 X-List-Received-Date: Mon, 03 Feb 2014 20:37:09 -0000\r
51 \r
52 On Mon, Feb 03 2014, David Bremner <david@tethera.net> wrote:\r
53 \r
54 > Antoine Beaupr=C3=A9 found a bug when notmuch-saved-searches contains=20\r
55 > newlines:\r
56 >\r
57 >         http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=3D737496\r
58 >\r
59 > We can remove newlines with something like\r
60 >=20=20=20=20=20=20=20=20=20=20=20\r
61 > (mapcar (lambda (arg)=20\r
62 >         (replace-regexp-in-string "\n" " " arg))\r
63 >       args)\r
64 >\r
65 > I wonder if we should do some other sanitization at the same time?\r
66 \r
67 It took a while to reproduce...\r
68 \r
69 $ echo $'foo\nbar' | notmuch count --batch=20\r
70 665\r
71 631\r
72 \r
73 $ echo $'foo\n and bar' | notmuch count --batch\r
74 665\r
75 A Xapian exception occurred: Syntax: <expression> AND <expression>\r
76 Query string was:  and bar\r
77 0\r
78 \r
79 Therefore: (wrong-type-argument number-or-marker-p A)\r
80 \r
81 (I run non-byte-compiled version of (one-) notmuch.el and\r
82 got this as a backtrace:\r
83 \r
84 Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p A)\r
85   >(A 0)\r
86   (or (plist-get options :show-empty-searches) (> message-count 0))\r
87 ...\r
88   (notmuch-remove-if-not\r
89 ...\r
90   notmuch-hello-query-counts\r
91 ...\r
92 \r
93 simpler way to reproduce:\r
94 \r
95 $ notmuch count 'and bar'\r
96 A Xapian exception occurred: Syntax: <expression> AND <expression>\r
97 Query string was: and bar\r
98 0\r
99 \r
100 Maybe the cli should be fixed ? (and/or make emacs MUA resilient to\r
101 this kind of result)\r
102 \r
103 >\r
104 > d\r
105 >\r
106 \r
107 Tomi\r