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 14:16:25 +0100 Message-ID: <87k31zfxw6.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> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1418217443 5798 80.91.229.3 (10 Dec 2014 13:17:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 10 Dec 2014 13:17:23 +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 Wed Dec 10 14:17:15 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 1Xyh8l-0002oW-Dy for geb-bug-gnu-emacs@m.gmane.org; Wed, 10 Dec 2014 14:17:15 +0100 Original-Received: from localhost ([::1]:45721 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xyh8k-0000WK-Vf for geb-bug-gnu-emacs@m.gmane.org; Wed, 10 Dec 2014 08:17:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44285) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xyh8d-0000Tm-OL for bug-gnu-emacs@gnu.org; Wed, 10 Dec 2014 08:17:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xyh8Z-0000DD-1i for bug-gnu-emacs@gnu.org; Wed, 10 Dec 2014 08:17:07 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:34914) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xyh8Y-0000D2-Uy for bug-gnu-emacs@gnu.org; Wed, 10 Dec 2014 08:17:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Xyh8Y-00006y-Fo for bug-gnu-emacs@gnu.org; Wed, 10 Dec 2014 08:17: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 13:17: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.1418217392381 (code B ref 19192); Wed, 10 Dec 2014 13:17:02 +0000 Original-Received: (at 19192) by debbugs.gnu.org; 10 Dec 2014 13:16:32 +0000 Original-Received: from localhost ([127.0.0.1]:60360 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xyh83-000064-IT for submit@debbugs.gnu.org; Wed, 10 Dec 2014 08:16:32 -0500 Original-Received: from mout.gmx.net ([212.227.15.15]:62027) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xyh81-00005w-5B for 19192@debbugs.gnu.org; Wed, 10 Dec 2014 08:16:30 -0500 Original-Received: from x200s ([109.201.152.25]) by mail.gmx.com (mrgmx001) with ESMTPSA (Nemesis) id 0MarNa-1YEa7F3bS6-00KQhC; Wed, 10 Dec 2014 14:16:28 +0100 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAAAAAByaaZbAAAAAmJLR0QA/4ePzL8AAAAJcEhZ cwAAAEgAAABIAEbJaz4AAADHSURBVEjH7VXBEQMhCLQiOqEYSqEOuqEhkseduRMk8MlkJtnnysqC imP8NIBEnxD0JFMQT3ZCpwRkcrzGs11wbAhXTu7xYuYUdOck9vNS4MpdXa1rpjDUkRAXcGxHATcF frMYZwooxhvuSt6B457uId8r4K6g3aX2OVRPWufVwGaCYtmcPKCsRVVF/qg9grmBSa8UwskkZTtz DoVJBJLxRyX3WRKFtzOWSu43Cq7NcSzadwqq/xXU8DMvivT+IzXoCZDGHx/EA6ex0LZqsBZsAAAA AElFTkSuQmCC In-Reply-To: <878uihj5ai.fsf@gmx.de> (Michael Albinus's message of "Tue, 09 Dec 2014 14:56:05 +0100") User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/24.4.51 (gnu/linux) X-Provags-ID: V03:K0:GoKZxmeKaf2EOrnicbtpAdrmgsmRhTGYWTdwEZQzvlGJtOYZ8lT foLF+XqZFJEsxT2NtO/HC8m9SOo7TiLmS9ymbDBolTU0oWriMUGpACrg6kVYWEJ0pV4kJO4 iaoENG5g5r/fH5/ezjMgBzBUf/AeOab75rIE/MlwDUlX5eSSq1bRc+AEm7O2cWwe1D0RLww TK35nIgzuT7mxFt9APPmw== 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:97131 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Michael Albinus writes: > So far it seems to be OK, but wouldn't it be safer to disallow all > options to ftp which start with "--"? I understand that you have checked > it with your ftp client, but you cannot assume that everybody uses the sa= me > version of ftp and ls as you do. Samr for the ftp server. As you prefer.=20=20 This patch disallow (string-match "--\\w\\{2,\\}" switches) which should be enough to capture switches starting with --, I guess. =E2=80=94Rasmus --=20 The right to be left alone is a human right --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-ange-ftp.el-Disallow-more-dired-ls-flags.patch >From 55bf708060ddf05a87df4f1f22185aceac74d9c6 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 | 8 ++++++-- 2 files changed, 12 insertions(+), 2 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..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))) (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,\\}")) switches)) (defun ange-ftp-get-files (directory &optional no-error) -- 2.1.3 --=-=-=--