# HG changeset patch # User John Wiegley # Date 1201578725 0 # Node ID eae3aec0f807930bb379b03e2b562192f296fc3c # Parent 04b0cba247d8d3f6d306913da4653ed4a8c47a4a 2008-01-29 John Wiegley * 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. diff -r 04b0cba247d8 -r eae3aec0f807 lisp/url/ChangeLog --- a/lisp/url/ChangeLog Mon Jan 28 23:23:48 2008 +0000 +++ b/lisp/url/ChangeLog Tue Jan 29 03:52:05 2008 +0000 @@ -1,3 +1,11 @@ +2008-01-29 John Wiegley + + * 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 * url-handlers.el (unhandled-file-name-directory): Add handler. diff -r 04b0cba247d8 -r eae3aec0f807 lisp/url/url-auth.el --- a/lisp/url/url-auth.el Mon Jan 28 23:23:48 2008 +0000 +++ b/lisp/url/url-auth.el Tue Jan 29 03:52:05 2008 +0000 @@ -188,31 +188,40 @@ (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