diff options
| author | Richard M. Stallman | 2001-12-29 00:46:26 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2001-12-29 00:46:26 +0000 |
| commit | 1d0653f8b67e64aaf57349020d9999e0dbe7aaeb (patch) | |
| tree | 2d47068a40174061deebeb9c1859228b1209bd48 | |
| parent | 6a48af06dfd677cd39ffa79774179367a7b99fbe (diff) | |
| download | emacs-1d0653f8b67e64aaf57349020d9999e0dbe7aaeb.tar.gz emacs-1d0653f8b67e64aaf57349020d9999e0dbe7aaeb.zip | |
(ange-ftp-allow-child-lookup): Always return nil.
This fixes a bug that treated all files as directories.
| -rw-r--r-- | lisp/ChangeLog | 11 | ||||
| -rw-r--r-- | lisp/net/ange-ftp.el | 78 |
2 files changed, 63 insertions, 26 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9ed3e9036cd..0a543e6491d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,16 @@ | |||
| 1 | 2001-12-28 Richard M. Stallman <rms@gnu.org> | 1 | 2001-12-28 Richard M. Stallman <rms@gnu.org> |
| 2 | 2 | ||
| 3 | * net/ange-ftp.el (ange-ftp-allow-child-lookup): Always return nil. | ||
| 4 | This fixes a bug that treated all files as directories. | ||
| 5 | |||
| 6 | * international/iso-transl.el (iso-transl-char-map) Eliminate the | ||
| 7 | alias symbols--put the translated sequences here directly. | ||
| 8 | |||
| 9 | * progmodes/cc-mode.el (c-mode-abbrev-table) | ||
| 10 | (c++-mode-abbrev-table, objc-mode-abbrev-table) | ||
| 11 | (java-mode-abbrev-table, pike-mode-abbrev-table): | ||
| 12 | Mark all the predefined abbrevs as "system" abbrevs. | ||
| 13 | |||
| 3 | * mail/sendmail.el (mail-envelope-from): Fix custom type. | 14 | * mail/sendmail.el (mail-envelope-from): Fix custom type. |
| 4 | (sendmail-send-it): Check mail-specify-envelope-from | 15 | (sendmail-send-it): Check mail-specify-envelope-from |
| 5 | and mail-envelope-from in the mail buffer at start. | 16 | and mail-envelope-from in the mail buffer at start. |
diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el index 79f18afd2a8..4700a114f32 100644 --- a/lisp/net/ange-ftp.el +++ b/lisp/net/ange-ftp.el | |||
| @@ -937,12 +937,22 @@ Don't use any other value." | |||
| 937 | (const :tag "Allow" 1))) | 937 | (const :tag "Allow" 1))) |
| 938 | 938 | ||
| 939 | (defcustom ange-ftp-try-passive-mode nil | 939 | (defcustom ange-ftp-try-passive-mode nil |
| 940 | "It t, try to use passive mode in ftp, if the client program | 940 | "It t, try to use passive mode in ftp, if the client program supports it." |
| 941 | supports the `passive' command." | ||
| 942 | :group 'ange-ftp | 941 | :group 'ange-ftp |
| 943 | :type 'boolean | 942 | :type 'boolean |
| 944 | :version 21.1) | 943 | :version 21.1) |
| 945 | 944 | ||
| 945 | (defcustom ange-ftp-passive-host-alist nil | ||
| 946 | "Alist of FTP servers that need \"passive\" mode. | ||
| 947 | Each element is of the form (HOSTNAME . SETTING). | ||
| 948 | HOSTNAME is a regular expression to match the FTP server host name(s). | ||
| 949 | SETTING is \"on\" to turn passive mode on, \"off\" to turn it off, | ||
| 950 | or nil meaning don't change it." | ||
| 951 | :group 'ange-ftp | ||
| 952 | :type '(list (cons regex (choice (const :tag "On" "on") | ||
| 953 | (const :tag "Off" "off") | ||
| 954 | (const :tag "Don't change" nil)))) | ||
| 955 | :version 21.3) | ||
| 946 | 956 | ||
| 947 | ;;;; ------------------------------------------------------------ | 957 | ;;;; ------------------------------------------------------------ |
| 948 | ;;;; Hash table support. | 958 | ;;;; Hash table support. |
| @@ -2103,19 +2113,28 @@ Create a new process if needed." | |||
| 2103 | ;; Guess at the host type. | 2113 | ;; Guess at the host type. |
| 2104 | (ange-ftp-guess-host-type host user) | 2114 | (ange-ftp-guess-host-type host user) |
| 2105 | 2115 | ||
| 2106 | ;; Try to use passive mode if asked to. | 2116 | ;; Turn passive mode on or off as requested. |
| 2107 | (when ange-ftp-try-passive-mode | 2117 | (let* ((case-fold-search t) |
| 2108 | (let ((answer (cdr (ange-ftp-raw-send-cmd | 2118 | (passive |
| 2109 | proc "passive" "Trying passive mode..." nil)))) | 2119 | (or (assoc-default host ange-ftp-passive-host-alist |
| 2110 | (if (string-match "\\?\\|refused" answer) | 2120 | 'string-match) |
| 2111 | (message "Trying passive mode...ok") | 2121 | (if ange-ftp-try-passive-mode "on")))) |
| 2112 | (message "Trying passive mode...failed")))) | 2122 | (if passive |
| 2123 | (ange-ftp-passive-mode passive))) | ||
| 2113 | 2124 | ||
| 2114 | ;; Run any user-specified hooks. Note that proc, host and user are | 2125 | ;; Run any user-specified hooks. Note that proc, host and user are |
| 2115 | ;; dynamically bound at this point. | 2126 | ;; dynamically bound at this point. |
| 2116 | (run-hooks 'ange-ftp-process-startup-hook)) | 2127 | (run-hooks 'ange-ftp-process-startup-hook)) |
| 2117 | proc))) | 2128 | proc))) |
| 2118 | 2129 | ||
| 2130 | (defun ange-ftp-passive-mode (on-or-off) | ||
| 2131 | (if (string-match (concat "Passive mode " on-or-off) | ||
| 2132 | (cdr (ange-ftp-raw-send-cmd | ||
| 2133 | proc (concat "passive " on-or-off) | ||
| 2134 | "Trying passive mode..." nil))) | ||
| 2135 | (ange-ftp-message (concat "Trying passive mode..." on-or-off)) | ||
| 2136 | (error "Trying passive mode...failed"))) | ||
| 2137 | |||
| 2119 | ;; Variables for caching host and host-type | 2138 | ;; Variables for caching host and host-type |
| 2120 | (defvar ange-ftp-host-cache nil) | 2139 | (defvar ange-ftp-host-cache nil) |
| 2121 | (defvar ange-ftp-host-type-cache nil) | 2140 | (defvar ange-ftp-host-type-cache nil) |
| @@ -2789,24 +2808,31 @@ NO-ERROR, if a listing for DIRECTORY cannot be obtained." | |||
| 2789 | ;; 2. The syntax of FILE and DIR make it impossible that FILE could be a valid | 2808 | ;; 2. The syntax of FILE and DIR make it impossible that FILE could be a valid |
| 2790 | ;; subdirectory. This is of course an OS dependent judgement. | 2809 | ;; subdirectory. This is of course an OS dependent judgement. |
| 2791 | 2810 | ||
| 2811 | ;;; Nowadays, the judgement for #2 is always "no". | ||
| 2812 | ;;; With today's ftp servers on Unix and GNU systems, | ||
| 2813 | ;;; it appears to be impossible to tell from the result | ||
| 2814 | ;;; of the directory listing whether the argument is a directory. | ||
| 2815 | ;;; This appears to be true even in Emacs 20.7 | ||
| 2816 | |||
| 2792 | (defmacro ange-ftp-allow-child-lookup (dir file) | 2817 | (defmacro ange-ftp-allow-child-lookup (dir file) |
| 2793 | `(not | 2818 | nil) |
| 2794 | (let* ((efile ,file) ; expand once. | 2819 | ;;; `(not |
| 2795 | (edir ,dir) | 2820 | ;;; (let* ((efile ,file) ; expand once. |
| 2796 | (parsed (ange-ftp-ftp-name edir)) | 2821 | ;;; (edir ,dir) |
| 2797 | (host-type (ange-ftp-host-type | 2822 | ;;; (parsed (ange-ftp-ftp-name edir)) |
| 2798 | (car parsed)))) | 2823 | ;;; (host-type (ange-ftp-host-type |
| 2799 | (or | 2824 | ;;; (car parsed)))) |
| 2800 | ;; Deal with dired | 2825 | ;;; (or |
| 2801 | (and (boundp 'dired-local-variables-file) ; in the dired-x package | 2826 | ;;; ;; Deal with dired |
| 2802 | (stringp dired-local-variables-file) | 2827 | ;;; (and (boundp 'dired-local-variables-file) ; in the dired-x package |
| 2803 | (string-equal dired-local-variables-file efile)) | 2828 | ;;; (stringp dired-local-variables-file) |
| 2804 | ;; No dots in dir names in vms. | 2829 | ;;; (string-equal dired-local-variables-file efile)) |
| 2805 | (and (eq host-type 'vms) | 2830 | ;;; ;; No dots in dir names in vms. |
| 2806 | (string-match "\\." efile)) | 2831 | ;;; (and (eq host-type 'vms) |
| 2807 | ;; No subdirs in mts of cms. | 2832 | ;;; (string-match "\\." efile)) |
| 2808 | (and (memq host-type '(mts cms)) | 2833 | ;;; ;; No subdirs in mts of cms. |
| 2809 | (not (string-equal "/" (nth 2 parsed)))))))) | 2834 | ;;; (and (memq host-type '(mts cms)) |
| 2835 | ;;; (not (string-equal "/" (nth 2 parsed))))))) | ||
| 2810 | 2836 | ||
| 2811 | (defun ange-ftp-file-entry-p (name) | 2837 | (defun ange-ftp-file-entry-p (name) |
| 2812 | "Given NAME, return whether there is a file entry for it." | 2838 | "Given NAME, return whether there is a file entry for it." |