From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Rasmus Newsgroups: gmane.emacs.bugs Subject: bug#19192: 25.0.50; TRAMP uses `dired-listing-switches' for ftp-connection Date: Wed, 10 Dec 2014 16:28:20 +0100 Message-ID: <87fvcnfrsb.fsf@gmx.us> References: <87tx1mrwwq.fsf@gmx.us> <87zjbe9j9c.fsf@gmx.de> <87h9xlil0f.fsf@gmx.us> <877fye2spw.fsf@gmx.de> <87mw7afe90.fsf@gmx.us> <87a9393pw2.fsf@gmx.de> <874mtgamf3.fsf@gmx.us> <878uihj5ai.fsf@gmx.de> <87k31zfxw6.fsf@gmx.us> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1418225381 14567 80.91.229.3 (10 Dec 2014 15:29:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 10 Dec 2014 15:29:41 +0000 (UTC) Cc: 19192@debbugs.gnu.org, michael.albinus@gmx.de To: schwab@suse.de Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Dec 10 16:29:34 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XyjCn-000290-8z for geb-bug-gnu-emacs@m.gmane.org; Wed, 10 Dec 2014 16:29:33 +0100 Original-Received: from localhost ([::1]:46315 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XyjCm-0005Zh-IY for geb-bug-gnu-emacs@m.gmane.org; Wed, 10 Dec 2014 10:29:32 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35619) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XyjCd-0005Yc-O1 for bug-gnu-emacs@gnu.org; Wed, 10 Dec 2014 10:29:28 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XyjCJ-000745-Cr for bug-gnu-emacs@gnu.org; Wed, 10 Dec 2014 10:29:23 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:35327) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XyjCJ-000740-7C for bug-gnu-emacs@gnu.org; Wed, 10 Dec 2014 10:29:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XyjCI-0003oD-Kz for bug-gnu-emacs@gnu.org; Wed, 10 Dec 2014 10:29:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Rasmus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 10 Dec 2014 15:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19192 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 19192-submit@debbugs.gnu.org id=B19192.141822531114594 (code B ref 19192); Wed, 10 Dec 2014 15:29:02 +0000 Original-Received: (at 19192) by debbugs.gnu.org; 10 Dec 2014 15:28:31 +0000 Original-Received: from localhost ([127.0.0.1]:60773 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XyjBm-0003nJ-4v for submit@debbugs.gnu.org; Wed, 10 Dec 2014 10:28:30 -0500 Original-Received: from mout.gmx.net ([212.227.17.22]:54017) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XyjBi-0003n9-9J for 19192@debbugs.gnu.org; Wed, 10 Dec 2014 10:28:27 -0500 Original-Received: from x200s ([46.166.186.247]) by mail.gmx.com (mrgmx103) with ESMTPSA (Nemesis) id 0Lhf3N-1Xd7ot3KMb-00mtci; Wed, 10 Dec 2014 16:28:23 +0100 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAArCAMAAAAJzfvtAAAAPFBMVEX39/fS1NifoZ9gYFoZ Ghna5O1/p4JUOSup3LWTqeShXDLCajpmcNh3jNxOT59+oeDE8Lpoo2J8xnGIyXCo3RooAAACK0lE QVRIx4VWC7LDIAgU8J+YRL3/XR/YJs9Y09JMp+OwsIsBqtTdAIm0GBGA+mXGOvEkJEvEPx1+9+fQ hGBONCBj/LM7srsZzoLT7jk8zThzFnzw788RL7DhSBN/rfuaoIugLnp2gnDuxp4WhwEAjBjX7oMV 6Zu/cYtbQ0ophNBAVsNQH1Q9AuOyBbWuKQhm3w3ruAtw6hYBl7iqwACVkiQMu7nJGBMqYaTSG8AP Z+l9zFgEiFGvak0MCAIQKaFzYvBdMsbYJLwAfN3JKNj+U7ixyhSZkQCC2tmUaagNL0Zjkd8SEqNU CjuzEiErXTUd3ntwcVuFJDN/iW5fOyd8ERhfR5awbmviKjEpEZEaEU4ZmlaiT0YolTHwuoMQVNqZ WQsw0QxukRO42ii8tIsoNqO0HRgtsa+CMQDi3igGCaNtr9l4YoAZBwMjwvam0lf1sLnwqz1vyfOu uzuHUmu1meYT5eTeibb1KJkxedbccFKhq9kgH744yr4c06GC5yQ542H1uerIOY5phnsqMEeVT87Z zijBf9M1EYClHIf3OdeSyzcJrR/gYL0SvzEqBWYSoOs4cfe18hMj1WmGvi1Ji3/hyJUYUPzxNUEb e75kzyNLPV3z0Peoyb9LEacTeZxLTOrtBnZ6yTQOIuWGyTEKsJ/TWD8uNLDTeU+TKI3+sDl6hIP5 IsMvOw7uU1n5Lzvuf4uaa4v+XLwGzz1Nbb0T/lztjNnaPwHn7LzSf8IxFWG39VlGAAAAAElFTkSu QmCC In-Reply-To: (Andreas Schwab's message of "Wed, 10 Dec 2014 15:15:53 +0100") User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/24.4.51 (gnu/linux) X-Provags-ID: V03:K0:wgkCqmrNomVBS9J0v9jmya5TMBZJ8f0XaW5IH2050CuH+a6nrNX M4JJX++tOM7+5KbiWy15a7pxY/B3gslX6P35B1Ii1JkWkQc1nZ76YLIYRo+B6L6XQd9icRT SeSArGwwUaQCtqpTvszbadCRAJDN+fJT9pBalveAJHKLYRrVnGAAQwQxsACVEne4w3lOUZz +s4YsPrp+W3JRt7nOKbGA== X-UI-Out-Filterresults: notjunk:1; X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:97133 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Andreas Schwab writes: > Rasmus writes: > >> diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el >> index d7632ed..5e9bc27 100644 >> --- a/lisp/net/ange-ftp.el >> +++ b/lisp/net/ange-ftp.el >> @@ -2831,16 +2831,20 @@ match subdirectories as well.") >> files ange-ftp-files-hashtable))) >>=20=20 >> (defun ange-ftp-switches-ok (switches) >> - "Return SWITCHES (a string) if suitable for our use." >> + "Return SWITCHES (a string) if suitable for use with ls over ftp." >> (and (stringp switches) >> ;; We allow the A switch, which lists all files except "." and >> ;; "..". This is OK because we manually insert these entries >> ;; in the hash table. >> (string-match >> "--\\(almost-\\)?all\\>\\|\\(\\`\\| \\)-[[:alpha:]]*[aA]" switches) >> + ;; Allow flags starting with a single dash >> (string-match "\\(\\`\\| \\)-[[:alpha:]]*l" switches) >> + ;; Disallow recursive flag >> (not (string-match >> - "--recursive\\>\\|\\(\\`\\| \\)-[[:alpha:]]*R" switches)) >> + "\\(\\`\\| \\)-[[:alpha:]]*R" switches)) >> + ;; Disallow long flags. >> + (not (string-match "--\\w\\{2,\\}")) > > This contradicts the first string-match. You are right. How about this one: allow --(almost-)all for legacy reasons. Disallow other long flags. Allow short flag as long as their is an "l" and not an "R"? (At least that was the intention). =E2=80=94Rasmus --=20 Together we will make the possible totalllly impossible! --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-ange-ftp.el-Disallow-more-dired-ls-flags.patch >From 07f99a06a30e271989a27dc58a2db54602d60e51 Mon Sep 17 00:00:00 2001 From: rasmus Date: Wed, 10 Dec 2014 16:18:00 +0100 Subject: [PATCH] ange-ftp.el: Disallow more dired ls-flags * net/ange-ftp.el (ange-ftp-switches-ok): Disallow most lonng flags, as they may cause Tramp-breakage. Fixes: debbugs:19192 --- lisp/ChangeLog | 6 ++++++ lisp/net/ange-ftp.el | 20 ++++++++++++++------ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 454ee00..09b64f5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2014-11-29 Rasmus Pank Roulund + + * net/ange-ftp.el (ange-ftp-switches-ok): Disallow flags causing + trouble with ls over ftp. These flags result in ls returning no + output, causing Tramp-breakage. (bug#19192) + 2014-12-10 Andreas Schwab * files.el (file-tree-walk): Use file-name-as-directory diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el index d7632ed..db79c0d 100644 --- a/lisp/net/ange-ftp.el +++ b/lisp/net/ange-ftp.el @@ -2831,16 +2831,24 @@ match subdirectories as well.") files ange-ftp-files-hashtable))) (defun ange-ftp-switches-ok (switches) - "Return SWITCHES (a string) if suitable for our use." + "Return SWITCHES (a string) if suitable for use with ls over ftp." (and (stringp switches) - ;; We allow the A switch, which lists all files except "." and - ;; "..". This is OK because we manually insert these entries - ;; in the hash table. + ;; We allow the --almost-all switch, which lists all files + ;; except "." and "..". This is OK because we manually + ;; insert these entries in the hash table. (string-match - "--\\(almost-\\)?all\\>\\|\\(\\`\\| \\)-[[:alpha:]]*[aA]" switches) + "--\\(almost-\\)?all\\>\\|\\(\\`\\| \\)-[[:alpha:]]*[aA]" + switches) + ;; Disallow other long flags except --(almost-)all. + (not (string-match "\\(\\`\\| \\)--\\w+" + (replace-regexp-in-string + "--\\(almost-\\)?all\\>" "" + switches))) + ;; Must include 'l'. (string-match "\\(\\`\\| \\)-[[:alpha:]]*l" switches) + ;; Disallow recursive flag. (not (string-match - "--recursive\\>\\|\\(\\`\\| \\)-[[:alpha:]]*R" switches)) + "\\(\\`\\| \\)-[[:alpha:]]*R" switches)) switches)) (defun ange-ftp-get-files (directory &optional no-error) -- 2.1.3 --=-=-=--