Subject: bug#868 closed by Glenn Morris <[email-masked]> (Re: Bug#868: Make url-basic-auth support non-ascii passwords)

From: [email-masked] (Emacs bug Tracking System)

This is an automatic notification regarding your bug report
which was filed against the emacs,url package:

#868: [PATCH] Make url-basic-auth support non-ascii passwords

It has been closed by Glenn Morris <[email-masked]>.

Their explanation is attached below along with your original report.
If this explanation is unsatisfactory and you have not received a
better one in a separate message then please contact Glenn Morris <[email-masked]> by
replying to this email.

-- 
868: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=868
Emacs Bug Tracking System
Contact [email-masked] with problems
>From [email-masked] Thu Oct 30 15:07:55 2008
From: Glenn Morris <[email-masked]>
To: [email-masked]
Subject: Re: Bug#868: Make url-basic-auth support non-ascii passwords
Date: Thu, 30 Oct 2008 18:05:00 -0400

This was installed:

2008-10-20  Ismail Donmez  <[email-masked]>  (tiny change)

    * url-auth.el (url-basic-auth): Encode password string.

>From [email-masked] Tue Sep  2 13:52:20 2008
From: Magnus Henoch <[email-masked]>
To: Emacs bug submit <[email-masked]>
Subject: [PATCH] Make url-basic-auth support non-ascii passwords
Mail-Copies-To: never
Jabber-Id: [email-masked]
Disposition-Notification-To: Magnus Henoch <[email-masked]>
Date: Tue, 02 Sep 2008 22:52:14 +0200

--=-=-=

Package: emacs,url

Just making sure that this doesn't get lost.  Will get to it later...

--=-=-=
Content-Type: message/rfc822
Content-Disposition: inline

Path: news.gmane.org!not-for-mail
From: =?utf-8?Q?=C4=B0smail_D=C3=B6nmez?= <[email-masked]>
Newsgroups: gmane.emacs.devel
Subject: [PATCH] Make url-basic-auth support non-ascii passwords
Date: Tue, 26 Aug 2008 19:23:56 +0300
Lines: 36
Approved: [email-masked]
NNTP-Posting-Host: lo.gmane.org
NNTP-Posting-Date: Tue, 26 Aug 2008 16:25:19 +0000 (UTC)
To: "emacs- devel" <[email-masked]>
Original-X-From: emacs-devel-bounces+ged-emacs-devel=[email-masked] Tue Aug 26 18:26:13 2008
Original-Received: from lists.gnu.org ([199.232.76.165])
	by lo.gmane.org with esmtp (Exim 4.50)
	id 1KY1Mw-0001dm-Jh
	for [email-masked]; Tue, 26 Aug 2008 18:26:10 +0200
Original-Received: from localhost ([127.0.0.1]:55803 helo=lists.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43)
	id 1KY1Ly-0005yA-Go
	for [email-masked]; Tue, 26 Aug 2008 12:25:10 -0400
Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1KY1Kp-0005PU-CM
	for [email-masked]; Tue, 26 Aug 2008 12:23:59 -0400
Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1KY1Ko-0005Og-KU
	for [email-masked]; Tue, 26 Aug 2008 12:23:58 -0400
Original-Received: from [199.232.76.173] (port=45759 helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1KY1Ko-0005OV-FJ
	for [email-masked]; Tue, 26 Aug 2008 12:23:58 -0400
Original-Received: from ik-out-1112.google.com ([66.249.90.176]:49255)
	by monty-python.gnu.org with esmtp (Exim 4.60)
	(envelope-from <[email-masked]>) id 1KY1Ko-0003XD-9Z
	for [email-masked]; Tue, 26 Aug 2008 12:23:58 -0400
Original-Received: by ik-out-1112.google.com with SMTP id c21so1971677ika.2
	for <[email-masked]>; Tue, 26 Aug 2008 09:23:56 -0700 (PDT)
Original-Received: by 10.210.126.18 with SMTP id y18mr8647796ebc.100.1219767836543;
	Tue, 26 Aug 2008 09:23:56 -0700 (PDT)
Original-Received: by 10.210.136.18 with HTTP; Tue, 26 Aug 2008 09:23:56 -0700 (PDT)
Original-Sender: emacs-devel-bounces+ged-emacs-devel=[email-masked]
Xref: news.gmane.org gmane.emacs.devel:102988
Archived-At: <http://permalink.gmane.org/gmane.emacs.devel/102988>

--===-=-=
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline

Hi,

url-basic-auth uses base64-encode-string but the password string can
contain non-ascii characters. In which case encode-coding-string
should be used. Attached patch fixes the issue.

Regards,
ismail

-- 
Programmer Excuse #26: I suspect it's a bus collision.

--===-=-=
Content-Type: text/x-diff; name=url-basic-auth-utf8.patch
Content-Disposition: attachment; filename=url-basic-auth-utf8.patch

diff --git a/lisp/url/url-auth.el b/lisp/url/url-auth.el
index ce730ce..d089b18 100644
--- a/lisp/url/url-auth.el
+++ b/lisp/url/url-auth.el
@@ -93,7 +93,7 @@ instead of the filename inheritance method."
 		       (cons file
 			     (setq retval
 				   (base64-encode-string
-				    (format "%s:%s" user pass)))))
+				    (format "%s:%s" user (encode-coding-string pass 'utf-8))))))
 		 (symbol-value url-basic-auth-storage))))
      (byserv
       (setq retval (cdr-safe (assoc file byserv)))

--===-=-=--

--=-=-=--