unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Rasmus <rasmus@gmx.us>
To: michael.albinus@gmx.de
Cc: 19192@debbugs.gnu.org
Subject: bug#19192: 25.0.50; TRAMP uses `dired-listing-switches' for ftp-connection
Date: Sat, 29 Nov 2014 13:21:57 +0100	[thread overview]
Message-ID: <87iohyfb8a.fsf@gmx.us> (raw)
In-Reply-To: <87mw7afe90.fsf@gmx.us> (rasmus@gmx.us's message of "Sat, 29 Nov 2014 12:16:43 +0100")

[-- Attachment #1: Type: text/plain, Size: 642 bytes --]

Rasmus <rasmus@gmx.us> 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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-ange-ftp.el-Disallow-more-dired-ls-flags.patch --]
[-- Type: text/x-diff, Size: 2545 bytes --]

From 6fd921e7d7deb88c5a3f172022b64a0539edbdd6 Mon Sep 17 00:00:00 2001
From: Rasmus <w530@pank.eu>
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  <emacs@pank.eu>
+
+	* 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  <stephen.berman@gmx.net>
 	    Stefan Monnier  <monnier@iro.umontreal.ca>
 
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


  reply	other threads:[~2014-11-29 12:21 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-26 12:03 bug#19192: 25.0.50; TRAMP uses `dired-listing-switches' for ftp-connection Rasmus
2014-11-26 13:35 ` Michael Albinus
2014-11-26 23:45   ` Rasmus
2014-11-29 10:42     ` Michael Albinus
2014-11-29 11:16       ` Rasmus
2014-11-29 12:21         ` Rasmus [this message]
2014-11-29 12:47           ` Rasmus
2014-11-30 11:10         ` Michael Albinus
2014-11-30 12:43           ` Rasmus
2014-12-09 13:56             ` Michael Albinus
2014-12-10 13:16               ` Rasmus
2014-12-10 14:15                 ` Andreas Schwab
2014-12-10 15:28                   ` Rasmus
2014-12-10 16:49                     ` Michael Albinus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87iohyfb8a.fsf@gmx.us \
    --to=rasmus@gmx.us \
    --cc=19192@debbugs.gnu.org \
    --cc=michael.albinus@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).