From 524ac5b25a6a3cd21afa27280ca4eebb0a065d4b Mon Sep 17 00:00:00 2001 From: Gerd Moellmann Date: Mon, 9 Jul 2001 08:58:38 +0000 Subject: [PATCH] (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. --- lisp/ChangeLog | 9 ++++++++- lisp/net/ange-ftp.el | 8 ++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 289d6af3cd2..285c04bd078 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,4 +1,11 @@ -Mon Jul 09 2001 Martin Stjernholm +2001-07-09 Gerd Moellmann + + * net/ange-ftp.el (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. + +2001-07-09 Martin Stjernholm * cc-cmds.el: Extended the kludge to interoperate with the delsel and pending-del packages wrt to the new function diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el index 10b03a474cf..fb2f8120c4c 100644 --- a/lisp/net/ange-ftp.el +++ b/lisp/net/ange-ftp.el @@ -3437,8 +3437,12 @@ Value is (0 0) if the modification time cannot be determined." (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)) -- 2.11.4.GIT