From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: [hober0@gmail.com: url-basic-auth -- default user/password prompt to values from URL] Date: Wed, 08 Aug 2007 20:07:21 -0400 Message-ID: Reply-To: rms@gnu.org NNTP-Posting-Host: lo.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: sea.gmane.org 1186617959 27476 80.91.229.12 (9 Aug 2007 00:05:59 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 9 Aug 2007 00:05:59 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Aug 09 02:05:56 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 1IIvWj-0003KV-Mx for ged-emacs-devel@m.gmane.org; Thu, 09 Aug 2007 02:05:50 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IIvWj-0002pS-9r for ged-emacs-devel@m.gmane.org; Wed, 08 Aug 2007 20:05:21 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IIvVo-0002Nv-MA for emacs-devel@gnu.org; Wed, 08 Aug 2007 20:04:24 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IIvVm-0002N7-Ur for emacs-devel@gnu.org; Wed, 08 Aug 2007 20:04:24 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IIvVm-0002Mu-Lx for emacs-devel@gnu.org; Wed, 08 Aug 2007 20:04:22 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IIvVm-0003aa-3M for emacs-devel@gnu.org; Wed, 08 Aug 2007 20:04:22 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.60) (envelope-from ) id 1IIvYf-0005VL-Dt; Wed, 08 Aug 2007 20:07:21 -0400 X-Detected-Kernel: Linux 2.6, seldom 2.4 (older, 4) 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:76220 Archived-At: Would someone please install this patch, then ack? ------- 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 - --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel - --=-=-=-- ------- End of forwarded message -------