diff options
| author | Richard M. Stallman | 2007-10-13 14:03:25 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2007-10-13 14:03:25 +0000 |
| commit | ff51e86df1da6ea87c81eb61f26ba58d4a11dd4d (patch) | |
| tree | e58e2dc84b790e5a51bbbc76ab04a2b682c5e89b | |
| parent | 76fb5862cd8e4b629259544fa7a9a02476663a66 (diff) | |
| download | emacs-ff51e86df1da6ea87c81eb61f26ba58d4a11dd4d.tar.gz emacs-ff51e86df1da6ea87c81eb61f26ba58d4a11dd4d.zip | |
(url-digest-auth, url-basic-auth):
Rename `path' to `file'. Use `url-file-directory'.
| -rw-r--r-- | lisp/url/url-auth.el | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/lisp/url/url-auth.el b/lisp/url/url-auth.el index b2de802cbad..c6fe270900b 100644 --- a/lisp/url/url-auth.el +++ b/lisp/url/url-auth.el | |||
| @@ -61,22 +61,22 @@ If optional argument PROMPT is non-nil, ask for the username/password | |||
| 61 | to use for the url and its descendants. If optional third argument | 61 | to use for the url and its descendants. If optional third argument |
| 62 | OVERWRITE is non-nil, overwrite the old username/password pair if it | 62 | OVERWRITE is non-nil, overwrite the old username/password pair if it |
| 63 | is found in the assoc list. If REALM is specified, use that as the realm | 63 | is found in the assoc list. If REALM is specified, use that as the realm |
| 64 | instead of the pathname inheritance method." | 64 | instead of the filename inheritance method." |
| 65 | (let* ((href (if (stringp url) | 65 | (let* ((href (if (stringp url) |
| 66 | (url-generic-parse-url url) | 66 | (url-generic-parse-url url) |
| 67 | url)) | 67 | url)) |
| 68 | (server (url-host href)) | 68 | (server (url-host href)) |
| 69 | (port (url-port href)) | 69 | (port (url-port href)) |
| 70 | (path (url-filename href)) | 70 | (file (url-filename href)) |
| 71 | (user (url-user href)) | 71 | (user (url-user href)) |
| 72 | (pass (url-password href)) | 72 | (pass (url-password href)) |
| 73 | byserv retval data) | 73 | byserv retval data) |
| 74 | (setq server (format "%s:%d" server port) | 74 | (setq server (format "%s:%d" server port) |
| 75 | path (cond | 75 | file (cond |
| 76 | (realm realm) | 76 | (realm realm) |
| 77 | ((string= "" path) "/") | 77 | ((string= "" file) "/") |
| 78 | ((string-match "/$" path) path) | 78 | ((string-match "/$" file) file) |
| 79 | (t (url-basepath path))) | 79 | (t (url-file-directory file))) |
| 80 | byserv (cdr-safe (assoc server | 80 | byserv (cdr-safe (assoc server |
| 81 | (symbol-value url-basic-auth-storage)))) | 81 | (symbol-value url-basic-auth-storage)))) |
| 82 | (cond | 82 | (cond |
| @@ -86,21 +86,21 @@ instead of the pathname inheritance method." | |||
| 86 | pass (read-passwd "Password: " nil (or pass ""))) | 86 | pass (read-passwd "Password: " nil (or pass ""))) |
| 87 | (set url-basic-auth-storage | 87 | (set url-basic-auth-storage |
| 88 | (cons (list server | 88 | (cons (list server |
| 89 | (cons path | 89 | (cons file |
| 90 | (setq retval | 90 | (setq retval |
| 91 | (base64-encode-string | 91 | (base64-encode-string |
| 92 | (format "%s:%s" user pass))))) | 92 | (format "%s:%s" user pass))))) |
| 93 | (symbol-value url-basic-auth-storage)))) | 93 | (symbol-value url-basic-auth-storage)))) |
| 94 | (byserv | 94 | (byserv |
| 95 | (setq retval (cdr-safe (assoc path byserv))) | 95 | (setq retval (cdr-safe (assoc file byserv))) |
| 96 | (if (and (not retval) | 96 | (if (and (not retval) |
| 97 | (string-match "/" path)) | 97 | (string-match "/" file)) |
| 98 | (while (and byserv (not retval)) | 98 | (while (and byserv (not retval)) |
| 99 | (setq data (car (car byserv))) | 99 | (setq data (car (car byserv))) |
| 100 | (if (or (not (string-match "/" data)) ; It's a realm - take it! | 100 | (if (or (not (string-match "/" data)) ; It's a realm - take it! |
| 101 | (and | 101 | (and |
| 102 | (>= (length path) (length data)) | 102 | (>= (length file) (length data)) |
| 103 | (string= data (substring path 0 (length data))))) | 103 | (string= data (substring file 0 (length data))))) |
| 104 | (setq retval (cdr (car byserv)))) | 104 | (setq retval (cdr (car byserv)))) |
| 105 | (setq byserv (cdr byserv)))) | 105 | (setq byserv (cdr byserv)))) |
| 106 | (if (or (and (not retval) prompt) overwrite) | 106 | (if (or (and (not retval) prompt) overwrite) |
| @@ -111,7 +111,7 @@ instead of the pathname inheritance method." | |||
| 111 | retval (base64-encode-string (format "%s:%s" user pass)) | 111 | retval (base64-encode-string (format "%s:%s" user pass)) |
| 112 | byserv (assoc server (symbol-value url-basic-auth-storage))) | 112 | byserv (assoc server (symbol-value url-basic-auth-storage))) |
| 113 | (setcdr byserv | 113 | (setcdr byserv |
| 114 | (cons (cons path retval) (cdr byserv)))))) | 114 | (cons (cons file retval) (cdr byserv)))))) |
| 115 | (t (setq retval nil))) | 115 | (t (setq retval nil))) |
| 116 | (if retval (setq retval (concat "Basic " retval))) | 116 | (if retval (setq retval (concat "Basic " retval))) |
| 117 | retval)) | 117 | retval)) |
| @@ -153,12 +153,12 @@ instead of hostname:portnum." | |||
| 153 | url)) | 153 | url)) |
| 154 | (server (url-host href)) | 154 | (server (url-host href)) |
| 155 | (port (url-port href)) | 155 | (port (url-port href)) |
| 156 | (path (url-filename href)) | 156 | (file (url-filename href)) |
| 157 | user pass byserv retval data) | 157 | user pass byserv retval data) |
| 158 | (setq path (cond | 158 | (setq file (cond |
| 159 | (realm realm) | 159 | (realm realm) |
| 160 | ((string-match "/$" path) path) | 160 | ((string-match "/$" file) file) |
| 161 | (t (url-basepath path))) | 161 | (t (url-file-directory file))) |
| 162 | server (format "%s:%d" server port) | 162 | server (format "%s:%d" server port) |
| 163 | byserv (cdr-safe (assoc server url-digest-auth-storage))) | 163 | byserv (cdr-safe (assoc server url-digest-auth-storage))) |
| 164 | (cond | 164 | (cond |
| @@ -168,7 +168,7 @@ instead of hostname:portnum." | |||
| 168 | pass (read-passwd "Password: ") | 168 | pass (read-passwd "Password: ") |
| 169 | url-digest-auth-storage | 169 | url-digest-auth-storage |
| 170 | (cons (list server | 170 | (cons (list server |
| 171 | (cons path | 171 | (cons file |
| 172 | (setq retval | 172 | (setq retval |
| 173 | (cons user | 173 | (cons user |
| 174 | (url-digest-auth-create-key | 174 | (url-digest-auth-create-key |
| @@ -177,15 +177,15 @@ instead of hostname:portnum." | |||
| 177 | url))))) | 177 | url))))) |
| 178 | url-digest-auth-storage))) | 178 | url-digest-auth-storage))) |
| 179 | (byserv | 179 | (byserv |
| 180 | (setq retval (cdr-safe (assoc path byserv))) | 180 | (setq retval (cdr-safe (assoc file byserv))) |
| 181 | (if (and (not retval) ; no exact match, check directories | 181 | (if (and (not retval) ; no exact match, check directories |
| 182 | (string-match "/" path)) ; not looking for a realm | 182 | (string-match "/" file)) ; not looking for a realm |
| 183 | (while (and byserv (not retval)) | 183 | (while (and byserv (not retval)) |
| 184 | (setq data (car (car byserv))) | 184 | (setq data (car (car byserv))) |
| 185 | (if (or (not (string-match "/" data)) | 185 | (if (or (not (string-match "/" data)) |
| 186 | (and | 186 | (and |
| 187 | (>= (length path) (length data)) | 187 | (>= (length file) (length data)) |
| 188 | (string= data (substring path 0 (length data))))) | 188 | (string= data (substring file 0 (length data))))) |
| 189 | (setq retval (cdr (car byserv)))) | 189 | (setq retval (cdr (car byserv)))) |
| 190 | (setq byserv (cdr byserv)))) | 190 | (setq byserv (cdr byserv)))) |
| 191 | (if (or (and (not retval) prompt) overwrite) | 191 | (if (or (and (not retval) prompt) overwrite) |
| @@ -201,7 +201,7 @@ instead of hostname:portnum." | |||
| 201 | url))) | 201 | url))) |
| 202 | byserv (assoc server url-digest-auth-storage)) | 202 | byserv (assoc server url-digest-auth-storage)) |
| 203 | (setcdr byserv | 203 | (setcdr byserv |
| 204 | (cons (cons path retval) (cdr byserv)))))) | 204 | (cons (cons file retval) (cdr byserv)))))) |
| 205 | (t (setq retval nil))) | 205 | (t (setq retval nil))) |
| 206 | (if retval | 206 | (if retval |
| 207 | (let ((nonce (or (cdr-safe (assoc "nonce" args)) "nonegiven")) | 207 | (let ((nonce (or (cdr-safe (assoc "nonce" args)) "nonegiven")) |