[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master bdc373b: (ange-ftp-switches-ok): Disallow flags cau
From: |
Michael Albinus |
Subject: |
[Emacs-diffs] master bdc373b: (ange-ftp-switches-ok): Disallow flags causing trouble with ls over ftp. |
Date: |
Wed, 10 Dec 2014 16:50:53 +0000 |
branch: master
commit bdc373bf456de464b44836b11826705c0aef70b1
Author: Rasmus Pank Roulund <address@hidden>
Commit: Michael Albinus <address@hidden>
(ange-ftp-switches-ok): Disallow flags causing trouble with ls over ftp.
Fixes: debbugs:19192
* 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.
---
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..53c03e0 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
+2014-12-10 Rasmus Pank Roulund <address@hidden>
+
+ * 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 <address@hidden>
* 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)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master bdc373b: (ange-ftp-switches-ok): Disallow flags causing trouble with ls over ftp.,
Michael Albinus <=