all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#26708: 25.1; url-basic-auth passes wrong argument type to url-auth-user-prompt
@ 2017-04-29 13:16 Sean Allred
  2019-05-15  5:36 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 2+ messages in thread
From: Sean Allred @ 2017-04-29 13:16 UTC (permalink / raw)
  To: 26708

[-- Attachment #1: Type: text/plain, Size: 1367 bytes --]

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`.

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.

-Sean



In GNU Emacs 25.1.1 (x86_64-apple-darwin13.4.0, NS appkit-1265.21 Version
10.9.5 (Build 13F1911))
 of 2016-09-20 built on builder10-9.porkrind.org
Windowing system distributor 'Apple', version 10.3.1504
Configured using:
 'configure --with-ns '--enable-locallisppath=/Library/Application
 Support/Emacs/${version}/site-lisp:/Library/Application
 Support/Emacs/site-lisp' --with-modules'

Configured features:
NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS MODULES

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

[[cruft/pii removed]]

[-- Attachment #2: Type: text/html, Size: 2132 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#26708: 25.1; url-basic-auth passes wrong argument type to url-auth-user-prompt
  2017-04-29 13:16 bug#26708: 25.1; url-basic-auth passes wrong argument type to url-auth-user-prompt Sean Allred
@ 2019-05-15  5:36 ` Lars Ingebrigtsen
  0 siblings, 0 replies; 2+ messages in thread
From: Lars Ingebrigtsen @ 2019-05-15  5:36 UTC (permalink / raw)
  To: Sean Allred; +Cc: 26708

Sean Allred <allred.sean@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





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-05-15  5:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-29 13:16 bug#26708: 25.1; url-basic-auth passes wrong argument type to url-auth-user-prompt Sean Allred
2019-05-15  5:36 ` Lars Ingebrigtsen

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.