changeset 38328:3c2404604bae

(ange-ftp-file-modtime): Check a 213 response from the server for the format we expect. Don't use it if it doesn't look like what the Internet draft for FTP extensions specifies.
author Gerd Moellmann <gerd@gnu.org>
date Mon, 09 Jul 2001 08:57:36 +0000
parents e0de2b7e4d81
children 89886004ddba
files lisp/net/ange-ftp.el
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/net/ange-ftp.el	Mon Jul 09 00:49:22 2001 +0000
+++ b/lisp/net/ange-ftp.el	Mon Jul 09 08:57:36 2001 +0000
@@ -3437,8 +3437,12 @@
                                  (list 'quote "mdtm" (cadr (cdr parsed)))))
 	 (line (cdr res))
 	 (modtime '(0 0)))
-    (when (string-match "^213" line)
-	;; MDTM should return "213 YYYYMMDDhhmmss" GMT on success.
+    ;; MDTM should return "213 YYYYMMDDhhmmss" GMT on success
+    ;; following the Internet draft for FTP extensions.
+    ;; Bob@rattlesnake.com reports that is returns something different
+    ;; for at least one FTP server.  So, let's use the response only
+    ;; if it matches the Internet draft.
+    (when (string-match "^213 [0-9]\\{14\\}$" line)
       (setq modtime
 	    (encode-time
 	     (string-to-number (substring line 16 18))