From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jason Rumney Newsgroups: gmane.emacs.bugs Subject: bug#12069: 24.1.50; [url] bugs in authenticated proxy handling Date: Sat, 28 Jul 2012 01:09:02 +0800 Message-ID: <87d33hyvv5.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: dough.gmane.org 1343409083 3960 80.91.229.3 (27 Jul 2012 17:11:23 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 27 Jul 2012 17:11:23 +0000 (UTC) To: 12069@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jul 27 19:11:21 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Suo4N-0007Xy-Qn for geb-bug-gnu-emacs@m.gmane.org; Fri, 27 Jul 2012 19:11:20 +0200 Original-Received: from localhost ([::1]:53272 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Suo4M-0004dh-VT for geb-bug-gnu-emacs@m.gmane.org; Fri, 27 Jul 2012 13:11:18 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:58938) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Suo4F-0004dQ-1X for bug-gnu-emacs@gnu.org; Fri, 27 Jul 2012 13:11:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Suo48-0003nQ-JY for bug-gnu-emacs@gnu.org; Fri, 27 Jul 2012 13:11:10 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:34828) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Suo48-0003nF-FK for bug-gnu-emacs@gnu.org; Fri, 27 Jul 2012 13:11:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SuoAr-0004Cf-Ne for bug-gnu-emacs@gnu.org; Fri, 27 Jul 2012 13:18:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jason Rumney Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 27 Jul 2012 17:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 12069 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.134340945516117 (code B ref -1); Fri, 27 Jul 2012 17:18:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 27 Jul 2012 17:17:35 +0000 Original-Received: from localhost ([127.0.0.1]:44373 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SuoAQ-0004Bt-ME for submit@debbugs.gnu.org; Fri, 27 Jul 2012 13:17:35 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:35229) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SuoAN-0004Bm-Py for submit@debbugs.gnu.org; Fri, 27 Jul 2012 13:17:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Suo3Z-0003ff-KH for submit@debbugs.gnu.org; Fri, 27 Jul 2012 13:10:34 -0400 Original-Received: from lists.gnu.org ([208.118.235.17]:34614) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Suo3Z-0003fZ-Gk for submit@debbugs.gnu.org; Fri, 27 Jul 2012 13:10:29 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:58849) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Suo3X-0004d7-ST for bug-gnu-emacs@gnu.org; Fri, 27 Jul 2012 13:10:29 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Suo3V-0003eT-GX for bug-gnu-emacs@gnu.org; Fri, 27 Jul 2012 13:10:27 -0400 Original-Received: from mail-pb0-f41.google.com ([209.85.160.41]:44161) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Suo3V-0003e4-4V for bug-gnu-emacs@gnu.org; Fri, 27 Jul 2012 13:10:25 -0400 Original-Received: by pbbrp2 with SMTP id rp2so5880521pbb.0 for ; Fri, 27 Jul 2012 10:10:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:date:message-id:mime-version:content-type; bh=RmrzWvVoCo/QG88tiGBAKtcJxdcLkMrkEvmem0h94yE=; b=tyt/W6/oyvYalOj5iWFuGSuSMzw48xRBA0D0v28TWFJ/Ji7CsSsq5nJoxyt3e5sL2E 33yAb82fiIjj3Dph479xdaFYA9RC1B54IJqHnYMj7aVXqdamigcF1PKpEEDe4f7yIKNR 5f6hvWofj1CqN8NWRPZxSP1z/cQ1Y2WIk1ZBJ6PQ9ROpDO1PYNA/tJTFD1GP3cZgyFXr yPvc/clzQsB2i3oQCx+SMsiLV7q8U7z6TylyNM/vN/+IElg8OLQHhtoNBUG2M9p9yDSt 4AJJPmZubPGP3MEc8Oe7z1u8OKn7wxfxHnb4yLNytvEuYiJRTJGo6c9/DEJc5uuEdnT5 Ozhg== Original-Received: by 10.68.238.68 with SMTP id vi4mr15252177pbc.123.1343409024321; Fri, 27 Jul 2012 10:10:24 -0700 (PDT) Original-Received: from home.jasonrumney.net ([180.75.106.197]) by mx.google.com with ESMTPS id ka5sm2246343pbb.37.2012.07.27.10.10.08 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 27 Jul 2012 10:10:23 -0700 (PDT) Original-Received: by home.jasonrumney.net (Postfix, from userid 1000) id 3BDB729F6; Sat, 28 Jul 2012 01:09:02 +0800 (MYT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:62467 Archived-At: --=-=-= Content-Type: text/plain I tried to use list-packages from behind a proxy which requires authentication. I was prompted for my user name and password for the proxy, and after entering it, the package list download failed. Trying again, I was prompted for the password again, and the failure repeated. Applying the patch below, I am only prompted the first time for my password, and the second and subsequent attempts do not fail. I am not very familiar with the url package, so I am not sure this is the correct fix for the issue of cached proxy passwords not being used. But before the patch I saw multiple identical copies of my username/password for the proxy stored in url-http-proxy-basic-auth-storage, while after the patch only one copy is stored, and subsequent attempts do not prompt for the password, so it seems correct. There is still a bug occuring on the first attempt though. It seems that two buffers are created on that attempt - one containing the 407 response requesting proxy authentication, and another containing the subsequent response from the target server after the proxy credentials have been supplied. The buffer returned to the package code is the first one, but it needs the second. I'm not sure whether this is a bug in url, or in the way package.el uses it, and edebug seemed to have problems with parts of the url package, so I could not investigate in detail. --=-=-= Content-Type: text/plain Content-Disposition: inline Content-Description: Possible patch === modified file 'lisp/url/url-http.el' *** lisp/url/url-http.el 2012-07-11 23:13:41 +0000 --- lisp/url/url-http.el 2012-07-27 16:49:07 +0000 *************** *** 239,245 **** nil (let ((url-basic-auth-storage 'url-http-proxy-basic-auth-storage)) ! (url-get-authentication url-http-target-url nil 'any nil)))) (real-fname (url-filename url-http-target-url)) (host (url-host url-http-target-url)) (auth (if (cdr-safe (assoc "Authorization" url-http-extra-headers)) --- 239,245 ---- nil (let ((url-basic-auth-storage 'url-http-proxy-basic-auth-storage)) ! (url-get-authentication url-http-proxy nil 'any nil)))) (real-fname (url-filename url-http-target-url)) (host (url-host url-http-target-url)) (auth (if (cdr-safe (assoc "Authorization" url-http-extra-headers)) --=-=-= Content-Type: text/plain In GNU Emacs 24.1.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.10) of 2012-07-18 on wanchan Bzr revision: 109147 michael.albinus@gmx.de-20120718150436-jgt5g2rpxej1tfhd Windowing system distributor `The X.Org Foundation', version 11.0.11202902 Important settings: value of $LANG: en_NZ.utf8 locale-coding-system: utf-8-unix default enable-multibyte-characters: t Major mode: Emacs-Lisp Minor modes in effect: shell-dirtrack-mode: t diff-auto-refine-mode: t show-paren-mode: t recentf-mode: t display-time-mode: t cua-mode: t global-semanticdb-minor-mode: t global-semantic-idle-scheduler-mode: t semantic-mode: t tooltip-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent input: q q C-k s C-x C-f / l i s u r u r - h t u r l - h t t p - p r o x y C-x C-s C-x v = w w Recent messages: Saving file /home/jasonr/.newsrc... Wrote /home/jasonr/.newsrc Saving /home/jasonr/.newsrc.eld... Saving file /home/jasonr/.newsrc.eld... Wrote /home/jasonr/.newsrc.eld Saving /home/jasonr/.newsrc.eld...done Making completion list... [2 times] Saving file /home/jasonr/repo/emacs/trunk/lisp/url/url-http.el... Wrote /home/jasonr/repo/emacs/trunk/lisp/url/url-http.el Finding changes in /home/jasonr/repo/emacs/trunk/lisp/url/url-http.el...done byte-code: Beginning of buffer [2 times] Load-path shadows: None found. Features: (shadow emacsbug shell grep compile whitespace vc-annotate gnus-dup gnus-fun semantic/tag-write add-log log-view pcvs-util vc ediff-merg ediff-diff ediff-wind ediff-help ediff-util ediff-mult ediff-init ediff vc-dispatcher semantic/bovine semantic/db-file cedet-files semantic/bovine/c semantic/decorate/include semantic/db-find semantic/db-ref semantic/decorate/mode semantic/decorate semantic/bovine/c-by semantic/lex-spp semantic/bovine/gcc semantic/dep cc-langs cl cl-lib cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs multi-isearch vc-bzr help-mode diff-mode thingatpt flyspell ispell semantic/ia pulse semantic/analyze semantic/sort semantic/scope semantic/analyze/fcn mule-util shr-color color shr browse-url sort smiley gnus-cite flow-fill mm-archive mail-extr gnus-async gnus-bcklg qp gnus-ml disp-table nndraft nnmh nnfolder utf-7 epa-file epa derived epg network-stream auth-source starttls nnimap parse-time tls utf7 netrc gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-msg gnus-art mm-uu mml2015 epg-config mm-view mml-smime smime password-cache dig mailcap nntp gnus-cache gnus-sum nnoo gnus-group gnus-undo nnmail mail-source gnus-start gnus-spec gnus-int gnus-range message sendmail rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev gmm-utils mailheader gnus-win debbugs-autoloads minimap-autoloads package jka-compr org-mouse org-w3m org-jsinfo org-infojs org-html org-exp ob-exp org-exp-blocks find-func org-agenda org-info org-id org-gnus org-bbdb paren recentf tree-widget gnus gnus-ems nnheader gnus-util mail-utils mm-util mail-prsvr wid-edit time cua-base cus-start cus-load semantic/db-mode semantic/db gv eieio-base semantic/idle semantic/format ezimage semantic/tag-ls semantic/ctxt semantic/util-modes semantic/util semantic semantic/tag semantic/lex semantic/fw eieio mode-local cedet remember org-remember org-datetree org byte-opt warnings bytecomp byte-compile cconv macroexp advice help-fns advice-preload ob-emacs-lisp ob-tangle ob-ref ob-lob ob-table org-footnote org-src ob-comint ob-keys ob ob-eval org-pcomplete pcomplete comint ansi-color ring org-list org-faces org-compat org-entities org-macs noutline outline easy-mmode format-spec cal-menu easymenu calendar cal-loaddefs server time-date tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces cus-face files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs) --=-=-=--