From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: owner@emacsbugs.donarmstrong.com (Emacs bug Tracking System) Newsgroups: gmane.emacs.bugs Subject: bug#4883: marked as done (23.1; url-http: wrong server name used for pwd lookup during proxy authentication) Date: Sun, 08 Nov 2009 05:40:07 +0000 Message-ID: References: <87fx8pmvgj.fsf@stupidchicken.com> <82bpje5zne.wl%kai.tetzlaff@web.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----------=_1257658807-21204-0" X-Trace: ger.gmane.org 1257659275 5018 80.91.229.12 (8 Nov 2009 05:47:55 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 8 Nov 2009 05:47:55 +0000 (UTC) To: Chong Yidong Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Nov 08 06:47:48 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 1N70cr-0007Pn-Kg for geb-bug-gnu-emacs@m.gmane.org; Sun, 08 Nov 2009 06:47:47 +0100 Original-Received: from localhost ([127.0.0.1]:57520 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N70cr-0004NM-7F for geb-bug-gnu-emacs@m.gmane.org; Sun, 08 Nov 2009 00:47:45 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N70cY-0004HU-Ur for bug-gnu-emacs@gnu.org; Sun, 08 Nov 2009 00:47:27 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N70cU-0004GM-0c for bug-gnu-emacs@gnu.org; Sun, 08 Nov 2009 00:47:26 -0500 Original-Received: from [199.232.76.173] (port=33902 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N70cT-0004Fs-EZ for bug-gnu-emacs@gnu.org; Sun, 08 Nov 2009 00:47:21 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:40813) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1N70cS-0001Ft-MR for bug-gnu-emacs@gnu.org; Sun, 08 Nov 2009 00:47:21 -0500 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nA85lHvt021980; Sat, 7 Nov 2009 21:47:18 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id nA85e73N021251; Sat, 7 Nov 2009 21:40:07 -0800 X-Mailer: MIME-tools 5.427 (Entity 5.427) X-Loop: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: closed 4883 X-Emacs-PR-Package: emacs X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) 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:32477 Archived-At: This is a multi-part message in MIME format... ------------=_1257658807-21204-0 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Your message dated Sun, 08 Nov 2009 00:33:48 -0500 with message-id <87fx8pmvgj.fsf@stupidchicken.com> and subject line Re: 23.1; url-http: wrong server name used for pwd lookup = during proxy authentication has caused the Emacs bug report #4883, regarding 23.1; url-http: wrong server name used for pwd lookup during prox= y authentication to be marked as done. This means that you claim that the problem has been dealt with. If this is not the case it is now your responsibility to reopen the bug report if necessary, and/or fix the problem forthwith. (NB: If you are a system administrator and have no idea what this message is talking about, this may indicate a serious mail system misconfiguration somewhere. Please contact owner@emacsbugs.donarmstrong.com immediately.) --=20 4883: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=3D4883 Emacs Bug Tracking System Contact owner@emacsbugs.donarmstrong.com with problems ------------=_1257658807-21204-0 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by emacsbugs.donarmstrong.com; 7 Nov 2009 11:43:26 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.1 required=4.0 tests=FOURLA,MURPHY_DRUGS_REL8 autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nA7BhOWD026228 for ; Sat, 7 Nov 2009 03:43:25 -0800 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N6jhT-0007ZJ-9Z for bug-gnu-emacs@gnu.org; Sat, 07 Nov 2009 06:43:23 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N6jhN-0007XL-0r for bug-gnu-emacs@gnu.org; Sat, 07 Nov 2009 06:43:20 -0500 Received: from [199.232.76.173] (port=59415 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N6jhL-0007Wq-8U for bug-gnu-emacs@gnu.org; Sat, 07 Nov 2009 06:43:15 -0500 Received: from moutng.kundenserver.de ([212.227.126.186]:64116) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N6jhK-0000LW-HW for bug-gnu-emacs@gnu.org; Sat, 07 Nov 2009 06:43:14 -0500 Received: from mail.tetzco.de (ppp-88-217-4-103.dynamic.mnet-online.de [88.217.4.103]) by mrelayeu.kundenserver.de (node=mreu0) with ESMTP (Nemesis) id 0M371n-1MFBF11NUl-00sWJr; Sat, 07 Nov 2009 12:43:12 +0100 Received: from localhost (localhost [127.0.0.1]) by mail.tetzco.de (Postfix) with ESMTP id AD5FFDA1DCF for ; Sat, 7 Nov 2009 12:43:11 +0100 (CET) X-Virus-Scanned: amavisd-new at tetzco.de Received: from mail.tetzco.de ([127.0.0.1]) by localhost (cubik.tetzco.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HpdKA-dg4A8l for ; Sat, 7 Nov 2009 12:43:06 +0100 (CET) Received: from MOKA.tetzco.de (moka.tetzco.de [10.1.10.31]) by mail.tetzco.de (Postfix) with ESMTP id 0D00CDA1DB8 for ; Sat, 7 Nov 2009 12:43:06 +0100 (CET) Date: Sat, 07 Nov 2009 12:43:01 +0100 Message-ID: <82bpje5zne.wl%kai.tetzlaff@web.de> From: Kai Tetzlaff To: bug-gnu-emacs@gnu.org Subject: 23.1; url-http: wrong server name used for pwd lookup during proxy authentication User-Agent: Wanderlust/2.15.7 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.7 Emacs/23.1 (i386-mingw-nt5.1.2600) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Provags-ID: V01U2FsdGVkX1+e3egDUpaztn+HY7RpkvHz9W6AJZdx/UKabTH hM1Da3R2kbsQzfrF/RXPHfHGdeDaM4JbSlp3IUlsFO+66ItbWs LqnRs/jF8zYaIEtEDgP2g== X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Please write in English if possible, because the Emacs maintainers usually do not have translators to read other languages for them. Your bug report will be posted to the bug-gnu-emacs@gnu.org mailing list, and to the gnu.emacs.bug news group. Please describe exactly what actions triggered the bug and the precise symptoms of the bug: The following describes a problem with password lookup which happens when trying to download an HTTP document through a proxy server when this proxy server requires users to authenticate. When trying to find credentials, the URL lib is using the name of the server in the original download URL instead of the name of the proxy server for the username/password lookup. I've tried to analyze what's happening and also have a patch (at the end of this bug report). But now some more details: Even though this report describes what i believe is a bug in the url lib, let me first explain shortly what i've been doing when i discovered the problem: I've been trying out the irfc package (http://www.emacswiki.org/emacs/irfc.el) to download RFCs from emacs. At work i can only access the web via an HTTP proxy server which requires (http basic) authentication. Using: (setq url-proxy-services '(("http" . "proxy.example.net:80"))) i then tried to download rfc3098 using irfc-visit. Irfc-visit subsequently calls url-retrieve with the result of: (url-generic-parse-url "http://www.ietf.org/rfc/rfc3098.txt") The functions in the url.el and friends start doing their work. A GET request gets sent to the proxy server which is answered with a 407 response asking for authentication. The URL lib detects the authentication request and tries to obtain the required credentials. This is done by calling: ... url-get-authentication (url-auth.el) url-basic-auth (url-auth.el) and finally: auth-source-user-or-password (auth-source.el) which uses the name of the server which asks for authentication (and a protocol identifier) to check if a login/password is stored somewhere (in my case: ~/authinfo.gpg). However, the lookup is using www.ietf.org to lookup the password instead of the name of the proxy server (proxy.example.net). So the lookup fails. The following patch tries to fix proxy authentication in url-http-handle-authentication. It is adding a new variable auth-url which gets set to the proxy url or the original download URL depending on the use of a proxy server. This new variable is then used in the call to url-get-authentication (instead of always using the original download URL). There might be a better solution from someone who has a deeper understanding of the code in the url lib. But the following solves the problem - at least for my case: Index: lisp/url/url-http.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/url/url-http.el,v retrieving revision 1.64 diff -u -r1.64 url-http.el --- lisp/url/url-http.el 1 Oct 2009 02:06:55 -0000 1.64 +++ lisp/url/url-http.el 6 Nov 2009 10:25:02 -0000 @@ -315,12 +315,16 @@ '("basic"))) (type nil) (url (url-recreate-url url-current-object)) - (url-basic-auth-storage 'url-http-real-basic-auth-storage) + (auth-url (url-recreate-url + (if (and proxy (boundp 'url-http-proxy)) + url-http-proxy + url-current-object))) + (url-basic-auth-storage (if proxy + ;; Cheating, but who cares? :) + 'url-http-proxy-basic-auth-storage + 'url-http-real-basic-auth-storage)) auth (strength 0)) - ;; Cheating, but who cares? :) - (if proxy - (setq url-basic-auth-storage 'url-http-proxy-basic-auth-storage)) ;; find strongest supported auth (dolist (this-auth auths) @@ -347,7 +351,7 @@ " send it to " url-bug-address ".
") (setq status t)) (let* ((args (url-parse-args (subst-char-in-string ?, ?\; auth))) - (auth (url-get-authentication url (cdr-safe (assoc "realm" args)) + (auth (url-get-authentication auth-url (cdr-safe (assoc "realm" args)) type t args))) (if (not auth) (setq success t) If Emacs crashed, and you have the Emacs process in the gdb debugger, please include the output from the following gdb commands: `bt full' and `xbacktrace'. If you would like to further debug the crash, please read the file c:/Programme/emacs-23.1/etc/DEBUG for instructions. In GNU Emacs 23.1.1 (i386-mingw-nt5.1.2600) of 2009-07-30 on SOFT-MJASON Windowing system distributor `Microsoft Corp.', version 5.1.2600 configured using `configure --with-gcc (4.4)' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: DEU value of $XMODIFIERS: nil locale-coding-system: cp1252 default-enable-multibyte-characters: t Major mode: Lisp Interaction Minor modes in effect: icicle-mode: t minibuffer-depth-indicate-mode: t shell-dirtrack-mode: t icomplete-mode: t pretty-control-l-mode: t delete-selection-mode: t show-paren-mode: t global-auto-revert-mode: t display-time-mode: t tooltip-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t global-auto-composition-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t size-indication-mode: t column-number-mode: t line-number-mode: t transient-mark-mode: t Recent input: Recent messages: Turning OFF Icicle mode...done ad-handle-definition: `choose-completion-string' got redefined Turning ON Icicle mode...done ad-handle-definition: `choose-completion-string' got redefined Turning OFF Icicle mode...done Loading c:/kt/.emacs.d/init/rc/rc-misc.el (source)...done Loading c:/kt/.emacs.d/tmp/session.el (source)...done ad-handle-definition: `choose-completion-string' got redefined Turning ON Icicle mode...done Finished .emacs ------------=_1257658807-21204-0 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 4883-done) by emacsbugs.donarmstrong.com; 8 Nov 2009 05:33:59 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-0.7 required=4.0 tests=AWL,MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from pantheon-po44.its.yale.edu (pantheon-po44.its.yale.edu [130.132.50.78]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nA85Xwwa020666 for <4883-done@emacsbugs.donarmstrong.com>; Sat, 7 Nov 2009 21:33:59 -0800 Received: from furry (adsl-99-58-202-243.dsl.wlfrct.sbcglobal.net [99.58.202.243]) (authenticated bits=0) by pantheon-po44.its.yale.edu (8.12.11.20060308/8.12.11) with ESMTP id nA85Xno7032074 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sun, 8 Nov 2009 00:33:52 -0500 Received: by furry (Postfix, from userid 1000) id A6ADDC070; Sun, 8 Nov 2009 00:33:48 -0500 (EST) From: Chong Yidong To: Kai Tetzlaff Cc: 4883-done@emacsbugs.donarmstrong.com Subject: Re: 23.1; url-http: wrong server name used for pwd lookup during proxy authentication Date: Sun, 08 Nov 2009 00:33:48 -0500 Message-ID: <87fx8pmvgj.fsf@stupidchicken.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-YaleITSMailFilter: Version 1.2c (attachment(s) not renamed) > The following patch tries to fix proxy authentication in > url-http-handle-authentication. It is adding a new variable auth-url > which gets set to the proxy url or the original download URL depending > on the use of a proxy server. This new variable is then used in the > call to url-get-authentication (instead of always using the original > download URL). The patch looks good. I've checked it into CVS; thanks. ------------=_1257658807-21204-0--