From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ted Zlatanov Newsgroups: gmane.emacs.bugs Subject: Re: bug#4883: 23.1; url-http: wrong server name used for pwd lookup during proxy authentication Date: Tue, 10 Nov 2009 14:07:39 -0600 Organization: =?utf-8?B?0KLQtdC+0LTQvtGAINCX0LvQsNGC0LDQvdC+0LI=?= @ Cienfuegos Message-ID: <87vdhinnxw.fsf@lifelogs.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1257886034 22362 80.91.229.12 (10 Nov 2009 20:47:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 10 Nov 2009 20:47:14 +0000 (UTC) Cc: Kai Tetzlaff To: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Nov 10 21:47:07 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1N7xcH-00085k-UI for geb-bug-gnu-emacs@m.gmane.org; Tue, 10 Nov 2009 21:47:06 +0100 Original-Received: from localhost ([127.0.0.1]:54997 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N7xcE-0006OB-7Z for geb-bug-gnu-emacs@m.gmane.org; Tue, 10 Nov 2009 15:47:02 -0500 Original-Path: news.stanford.edu!usenet.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!news2.euro.net!newsfeed.freenet.de!news.albasani.net!not-for-mail Original-Newsgroups: gnu.emacs.bug Original-Lines: 49 Original-X-Trace: news.albasani.net CeeDeOQn2ShvLbwII8FM2MBcpA0v+UylmA3yez79IAMiw46vYzd2jgQc9pqtRrCz8VG5MaS9PJ7O6dxJa75rdN0Ep7vh161K4D9KXmzG981W5mannDFqTYs5FvELn+Av Original-X-Complaints-To: abuse@albasani.net Original-NNTP-Posting-Date: Tue, 10 Nov 2009 20:07:40 +0000 (UTC) X-User-ID: z4vQ11y/GzeK9q8DxFkz61XY4X2lx7ez/nCsoHVuku0= X-Face: bd.DQ~'29fIs`T_%O%C\g%6jW)yi[zuz6; d4V0`@y-~$#3P_Ng{@m+e4o<4P'#(_GJQ%TT= D}[Ep*b!\e,fBZ'j_+#"Ps?s2!4H2-Y"sx" Cancel-Lock: sha1:yFK4b5O9ovBnMhTAt0Y4ycE+fNM= sha1:Cl2ZQSkb+0B2E8xL5TsxNwPolaA= User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1.50 (gnu/linux) X-NNTP-Posting-Host: dEAg9afEVzK8HKRFdOf6fpBpght71lWTg7tr6KwPjTE= Original-Xref: news.stanford.edu gnu.emacs.bug:60854 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:32527 Archived-At: On Sat, 07 Nov 2009 12:43:01 +0100 Kai Tetzlaff wrote: KT> There might be a better solution from someone who has a deeper understanding KT> of the code in the url lib. But the following solves the problem - at least KT> for my case: KT> Index: lisp/url/url-http.el KT> =================================================================== KT> RCS file: /cvsroot/emacs/emacs/lisp/url/url-http.el,v KT> retrieving revision 1.64 KT> diff -u -r1.64 url-http.el KT> --- lisp/url/url-http.el 1 Oct 2009 02:06:55 -0000 1.64 KT> +++ lisp/url/url-http.el 6 Nov 2009 10:25:02 -0000 KT> @@ -315,12 +315,16 @@ KT> '("basic"))) KT> (type nil) KT> (url (url-recreate-url url-current-object)) KT> - (url-basic-auth-storage 'url-http-real-basic-auth-storage) KT> + (auth-url (url-recreate-url KT> + (if (and proxy (boundp 'url-http-proxy)) KT> + url-http-proxy KT> + url-current-object))) KT> + (url-basic-auth-storage (if proxy KT> + ;; Cheating, but who cares? :) KT> + 'url-http-proxy-basic-auth-storage KT> + 'url-http-real-basic-auth-storage)) KT> auth KT> (strength 0)) KT> - ;; Cheating, but who cares? :) KT> - (if proxy KT> - (setq url-basic-auth-storage 'url-http-proxy-basic-auth-storage)) KT> ;; find strongest supported auth KT> (dolist (this-auth auths) KT> @@ -347,7 +351,7 @@ KT> " send it to " url-bug-address ".
") KT> (setq status t)) KT> (let* ((args (url-parse-args (subst-char-in-string ?, ?\; auth))) KT> - (auth (url-get-authentication url (cdr-safe (assoc "realm" args)) KT> + (auth (url-get-authentication auth-url (cdr-safe (assoc "realm" args)) KT> type t args))) KT> (if (not auth) KT> (setq success t) I introduced the auth-source hooks in url-http.el but the question of which URL needs to be authenticated is not something I considered. Can we hook the auth at a lower point? I'm concerned that if the proxy and the destination URL both need authentication, your proposal won't work. Ted