Re: how to troubleshoot tramp on windows

2008-05-14 Thread Alec Clews
Paul Gatewood gatewop at onr.navy.mil writes:

 I actually got this working and am sorry I was so busy I did not follow up my 
own posting with the results.
 


I seem to have a different problem with plink if I use a non-standard port. 
Plink expects the port number to be supplied  using the -P option. However 
Tramp uses -p. Is there some way to re-configure this behaviour please?

Thanks

Alec Clews  
-alec dot clews at anz dot com-







___
Tramp-devel mailing list
Tramp-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/tramp-devel


Re: One host hanging on connect

2008-05-14 Thread Michael Albinus
yary [EMAIL PROTECTED] writes:

Hit,

Thanks for the debug output, it did explain what happened. But it is
still strange, I don't understand _why_ it happens.

Here Tramp tries to unset the echo via stty -echo.

 15:35:13 tramp-send-command (6) # stty -inlcr -echo kill '^U' erase '^H'

Now it checks whether this was successful.

 15:35:14 tramp-send-command (6) # echo foo

No. The echo is still visible.

 15:35:14 tramp-wait-for-regexp (6) #
 echo foo

 foo
 $
 15:35:14 tramp-set-connection-property (7) # remote-echo t
 15:35:14 tramp-open-connection-setup-interactive-shell (5) # Remote
 echo still on. Ok.

From now on, Tramp has enabled a mechanism to suppress the echo. This
works fine for some commands like this.

 15:35:14 tramp-send-command (6) # _echostty icanon erase ^H cols
 32767_echo
 15:35:14 tramp-accept-process-output (10) #
 _echo     stty icanon erase ^H cols 32767_echo     

 $
 15:35:14 tramp-wait-for-regexp (6) #
 $

But then, surprisingly, the echo isn't visible any longer. Tramp becomes
confused.

 15:35:16 tramp-send-command (6) # _echoecho \`uname -sr`\
 2/dev/null; echo tramp_exit_status $? _echo
 15:35:16 tramp-accept-process-output (10) #
 OpenBSD 3.9
 tramp_exit_status 0

 ///b799e8ae826fe51395cca1b11f83abee

I have no idea why this happens.

Anyway, the appended patch tries to handle even this case. Could you,
please, check, whether it works for you?

Thanks, and best regards, Michael.

*** /usr/local/src/tramp/lisp/tramp.el.~1~	Mon May  5 11:15:23 2008
--- /usr/local/src/tramp/lisp/tramp.el	Wed May 14 17:14:02 2008
***
*** 851,856 
--- 851,859 
   (tramp-set-completion-function
fcp tramp-completion-function-alist-ssh)))
  
