[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: auth-source.el API change: Gnus and Emacs sync

From: Ted Zlatanov
Subject: Re: auth-source.el API change: Gnus and Emacs sync
Date: Sat, 12 Feb 2011 07:49:46 -0600
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux)

On Fri, 11 Feb 2011 11:28:35 -0600 Ted Zlatanov <address@hidden> wrote: 

TZ> On Fri, 11 Feb 2011 17:37:09 +0100 Michael Albinus <address@hidden> wrote: 
MA> Ted Zlatanov <address@hidden> writes:
>>> I attach a revised patch against Emacs that DTRT inside tramp.el itself
>>> (I think).  Please check the logic because I don't know the Tramp
>>> internals so well.  Also we could pass `tramp-current-user' with the
>>> :user search key to `auth-source-search', if it's known.  I don't know
>>> if that's TRT for Tramp.

MA> You're patch looks OK to me (but I haven't tested). If a user is given
MA> in the remote file name, it is set in `tramp-current-user', indeed;
MA> otherwise `tramp-current-user' is nil. So you could check it and use it
MA> when non-nil.

TZ> How about this:

TZ>   (setq auth-info
TZ>         (tramp-compat-funcall
TZ>          'auth-source-search
TZ>          :max 1
TZ>          :user (or tramp-current-user t)
TZ>          :host tramp-current-host
TZ>          :port tramp-current-method))

TZ> That will match any user if tramp-current-user is nil.

Michael, I'll wait for your reply before comitting my patch in Emacs.
The backwards compatible wrapper of `auth-source-user-or-password'
should be OK until then.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]