From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Vinicius Jose Latorre Newsgroups: gmane.emacs.devel Subject: Re: [hober0@gmail.com: url-basic-auth -- default user/password prompt to values from URL] Date: Wed, 08 Aug 2007 22:46:58 -0300 Message-ID: <46BA7212.7040100@ig.com.br> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1186623945 8344 80.91.229.12 (9 Aug 2007 01:45:45 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 9 Aug 2007 01:45:45 +0000 (UTC) Cc: emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Aug 09 03:45:43 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IIx5q-0006LT-QP for ged-emacs-devel@m.gmane.org; Thu, 09 Aug 2007 03:45:43 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IIx5q-000620-5g for ged-emacs-devel@m.gmane.org; Wed, 08 Aug 2007 21:45:42 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IIx5n-00061v-TM for emacs-devel@gnu.org; Wed, 08 Aug 2007 21:45:39 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IIx5m-00061j-D5 for emacs-devel@gnu.org; Wed, 08 Aug 2007 21:45:38 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IIx5m-00061g-7r for emacs-devel@gnu.org; Wed, 08 Aug 2007 21:45:38 -0400 Original-Received: from an-out-0708.google.com ([209.85.132.247]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IIx5l-0001kH-MK for emacs-devel@gnu.org; Wed, 08 Aug 2007 21:45:37 -0400 Original-Received: by an-out-0708.google.com with SMTP id c25so56168ana for ; Wed, 08 Aug 2007 18:45:37 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; b=OVoI4l8/j1TR0pfYVRSF3HsfrztQkHDFac0QHg0p2uBbFO7+/wLwKpiPZdeGCgP7jPwdffHqni99YaMVJuzc10nyFvEFby20I3QYPHPAo62MTtWEOcO+UCBQAotQaHrf4EwgQaWeGxBGbsLOXfpnmn426BUwhU5agWMxw7AAA6Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; b=UXm8lYZ1cusBqax4FtdqIqG7zVW5bJ+s3V/GNaWlXNZQf6htGfAOZz7zWQUKbNOOr62Okn0+8pTdgA5l2pZe33IyjSheRHgHMjXEyVbOorclJZy/hs47TR9R5jnDX1uK00KMvGct1xDmvHvGg0BnXtliUP669semRElofCP96Hw= Original-Received: by 10.100.44.13 with SMTP id r13mr1748436anr.1186623936810; Wed, 08 Aug 2007 18:45:36 -0700 (PDT) Original-Received: from ?201.82.142.28? ( [201.82.142.28]) by mx.google.com with ESMTPS id b29sm1782425ana.2007.08.08.18.45.32 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 08 Aug 2007 18:45:35 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.6) Gecko/20070802 SeaMonkey/1.1.4 In-Reply-To: X-Detected-Kernel: Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:76229 Archived-At: Richard Stallman wrote: > Would someone please install this patch, then ack? > Done in trunk and Emacs 22 branch. > ------- Start of forwarded message ------- > X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_PASS, > UNPARSEABLE_RELAY autolearn=failed version=3.1.0 > To: emacs-devel@gnu.org > From: Edward O'Connor > Date: Fri, 03 Aug 2007 23:30:22 -0400 > Organization: Church of Emacs > Mime-Version: 1.0 > Content-Type: multipart/mixed; boundary="=-=-=" > Jabber-ID: hober0@gmail.com > Subject: url-basic-auth -- default user/password prompt to values from URL > > - --=-=-= > > Hi all, > > I've been hacking a bit on some code that uses url.el to talk to a > website which uses HTTP Basic authentication. I'm specifying the > username/password combination in the URL itself, and yet > `url-basic-auth' prompts me for my username and password. > > Fixing that looks potentially complicated, so I thought an incremental > improvement would be for the prompts to pre-populate with the URL's > username/password combo. A patch is attached that does just that. It > would be great if this made it in before 22.2. > > Here's a ChangeLog entry: > > 2007-08-04 Edward O'Connor > > * url/url-auth.el (url-basic-auth): When prompting for username > and password, default to the username and password in the URL. > > > - --=-=-= > Content-Type: text/x-patch > Content-Disposition: inline; filename=url-auth.el-default-prompt.patch > Content-Description: default user/password prompt to values from URL > > cvs diff: Diffing . > Index: url-auth.el > =================================================================== > RCS file: /sources/emacs/emacs/lisp/url/url-auth.el,v > retrieving revision 1.14 > diff -u -r1.14 url-auth.el > - --- url-auth.el 26 Jul 2007 05:27:36 -0000 1.14 > +++ url-auth.el 4 Aug 2007 03:18:35 -0000 > @@ -68,7 +68,9 @@ > (server (url-host href)) > (port (url-port href)) > (path (url-filename href)) > - - user pass byserv retval data) > + (user (url-user href)) > + (pass (url-password href)) > + byserv retval data) > (setq server (format "%s:%d" server port) > path (cond > (realm realm) > @@ -79,8 +81,8 @@ > (cond > ((and prompt (not byserv)) > (setq user (read-string (url-auth-user-prompt url realm) > - - (user-real-login-name)) > - - pass (read-passwd "Password: ")) > + (or user (user-real-login-name))) > + pass (read-passwd "Password: " nil (or pass ""))) > (set url-basic-auth-storage > (cons (list server > (cons path