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: Sat, 29 Nov 2014 13:21:57 +0100 Message-ID: <87iohyfb8a.fsf@gmx.us> References: <87tx1mrwwq.fsf@gmx.us> <87zjbe9j9c.fsf@gmx.de> <87h9xlil0f.fsf@gmx.us> <877fye2spw.fsf@gmx.de> <87mw7afe90.fsf@gmx.us> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1417263806 22477 80.91.229.3 (29 Nov 2014 12:23:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 29 Nov 2014 12:23:26 +0000 (UTC) Cc: 19192@debbugs.gnu.org To: michael.albinus@gmx.de Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Nov 29 13:23:17 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 1Xuh3V-0004ij-3H for geb-bug-gnu-emacs@m.gmane.org; Sat, 29 Nov 2014 13:23:17 +0100 Original-Received: from localhost ([::1]:47403 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xuh3U-0006RI-L0 for geb-bug-gnu-emacs@m.gmane.org; Sat, 29 Nov 2014 07:23:16 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38645) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xuh3M-0006R2-2t for bug-gnu-emacs@gnu.org; Sat, 29 Nov 2014 07:23:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xuh3H-0006We-7F for bug-gnu-emacs@gnu.org; Sat, 29 Nov 2014 07:23:08 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:51673) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xuh3H-0006Wa-3L for bug-gnu-emacs@gnu.org; Sat, 29 Nov 2014 07:23:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Xuh3G-0007DO-PO for bug-gnu-emacs@gnu.org; Sat, 29 Nov 2014 07:23:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Rasmus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 29 Nov 2014 12:23: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.141726372627656 (code B ref 19192); Sat, 29 Nov 2014 12:23:02 +0000 Original-Received: (at 19192) by debbugs.gnu.org; 29 Nov 2014 12:22:06 +0000 Original-Received: from localhost ([127.0.0.1]:48886 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xuh2L-0007C0-Oy for submit@debbugs.gnu.org; Sat, 29 Nov 2014 07:22:06 -0500 Original-Received: from mout.gmx.net ([212.227.15.15]:54538) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xuh2I-0007Bf-1d for 19192@debbugs.gnu.org; Sat, 29 Nov 2014 07:22:03 -0500 Original-Received: from W530 ([37.135.96.168]) by mail.gmx.com (mrgmx001) with ESMTPSA (Nemesis) id 0M6SJX-1Y5s8J2xSt-00yPNm; Sat, 29 Nov 2014 13:22:00 +0100 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAAAAAByaaZbAAAAAmJLR0QA/4ePzL8AAAAJcEhZ cwAAAEgAAABIAEbJaz4AAAIDSURBVEjHhZbLlSUhDEMJR2EptZuQY5oFtjHF6zMsqhdtIfkn3rKx zf6TB9sGAxGRn/yuHYtty5I0UDgigyueZRt2/Dm2kjEiApMExstsOboAKkY7Am9dgFnGsO+3ksaF kCQTUcpsL88zEMbaFAUIbHn5qo9dKdhkEZrABZiIuj8pJHHud0rikSRLhp0CR4+sVeF8C2sHklQA 9j/W1HIdm/CpEhmynrsHB9FZcwD4b8DWQUDA7s6a9fHMwLYJu7KOHbVOffLbk2GbwEQE3WivHuyE ZBdy/nJMAwBka41NUAUmHBuC02dLlcPstaXDSFzx72gMdRswCLqsfBguSJWoEK+kMVW9cxtQDPwV P0YvyNntPtwQJcDdhvaIdRNw9d3HaHoV16OnK+5eT6Aao0UH8YXqVDUkEZZZlxoOSrOqIAmkYzMj E07imXQEsgtQVpq4NIeaLFrUXlHWlM9jB92HuPtAqz85jHhgNI7hG01Rm7cdtfQUwxk/hiV4OweU fXxshqume/a2Z/AD8OnB2D0J7NBH0ukxYxlqXfHFwHi0xvCN5gE3Qwfze09hSnpnome1HephqIS5 nL9eLs02aJ2U+eTQT9HMWcs/jtKclIIGwWzc97E7ZeV/DGe+/c25AHrDR1l1Aa7LXLmeFPQA9gOS z0hF9yMh4RvQy1Xj1jbWP1Tm+Qe9IHnKji7ROAAAAABJRU5ErkJggg== In-Reply-To: <87mw7afe90.fsf@gmx.us> (rasmus@gmx.us's message of "Sat, 29 Nov 2014 12:16:43 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-Provags-ID: V03:K0:NCfNxCC+Gf6ZF4ycUxqIb1PEbdhmpl34TPN3V5B2WyVApm4DZI7 MykWuFwweR3Zj4CTizNB2nVymQwNk0D71uNnOgK2C3hkqASVK0rJTcSYR3bUUd0qYTEpf8i XuNxv0iiVHJHdA94ZHoZ8ubE+4aa7T53Py04WvNwcSp4asHsfbQGaA4sjgd3ct4Ufd4It+Y AV6kR9KkItoVg72qFOP0g== 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:96726 Archived-At: --=-=-= Content-Type: text/plain Rasmus writes: > For now I will go with Option I. Well, turned out to be a bad idea. Instead I tested all flags in (man "ls") and exclude the flags that caused trouble. Note, I only have one ftp to test against. . . I'm assuming this one is somewhat common. Also, a limitation of the `ange-ftp-switches-ok' is that it's too destructive: I.e. rather than removing offending ls-flags, it will entirely disregard the whole thing. I guess that's another patch, though. If you find the patch OK, feel free to submit. Otherwise, let me know what to improve. Thanks, Rasmus -- The right to be left alone is a human right --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-ange-ftp.el-Disallow-more-dired-ls-flags.patch >From 6fd921e7d7deb88c5a3f172022b64a0539edbdd6 Mon Sep 17 00:00:00 2001 From: Rasmus Date: Sat, 29 Nov 2014 13:12:10 +0100 Subject: [PATCH] ange-ftp.el: Disallow more dired ls-flags * 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. Fixes: debbugs:19192 --- lisp/ChangeLog | 6 ++++++ lisp/net/ange-ftp.el | 12 +++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2a450a7..7d0992e 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-11-29 Stephen Berman Stefan Monnier diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el index d7632ed..a2b0b46 100644 --- a/lisp/net/ange-ftp.el +++ b/lisp/net/ange-ftp.el @@ -2831,16 +2831,26 @@ 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. (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)) + ;; Disallow most long flags from (man "ls"), version 8.23 of July 2014. + (not (string-match + (concat + "--\\(block-size\\|color\\|format\\|group-directories-first\\|" + "human-readable\\|dereference-command-line\\|hide\\|indicator-style\\|" + "dereference-command-line-symlink-to-dir\\|inode\\|ignore\\|dereference\\|" + "numeric-uid-gid\\|indicator-style\\|hide-control-chars\\|quoting-style\\|" + "sort\\|time\\|time-style\\|width\\)"))) switches)) (defun ange-ftp-get-files (directory &optional no-error) -- 2.1.3 --=-=-=--