From sl392@cam.ac.uk Wed May 6 07:21:07 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 6 May 2009 14:21:07 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.1 required=4.0 tests=AWL autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n46EL3l2005130 for ; Wed, 6 May 2009 07:21:04 -0700 Received: from mx10.gnu.org ([199.232.76.166]:53167) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1M1hza-0008Ov-Tb for emacs-pretest-bug@gnu.org; Wed, 06 May 2009 10:21:02 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1M1hzZ-0001jW-H8 for emacs-pretest-bug@gnu.org; Wed, 06 May 2009 10:21:02 -0400 Received: from ppsw-6.csi.cam.ac.uk ([131.111.8.136]:54172) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M1hzY-0001jH-Hc for emacs-pretest-bug@gnu.org; Wed, 06 May 2009 10:21:00 -0400 X-Cam-AntiVirus: no malware found X-Cam-SpamDetails: not scanned X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from sl392.st-edmunds.cam.ac.uk ([131.111.223.202]:56446 helo=victoria.local) by ppsw-6.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.156]:587) with esmtpsa (PLAIN:sl392) (TLSv1:DHE-RSA-AES128-SHA:128) id 1M1hzX-0005dU-M3 (Exim 4.70) for emacs-pretest-bug@gnu.org (return-path ); Wed, 06 May 2009 15:20:59 +0100 From: Leo To: emacs-pretest-bug@gnu.org Subject: 23.0.93; Make dired-actual-switches safe local variable? Date: Wed, 06 May 2009 15:20:57 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.93 (darwin) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: "Leo, Shidai Liu" X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Hi there, The dired-x manual gives an example in using local variables for dired buffers. However, the variable dired-actual-switches has not been marked as safe local variable. I think this is an oversight. ,----[ (info "(dired-x)Local Variables") ] | For example, if the user puts | | Local Variables: | dired-actual-switches: "-lat" | dired-omit-mode: t | End: `---- Best wishes, Leo From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 14 21:34:16 2010 Received: (at control) by debbugs.gnu.org; 15 Jan 2010 02:34:17 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NVc0u-0002Nz-7E for submit@debbugs.gnu.org; Thu, 14 Jan 2010 21:34:16 -0500 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NVc0s-0002Nt-9H for control@debbugs.gnu.org; Thu, 14 Jan 2010 21:34:14 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.69) (envelope-from ) id 1NVc0o-0003pu-Q3; Thu, 14 Jan 2010 21:34:10 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <19279.54306.760765.98090@gargle.gargle.HOWL> Date: Thu, 14 Jan 2010 21:34:10 -0500 From: Glenn Morris To: control Subject: control X-Attribution: GM X-Mailer: VM (www.wonderworks.com/vm), GNU Emacs (www.gnu.org/software/emacs) X-Hue: red X-Ran: :m~t}wvg-c(~($msYvZ|;v.!JomO'3d}hwb{k1S4tPrXRnrVb!DCq)dD@=s-a^i3cq17iH X-Debbugs-No-Ack: yes X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.0 (-----) tags 3642 moreinfo unreproducible severity 3699 minor severity 3870 minor severity 4438 minor severity 4952 minor severity 5154 minor close 5215 severity 5239 wishlist close 5318 severity 5360 wishlist severity 5362 minor tags 4974 moreinfo unreproducible severity 4408 wishlist severity 4089 wishlist tags 4089 wontfix reassign 4044 emacs,ns merge 2280 5252 tags 5374 moreinfo reassign 4828 emacs,cc-mode tags 4828 patch reassign 5001 emacs,erc close 5371 reassign 4517 emacs,ns severity 3230 minor close 4930 close 5249 From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 23 21:08:36 2011 Received: (at 3230) by debbugs.gnu.org; 24 Feb 2011 02:08:37 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PsQdA-0001v7-2w for submit@debbugs.gnu.org; Wed, 23 Feb 2011 21:08:36 -0500 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PsQd7-0001uj-Ht; Wed, 23 Feb 2011 21:08:33 -0500 Received: from localhost ([127.0.0.1]:49513) by fencepost.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PsQd0-0000fW-Uf; Wed, 23 Feb 2011 21:08:27 -0500 From: Glenn Morris To: Leo Subject: Re: 23.0.93; Make dired-actual-switches safe local variable? References: X-Spook: Skipjack CIA Consul Crowell Europol clones Ft. Knox oil X-Ran: :TfXach-8.lX#+_aLtg2f`0$niKxz(4U~tw1|/_TD-a=*9.~:s{qv'3'xF8:(_BCSn=I`j X-Hue: black X-Attribution: GM Date: Wed, 23 Feb 2011 21:08:26 -0500 In-Reply-To: (Leo's message of "Wed, 06 May 2009 15:20:57 +0100") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -6.3 (------) X-Debbugs-Envelope-To: 3230 Cc: 3230@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.3 (------) retitle 3230 dired-actual-switches is risky stop Leo wrote: > The dired-x manual gives an example in using local variables for dired > buffers. However, the variable dired-actual-switches has not been marked > as safe local variable. I think this is an oversight. As it stands, it emphatically should NOT be marked safe. Example: cat <| .dired Local Variables: dired-actual-switches: "-l ; touch /tmp/OHDEAR" End: EOF rm -f /tmp/OHDEAR emacs -Q -l dired-x M-x dired /path/to/dir/*.el ; wildcard is important answer "y" to question about possibly unsafe local variable ls /tmp/OHDEAR Oh dear, arbitrary shell command executed with permissions of the user running Emacs. From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 23 23:47:10 2011 Received: (at 3230) by debbugs.gnu.org; 24 Feb 2011 04:47:10 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PsT6b-0000q6-GH for submit@debbugs.gnu.org; Wed, 23 Feb 2011 23:47:10 -0500 Received: from mail-yi0-f44.google.com ([209.85.218.44]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PsT6Z-0000pl-Jt for 3230@debbugs.gnu.org; Wed, 23 Feb 2011 23:47:08 -0500 Received: by yic13 with SMTP id 13so101009yic.3 for <3230@debbugs.gnu.org>; Wed, 23 Feb 2011 20:47:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=ayaLZUJeiW3VuSgFKuTXx0q0QjcJhwzvvGWXa2et/ZY=; b=FR5e+xp50fX2hJ+A3jsrv0NVGW4j8Od17bAliZbmE8xYm3ZPjMeCwRqYfy/Qu2OdC6 hFEBQIecOZu6xeBDjCrNNdb+M+ziTlKnBAswWnxdopeRjAblnGQyfn7657funYH3Czm9 8X8ia0PMPyjy03TT5E0Nhqzt7g7wF4lUSQrlk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; b=cZZR9EZa7teGtCFRQFybZGXc3p/lUXpw6K5MJU3Nc4Ra1YBr7c8masWnkTYaHD7axW r/gQ4zQhPCBTz6K3nXfYg9nFQ2hMXx5vfVPdkdj55vd4donTnWNuFN9JCIlFZcTIU+xS g7tKcWMjQyjyMTLmbYXkOVlnJI0cPbu5TqUh4= Received: by 10.101.139.15 with SMTP id r15mr211708ann.63.1298522822175; Wed, 23 Feb 2011 20:47:02 -0800 (PST) Received: from Victoria.local ([59.57.99.84]) by mx.google.com with ESMTPS id b27sm4646617ana.8.2011.02.23.20.46.57 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 23 Feb 2011 20:47:01 -0800 (PST) From: Leo To: Glenn Morris Subject: Re: bug#3230: 23.0.93; Make dired-actual-switches safe local variable? References: Date: Thu, 24 Feb 2011 12:46:40 +0800 In-Reply-To: (Glenn Morris's message of "Wed, 23 Feb 2011 21:08:26 -0500") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2.94 (Mac OS X 10.6.6) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -3.4 (---) X-Debbugs-Envelope-To: 3230 Cc: 3230@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.4 (---) On 2011-02-24 10:08 +0800, Glenn Morris wrote: > As it stands, it emphatically should NOT be marked safe. Example: [...] > > Oh dear, arbitrary shell command executed with permissions of the user > running Emacs. Looks like a bug in the way dired-actual-switches is used. Should we devise a function to check every switch in dired-actual-switches is actual a switch? (defun dired-actual-switches-p (switches) (assert (stringp switches)) (mapc (lambda (switch) (assert (eq (aref switch 0) ?-))) (split-string switches nil t))) (put 'dired-actual-switches 'safe-local-variable 'dired-actual-switches-p) Leo From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 24 01:52:02 2011 Received: (at 3230) by debbugs.gnu.org; 24 Feb 2011 06:52:02 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PsV3R-0003Ym-NQ for submit@debbugs.gnu.org; Thu, 24 Feb 2011 01:52:01 -0500 Received: from mail-gw0-f42.google.com ([74.125.83.42]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PsV3P-0003YX-MJ for 3230@debbugs.gnu.org; Thu, 24 Feb 2011 01:52:00 -0500 Received: by gwj23 with SMTP id 23so216881gwj.29 for <3230@debbugs.gnu.org>; Wed, 23 Feb 2011 22:51:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=o6BJBcJrp3jfdNGDYPnFRkuSFTk4md0/6iXx1BvopVo=; b=Gx8UI6Rbih+V9Rndbw4VPLbzRmug3HTGXYV+LqCjssLvXzvgWWtTDj2Sr881QT5hgh rgwRWdpPklhVClIyYJumQX7H0yLimZFwU9uomwDai6MIsZXZtaJzZMxsQV64OY+9Lm/d +5JGKYj03k6ZboTgbVSy9tGk11nPbl3jh2ufE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; b=IlfA7X+04RV6s888F3s018eONuw0foWBQxpjYp5HXOO+CdKbZWlvkHLQNQ3XoL+8Ck YtTgyclsoIzt6ZdyXjfW6T0PHgm5nNOGtuM8YC9iAHWcRepqokV7mC697A/gAJnzfBwe VDhXQ/cpaRA4ROMGCMFXJyqpXbw1BAkMsYrGw= Received: by 10.236.109.1 with SMTP id r1mr927890yhg.1.1298530314241; Wed, 23 Feb 2011 22:51:54 -0800 (PST) Received: from Victoria.local ([59.57.99.84]) by mx.google.com with ESMTPS id g29sm5410882yhh.36.2011.02.23.22.51.32 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 23 Feb 2011 22:51:53 -0800 (PST) From: Leo To: Glenn Morris Subject: Re: bug#3230: 23.0.93; Make dired-actual-switches safe local variable? References: Date: Thu, 24 Feb 2011 14:51:16 +0800 In-Reply-To: (Leo's message of "Thu, 24 Feb 2011 12:46:40 +0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2.94 (Mac OS X 10.6.6) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -3.4 (---) X-Debbugs-Envelope-To: 3230 Cc: 3230@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.4 (---) On 2011-02-24 12:46 +0800, Leo wrote: > (defun dired-actual-switches-p (switches) > (assert (stringp switches)) > (mapc > (lambda (switch) > (assert (eq (aref switch 0) ?-))) > (split-string switches nil t))) Sorry, it should not err. I originally named the function dired-check-switches, then changed it to be a predicate in the last minute. (defun dired-actual-switches-p (switches) (and (stringp switches) (catch 'exit (mapc (lambda (switch) (unless (eq (aref switch 0) ?-) (throw 'exit nil))) (split-string switches nil t)) t))) Leo From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 24 09:57:13 2011 Received: (at 3230) by debbugs.gnu.org; 24 Feb 2011 14:57:13 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Psccz-0007Yy-Ay for submit@debbugs.gnu.org; Thu, 24 Feb 2011 09:57:13 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.183] helo=ironport2-out.pppoe.ca) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Psccw-0007Yl-4I for 3230@debbugs.gnu.org; Thu, 24 Feb 2011 09:57:10 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEAFkAZk1FxIPF/2dsb2JhbACmJ3S9VoVgBIUQj1s X-IronPort-AV: E=Sophos;i="4.62,218,1297054800"; d="scan'208";a="93398171" Received: from 69-196-131-197.dsl.teksavvy.com (HELO pastel.home) ([69.196.131.197]) by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA; 24 Feb 2011 09:57:04 -0500 Received: by pastel.home (Postfix, from userid 20848) id 732094E050; Thu, 24 Feb 2011 09:57:04 -0500 (EST) From: Stefan Monnier To: Leo Subject: Re: bug#3230: 23.0.93; Make dired-actual-switches safe local variable? Message-ID: References: Date: Thu, 24 Feb 2011 09:57:04 -0500 In-Reply-To: (Leo's message of "Thu, 24 Feb 2011 14:51:16 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.1 (--) X-Debbugs-Envelope-To: 3230 Cc: 3230@debbugs.gnu.org, Glenn Morris X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.1 (--) > (defun dired-actual-switches-p (switches) > (and (stringp switches) > (catch 'exit > (mapc (lambda (switch) > (unless (eq (aref switch 0) ?-) > (throw 'exit nil))) > (split-string switches nil t)) > t))) Hmm, what about "-l;reboot" ? BTW, writing a predicate is the right thing to so, and the predicate should then go to safe-local-variable. I'd recommend something simple like (defun dired-safe-switches-p (switches) (string-match "\\`[- [[:alnum:]]]+\\'" switches)) Hopefully that one is safe (tho maybe we should check string-length to avoid attacks playing on overflow). And if it proves too restrictive, we can make it a bit more permissive once we encounter a particular example that warrants it. Stefan From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 25 09:38:49 2011 Received: (at 3230) by debbugs.gnu.org; 25 Feb 2011 14:38:50 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Psyoj-0003Dn-OF for submit@debbugs.gnu.org; Fri, 25 Feb 2011 09:38:49 -0500 Received: from mail-pv0-f172.google.com ([74.125.83.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Psyoh-0003Db-PQ for 3230@debbugs.gnu.org; Fri, 25 Feb 2011 09:38:48 -0500 Received: by pvd12 with SMTP id 12so267690pvd.3 for <3230@debbugs.gnu.org>; Fri, 25 Feb 2011 06:38:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:in-reply-to:references :user-agent:date:message-id:mime-version:content-type; bh=EuhKSidujUBgrrKruPV8lJcwIevEevjkuuSEiEMdTNQ=; b=UmIj2OObqE4rKKvPnkThAsKvYX1GICxsoTYrT4GIHTKht379do1mxTzGuuDh6JWEvc L/ByTWfQEt/eaQYbynjxFlq/WGmny94gXzzaBWWlM+IQe4aD7ShtmBOf4fooC9Hy7JxX DdRzsx2Q3625VIDos/rT1fGlG6YnKISC+66OM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version:content-type; b=QjxGB0sorZmM1NWevadLg4ViZpaqoSkGFgrzNVAyF1toCwiZzNX/TtiuzLQBl7jCC5 h6Fl6T1T3aAkOSPJV8qY7Wb+2za2xPwtJMcuBUoenTJVsF2OC2p9oQms9cBhB9Qxv9WQ mtBi9XeEd+lAWYrysVhvv9wLU3t7vaD2C9iqA= Received: by 10.142.188.2 with SMTP id l2mr1753940wff.4.1298644722002; Fri, 25 Feb 2011 06:38:42 -0800 (PST) Received: from Victoria.local ([110.81.36.68]) by mx.google.com with ESMTPS id z1sm1056713wfd.9.2011.02.25.06.38.34 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 25 Feb 2011 06:38:39 -0800 (PST) From: Leo To: Stefan Monnier Subject: Re: bug#3230: 23.0.93; Make dired-actual-switches safe local variable? In-Reply-To: (Stefan Monnier's message of "Thu, 24 Feb 2011 09:57:04 -0500") References: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2.94 (Mac OS X 10.6.6) Date: Fri, 25 Feb 2011 22:38:21 +0800 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -3.6 (---) X-Debbugs-Envelope-To: 3230 Cc: 3230@debbugs.gnu.org, Glenn Morris X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.6 (---) On 2011-02-24 22:57 +0800, Stefan Monnier wrote: > Hmm, what about "-l;reboot" ? Thanks. > BTW, writing a predicate is the right thing to so, and the predicate > should then go to safe-local-variable. I'd recommend something simple > like > > (defun dired-safe-switches-p (switches) > (string-match "\\`[- [[:alnum:]]]+\\'" switches)) A typo: should be [:alnum:]. > Hopefully that one is safe (tho maybe we should check string-length to > avoid attacks playing on overflow). And if it proves too restrictive, > we can make it a bit more permissive once we encounter a particular > example that warrants it. > > Stefan I think I like this. Glenn, would you agree to this? If this is accepted, I have one use case that can be easily done: I have one directory where I file regularly. I like that directory to be sorted by time instead of by name in dired. This change will allow me to set dired-actual-switches to achieve that. Leo From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 28 22:26:06 2011 Received: (at 3230-done) by debbugs.gnu.org; 1 Mar 2011 03:26:06 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PuGDu-0006qW-8d for submit@debbugs.gnu.org; Mon, 28 Feb 2011 22:26:06 -0500 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PuGDt-0006q4-CJ for 3230-done@debbugs.gnu.org; Mon, 28 Feb 2011 22:26:05 -0500 Received: from localhost ([127.0.0.1]:41722) by fencepost.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PuGDo-0005nn-4i; Mon, 28 Feb 2011 22:26:00 -0500 From: Glenn Morris To: 3230-done@debbugs.gnu.org Subject: Re: bug#3230: 23.0.93; Make dired-actual-switches safe local variable? References: X-Spook: Croatian KGB freedom Kosovo bomb enemy of the state X-Ran: cZZmFUGaoYRe&6&fu"!WeUgm0LuN>R).YO}!3rlS*^3zptfw3yMuQ\K;1T(s}rl'31|Bok X-Hue: red X-Debbugs-No-Ack: yes X-Attribution: GM Date: Mon, 28 Feb 2011 22:25:59 -0500 In-Reply-To: (Stefan Monnier's message of "Thu, 24 Feb 2011 09:57:04 -0500") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -6.3 (------) X-Debbugs-Envelope-To: 3230-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.3 (------) Version: 24.1 Stefan Monnier wrote: > should then go to safe-local-variable. I'd recommend something simple > like > > (defun dired-safe-switches-p (switches) > (string-match "\\`[- [[:alnum:]]]+\\'" switches)) Added. From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 28 23:32:22 2011 Received: (at 3230) by debbugs.gnu.org; 1 Mar 2011 04:32:23 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PuHG1-0000cI-RG for submit@debbugs.gnu.org; Mon, 28 Feb 2011 23:32:21 -0500 Received: from mail-gw0-f42.google.com ([74.125.83.42]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PuHFz-0000c2-Ru; Mon, 28 Feb 2011 23:32:20 -0500 Received: by gwj23 with SMTP id 23so3329441gwj.29 for ; Mon, 28 Feb 2011 20:32:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type:content-transfer-encoding; bh=h7zKRBZhLGznKDKFWc7Bxzd6dyXdBQF8tNcFiPkZa0o=; b=BWDBKxizLIl/AcPBe3vHBnMSdRYSaThrZVBoNiLGKFTq7uL//InMRP1AW0MkebjEug 3bRmfC86l9tAek5XvYkUF5wR/4x5nSPZUdux/yaIAphXDSmFBTjK5u/e4J1aMFgif7Lx jvjKjXAeOiL4Dt4xIKsH6QYR9fduICcDzsjCA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=EgVmGuocFTLWqUIgCm6YQuYtCeVyWIxADgDir4+AUqxzliSSBtK7FZt/z2FX1x9AuK f7RpZHsg6R6kMl4nhnysgYkjj2VpJ5M3R4WClXL5mAgoeKoXO3xnBV1hwLozdE3rJk4y 24Pswn3Ld7rvNixY5P3xjzT+KRjQn2/dvUK0c= Received: by 10.151.10.11 with SMTP id n11mr8042551ybi.447.1298953934128; Mon, 28 Feb 2011 20:32:14 -0800 (PST) MIME-Version: 1.0 Received: by 10.147.35.6 with HTTP; Mon, 28 Feb 2011 20:31:34 -0800 (PST) In-Reply-To: References: From: Juanma Barranquero Date: Tue, 1 Mar 2011 05:31:34 +0100 Message-ID: Subject: Re: bug#3230: 23.0.93; Make dired-actual-switches safe local variable? To: 3230@debbugs.gnu.org, rgm@gnu.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -3.1 (---) X-Debbugs-Envelope-To: 3230 Cc: 3230-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.2 (---) On Tue, Mar 1, 2011 at 04:25, Glenn Morris wrote: >> =C2=A0 (defun dired-safe-switches-p (switches) >> =C2=A0 =C2=A0 (string-match "\\`[- [[:alnum:]]]+\\'" switches)) This is a poster case for using `string-match-p'. =C2=A0 =C2=A0 Juanma From unknown Sat Jun 14 19:39:49 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 29 Mar 2011 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator