GNU bug report logs - #26708
25.1; url-basic-auth passes wrong argument type to url-auth-user-prompt

Previous Next

Package: emacs;

Reported by: Sean Allred <allred.sean <at> gmail.com>

Date: Sat, 29 Apr 2017 16:55:01 UTC

Severity: normal

Tags: fixed

Found in version 25.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 26708 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Sean Allred <allred.sean <at> gmail.com>
Cc: 26708 <at> debbugs.gnu.org
Subject: Re: bug#26708: 25.1;
 url-basic-auth passes wrong argument type to url-auth-user-prompt
Date: Wed, 15 May 2019 07:36:19 +0200
Sean Allred <allred.sean <at> gmail.com> writes:

> Just a small typo, it seems.  In `url-auth.el' at
>
>     (setq user (or
>                 (url-do-auth-source-search server type :user)
>                 (read-string (url-auth-user-prompt url realm)   ; <-- here
>                              (or user (user-real-login-name))))
>           pass (or
>                 (url-do-auth-source-search server type :secret)
>                 (read-passwd "Password: " nil (or pass ""))))
>
> `url` should be `href`.

Man, the naming convention in that function is a mess.  `url' is
possibly a string (but can also be an URL object), while `href' is the
real URL object, which is...  backwards.

> This will prevent a type-mismatch when calling `url-basic-auth` as
>
>     (url-basic-auth "http://my.api.com" t)
>
> The workaround for this bug is calling it as
>
>     (url-basic-auth (url-generic-parse-url "http://my.api.com") t)
>
> This function should be inspected for other such bugs, but this is the
> only one I've come across personally.

There were two instances of the same confusion in that function.  I've
now pushed a fix according to your suggestion to Emacs 27.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




This bug report was last modified 6 years and 88 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.