+ (defconst tramp-echo-mark-marker _echo
+   String mark to be transmitted around shell commands.)
+ 
  (defconst tramp-echo-mark _echo\b\b\b\b\b
String mark to be transmitted around shell commands.
  Used to separate their echo from the output they produce.  This
***
*** 5641,5648 
  	  (forward-line)
  	  (delete-region begin (point))
  	  (goto-char (point-min)
! ;; No echo to be handled, now we can look for the regexp.
! (when (not (tramp-get-connection-property proc check-remote-echo nil))
(re-search-forward regexp nil t
  
  (defun tramp-wait-for-regexp (proc timeout regexp)
--- 5644,5655 
  	  (forward-line)
  	  (delete-region begin (point))
  	  (goto-char (point-min)
! (when (or
! 	   ;; No echo to be handled, now we can look for the regexp.
! 	   (not (tramp-get-connection-property proc check-remote-echo nil))
! 	   ;; Sometimes the echo is invisible.
! 	   (not (re-search-forward tramp-echo-mark-marker nil t)))
!   (goto-char (point-min))
(re-search-forward regexp nil t
  
  (defun tramp-wait-for-regexp (proc timeout regexp)
___
Tramp-devel mailing list
Tramp-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/tramp-devel


Re: One host hanging on connect

2008-05-14 Thread yary
That patch works like a charm, thanks!


___
Tramp-devel mailing list
Tramp-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/tramp-devel


Re: using auth-source for authentication

2008-05-14 Thread Ted Zlatanov
On Tue, 13 May 2008 16:13:27 +0200 Michael Albinus [EMAIL PROTECTED] wrote: 

MA In general, Tramp does not need a port. Almost ever, ports are not
MA given by the user, and Tramp uses (implicitely) the default port of
MA the given method. So it would be OK for Tramp, if the port in your
MA authinfo is optional.

OK, here's a patch to do the following, if auth-sources is bound
(because Tramp still exists outside of Emacs, I didn't want to autoload
auth-source.el by default):

1) get password where tramp-current-method == port
2) get password where tramp-default-method == port
3) get password where tramp == port

The user name doesn't come from auth-sources now, but it could, if you
want to allow that.  Then the user could say

machine mymachine login tzz password zzt port tramp

and opening /mymachine:/file would automatically use 'tzz' as the user
name.  It's just another call to auth-source-user-or-password with
login instead of password.

This is only against lisp/tramp.el, I didn't look at tramp2/

I tested it on my machine and it worked for me.

I know the patch could be nicer with a loop, but I was going for clarity
over cleverness :)

Ted

? tramp.auth-source.patch
Index: lisp/tramp.el
===
RCS file: /sources/tramp/tramp/lisp/tramp.el,v
retrieving revision 2.644
diff -c -r2.644 tramp.el
*** lisp/tramp.el	13 May 2008 21:16:23 -	2.644
--- lisp/tramp.el	14 May 2008 17:23:43 -
***
*** 87,92 
--- 87,95 
  (require 'shell)
  (require 'advice)
  
+ (eval-and-compile
+   (autoload 'auth-source-user-or-password auth-source))
+ 
  ;; Requiring 'tramp-cache results in an endless loop.
  (autoload 'tramp-get-file-property tramp-cache)
  (autoload 'tramp-set-file-property tramp-cache)
***
*** 7191,7196 
--- 7194,7200 
  
  (defun tramp-read-passwd (proc optional prompt)
Read a password from user (compat function).
+ Consults the auth-source package.
  Invokes `password-read' if available, `read-passwd' else.
(let* ((key (tramp-make-tramp-file-name
  	   tramp-current-method tramp-current-user
***
*** 7200,7211 
  	  (with-current-buffer (process-buffer proc)
  		(tramp-check-for-regexp proc tramp-password-prompt-regexp)
  		(format %s for %s  (capitalize (match-string 1)) key)
! (if (functionp 'password-read)
! 	(let ((password (funcall (symbol-function 'password-read)
!  pw-prompt key)))
! 	  (funcall (symbol-function 'password-cache-add) key password)
! 	  password)
!   (read-passwd pw-prompt
  
  (defun tramp-clear-passwd (vec)
Clear password cache for connection related to VEC.
--- 7204,7230 
  	  (with-current-buffer (process-buffer proc)
  		(tramp-check-for-regexp proc tramp-password-prompt-regexp)
  		(format %s for %s  (capitalize (match-string 1)) key)
! 
! (or
!  ;; see if auth-sources contains something useful, if it's bound
!  (when (boundp 'auth-sources)
!(or
! 	;; 1. try with Tramp's current method
! 	(auth-source-user-or-password 
! 	 password tramp-current-host tramp-current-method)
! 	;; 2. try with Tramp's default method
! 	(auth-source-user-or-password 
! 	 password tramp-current-host tramp-default-method)
! 	;; 3. hard-code the method to be tramp
! 	(auth-source-user-or-password 
! 	 password tramp-current-host tramp)))
!  ;; 4. else, get the password interactively
!  (if (functionp 'password-read)
! 	 (let ((password (funcall (symbol-function 'password-read)
!   pw-prompt key)))
! 	   (funcall (symbol-function 'password-cache-add) key password)
! 	   password)
!(read-passwd pw-prompt)
  
  (defun tramp-clear-passwd (vec)
Clear password cache for connection related to VEC.
___
Tramp-devel mailing list
Tramp-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/tramp-devel


Re: One host hanging on connect

2008-05-14 Thread Michael Albinus
yary [EMAIL PROTECTED] writes:

 That patch works like a charm, thanks!

Thanks for the test. I've committed the patch to CVS.

Best regards, Michael.


___
Tramp-devel mailing list
Tramp-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/tramp-devel


Re: using auth-source for authentication

2008-05-14 Thread Michael Albinus
Ted Zlatanov [EMAIL PROTECTED] writes:

Hi Ted,

 OK, here's a patch to do the following, if auth-sources is bound
 (because Tramp still exists outside of Emacs, I didn't want to autoload
 auth-source.el by default):

Maybe you could load auth-source like we do it for password-cache.el
(also from Gnus):

(if (featurep 'xemacs)
(load auth-source 'noerror)
  (require 'auth-source nil 'noerror))

The advantage is, that there is no need to require auth-source.el
somewhere else.

 1) get password where tramp-current-method == port
 2) get password where tramp-default-method == port

I don't believe we shall use tramp-default-method. tramp-current-method
shall be set already, when tramp-read-passwd is called. And
tramp-default-method has even less priority than
tramp-default-method-alist, which would be needed to be checked as well then.

 3) get password where tramp == port

 The user name doesn't come from auth-sources now, but it could, if you
 want to allow that.  Then the user could say

 machine mymachine login tzz password zzt port tramp

 and opening /mymachine:/file would automatically use 'tzz' as the user
 name.  It's just another call to auth-source-user-or-password with
 login instead of password.

That would be a third mechanism, beside tramp-default-user-alist and
tramp-default-user. And likely, tramp-read-passwd is too late for this
decision, this must be checked earlier I believe.

Hmm, I'm not decided yet. Maybe we should wait, whether somebody asks for.

 This is only against lisp/tramp.el, I didn't look at tramp2/

That's OK. tramp2/ is dead code.

It would also be nice if we could have some documentation in
tramp.texi. There is a node Password caching, maybe you can extend it
to something called Password handling or so.

Feel free to commit your changes to Tramp CVS. I'll sync it regularly
with Emacs CVS, so we will get a chance for a pretest, before Tramp
2.1.14 is out.

 Ted

Best regards, Michael.


___
Tramp-devel mailing list
Tramp-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/tramp-devel


Re: using auth-source for authentication

2008-05-14 Thread Michael Albinus
Ted Zlatanov [EMAIL PROTECTED] writes:

 MA It would also be nice if we could have some documentation in
 MA tramp.texi. There is a node Password caching, maybe you can extend it
 MA to something called Password handling or so.

 I think there should be a brief mention of auth-source pointing to the
 main entry, which will probably be in the Emacs manual somewhere (I'll
 ask to move it out of Gnus), and maybe a sample authinfo/netrc line.  I
 want users to realize auth-source can take care of all their passwords
 in Emacs.  Is that OK with you or do you want more details in the Tramp
 manual?

Tramp 2.1 will be used also with GNU Emacs 21/22, and with XEmacs. So
the Tramp documentation should be self-explaining. But it doesn't need
to be comprehensive, just a short example is sufficient.

 MA Feel free to commit your changes to Tramp CVS. I'll sync it regularly
 MA with Emacs CVS, so we will get a chance for a pretest, before Tramp
 MA 2.1.14 is out.

 Done.

Thanks!

 Ted

Best regards, Michael.


___
Tramp-devel mailing list
Tramp-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/tramp-devel


RE: how to troubleshoot tramp on windows

2008-05-14 Thread Clews, Alec
Many thanks Michael,

I had upgraded Tramp incorrectly -- now working thanks to your help.

(ensure that  --with-lispdir and --infodir options are set correctly
when running configure)

Alec 

-Original Message-
From: Michael Albinus [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, 14 May 2008 5:42 PM
To: Clews, Alec
Cc: [EMAIL PROTECTED]
Subject: Re: how to troubleshoot tramp on windows

Alec Clews [EMAIL PROTECTED] writes:

 I seem to have a different problem with plink if I use a non-standard
port. 
 Plink expects the port number to be supplied  using the -P option. 
 However Tramp uses -p. Is there some way to re-configure this
behaviour please?

This is fixed in Tramp's CVS already (I assume you are using Tramp
2.1.x). The pscp entry in `tramp-methods' must look like this:

(pscp  (tramp-login-programplink)
 (tramp-login-args   ((%h) (-l %u) (-P %p)
  (-ssh)))
 (tramp-remote-sh/bin/sh)
 (tramp-copy-program pscp)
 (tramp-copy-args((-P) (%p) (-scp) (-p
%k)))
 (tramp-copy-keep-date   t)
 (tramp-password-end-of-line xy) ;see docstring for xy
 (tramp-default-port 22))

Will be available with Tramp 2.1.14.




This e-mail and any attachments to it (the Communication) is, unless 
otherwise stated, confidential,  may contain copyright material and is for the 
use only of the intended recipient. If you receive the Communication in error, 
please notify the sender immediately by return e-mail, delete the Communication 
and the return e-mail, and do not read, copy, retransmit or otherwise deal with 
it. Any views expressed in the Communication are those of the individual sender 
only, unless expressly stated to be those of Australia and New Zealand Banking 
Group Limited ABN 11 005 357 522, or any of its related entities including ANZ 
National Bank Limited (together ANZ). ANZ does not accept liability in 
connection with the integrity of or errors in the Communication, computer 
virus, data corruption, interference or delay arising from or in respect of the 
Communication.


___
Tramp-devel mailing list
Tramp-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/tramp-devel


Re: using auth-source for authentication

2008-05-14 Thread Ted Zlatanov
On Wed, 14 May 2008 22:23:07 +0200 Michael Albinus [EMAIL PROTECTED] wrote: 

MA Maybe you could load auth-source like we do it for password-cache.el
MA (also from Gnus):

MA (if (featurep 'xemacs)
MA (load auth-source 'noerror)
MA   (require 'auth-source nil 'noerror))

MA The advantage is, that there is no need to require auth-source.el
MA somewhere else.

OK.

 1) get password where tramp-current-method == port
 2) get password where tramp-default-method == port

MA I don't believe we shall use tramp-default-method. tramp-current-method
MA shall be set already, when tramp-read-passwd is called. And
MA tramp-default-method has even less priority than
MA tramp-default-method-alist, which would be needed to be checked as well 
then.

OK, I took out check (2), let's stay with the simple solution of
tramp-current-method first, then tramp.

 3) get password where tramp == port
 
 The user name doesn't come from auth-sources now, but it could, if you
 want to allow that.  Then the user could say
 
 machine mymachine login tzz password zzt port tramp
 
 and opening /mymachine:/file would automatically use 'tzz' as the user
 name.  It's just another call to auth-source-user-or-password with
 login instead of password.

MA That would be a third mechanism, beside tramp-default-user-alist and
MA tramp-default-user. And likely, tramp-read-passwd is too late for this
MA decision, this must be checked earlier I believe.

MA Hmm, I'm not decided yet. Maybe we should wait, whether somebody asks for.

OK with me, let's get the password patch out there :)

MA It would also be nice if we could have some documentation in
MA tramp.texi. There is a node Password caching, maybe you can extend it
MA to something called Password handling or so.

I think there should be a brief mention of auth-source pointing to the
main entry, which will probably be in the Emacs manual somewhere (I'll
ask to move it out of Gnus), and maybe a sample authinfo/netrc line.  I
want users to realize auth-source can take care of all their passwords
in Emacs.  Is that OK with you or do you want more details in the Tramp
manual?

MA Feel free to commit your changes to Tramp CVS. I'll sync it regularly
MA with Emacs CVS, so we will get a chance for a pretest, before Tramp
MA 2.1.14 is out.

Done.

Ted


___
Tramp-devel mailing list
Tramp-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/tramp-devel