summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2008-01-29 03:52:05 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-01-29 03:52:05 +0000
commite652840bf703a633979983552556434f6753397b (patch)
treeaab1670a70c863b3dbaca045b7bcdeb0d233c54b /lisp
parent548667aad86a5e07e5ac96b832dcd10c5e6eb4c6 (diff)
downloademacs-e652840bf703a633979983552556434f6753397b.tar.gz
2008-01-29 John Wiegley <johnw@newartisans.com>
* url-auth.el (url-digest-auth): If the 'opaque' argument is not being used, don't add it to the response text. Also, changed an if so that the interaction between the PROMPT and OVERWRITE arguments can no longer result in the user being queried twice for the same login and password information.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/url/ChangeLog8
-rw-r--r--lisp/url/url-auth.el51
2 files changed, 38 insertions, 21 deletions
diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog
index 124f3fc9974..3a70b5343a0 100644
--- a/lisp/url/ChangeLog
+++ b/lisp/url/ChangeLog
@@ -1,3 +1,11 @@
+2008-01-29 John Wiegley <johnw@newartisans.com>
+
+ * url-auth.el (url-digest-auth): If the 'opaque' argument is not
+ being used, don't add it to the response text. Also, changed an
+ if so that the interaction between the PROMPT and OVERWRITE
+ arguments can no longer result in the user being queried twice for
+ the same login and password information.
+
2008-01-21 Stefan Monnier <monnier@iro.umontreal.ca>
* url-handlers.el (unhandled-file-name-directory): Add handler.
diff --git a/lisp/url/url-auth.el b/lisp/url/url-auth.el
index ea96bb08129..ed1a79260ee 100644
--- a/lisp/url/url-auth.el
+++ b/lisp/url/url-auth.el
@@ -188,31 +188,40 @@ instead of hostname:portnum."
(string= data (substring file 0 (length data)))))
(setq retval (cdr (car byserv))))
(setq byserv (cdr byserv))))
- (if (or (and (not retval) prompt) overwrite)
- (progn
- (setq user (read-string (url-auth-user-prompt url realm)
- (user-real-login-name))
- pass (read-passwd "Password: ")
- retval (setq retval
- (cons user
- (url-digest-auth-create-key
- user pass realm
- (or url-request-method "GET")
- url)))
- byserv (assoc server url-digest-auth-storage))
+ (if overwrite
+ (if (and (not retval) prompt)
+ (setq user (read-string (url-auth-user-prompt url realm)
+ (user-real-login-name))
+ pass (read-passwd "Password: ")
+ retval (setq retval
+ (cons user
+ (url-digest-auth-create-key
+ user pass realm
+ (or url-request-method "GET")
+ url)))
+ byserv (assoc server url-digest-auth-storage))
(setcdr byserv
(cons (cons file retval) (cdr byserv))))))
(t (setq retval nil)))
(if retval
- (let ((nonce (or (cdr-safe (assoc "nonce" args)) "nonegiven"))
- (opaque (or (cdr-safe (assoc "opaque" args)) "nonegiven")))
- (format
- (concat "Digest username=\"%s\", realm=\"%s\","
- "nonce=\"%s\", uri=\"%s\","
- "response=\"%s\", opaque=\"%s\"")
- (nth 0 retval) realm nonce (url-filename href)
- (md5 (concat (nth 1 retval) ":" nonce ":"
- (nth 2 retval))) opaque))))))
+ (if (cdr-safe (assoc "opaque" args))
+ (let ((nonce (or (cdr-safe (assoc "nonce" args)) "nonegiven"))
+ (opaque (cdr-safe (assoc "opaque" args))))
+ (format
+ (concat "Digest username=\"%s\", realm=\"%s\","
+ "nonce=\"%s\", uri=\"%s\","
+ "response=\"%s\", opaque=\"%s\"")
+ (nth 0 retval) realm nonce (url-filename href)
+ (md5 (concat (nth 1 retval) ":" nonce ":"
+ (nth 2 retval))) opaque))
+ (let ((nonce (or (cdr-safe (assoc "nonce" args)) "nonegiven")))
+ (format
+ (concat "Digest username=\"%s\", realm=\"%s\","
+ "nonce=\"%s\", uri=\"%s\","
+ "response=\"%s\"")
+ (nth 0 retval) realm nonce (url-filename href)
+ (md5 (concat (nth 1 retval) ":" nonce ":"
+ (nth 2 retval))))))))))
(defvar url-registered-auth-schemes nil
"A list of the registered authorization schemes and various and sundry