On Fri, 11 Feb 2011 11:28:35 -0600 Ted Zlatanov <[email protected]> wrote: 

TZ> On Fri, 11 Feb 2011 17:37:09 +0100 Michael Albinus <[email protected]> 
wrote: 
MA> Ted Zlatanov <[email protected]> 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.

Thanks
Ted


_______________________________________________
Tramp-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/tramp-devel

Reply via email to