tramp-devel
[Top][All Lists]
Advanced

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

Re: tramp to remote windows machine with cygwin openSSH


From: Michael Albinus
Subject: Re: tramp to remote windows machine with cygwin openSSH
Date: Tue, 08 May 2012 10:09:15 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux)

"Timothy W. Hilton" <address@hidden> writes:

> Hello,

Hi Timothy,

> I've run a tramp session with tramp-verbose set to 6; the output is below.

> 12:44:51.301118 tramp-send-command (6) # ((test -e 
> /cygdrive/c/Users/Tim/Code/ || test -h /cygdrive/c/Users/Tim/Code/) && \stat 
> -c '(("%N") %h %u %g %X.0 %Y.0 %Z.0 %s.0 "%A" t %i.0 -1)' 
> /cygdrive/c/Users/Tim/Code/ || echo nil) 2>/dev/null; echo tramp_exit_status 
> $? 
> 12:44:51.403128 tramp-wait-for-regexp (6) # 
> (("`/cygdrive/c/Users/Tim/Code/'") 1 1001 513 1330989212.0 1330989212.0 
> 1330989212.0 0.0 "drwxr-xr-x" t 4222124651197747.0 -1)
> tramp_exit_status 0
> ///3c806b8bad19f2ed077f215591cfff58$

This command returns w/o problems.

> 12:44:55.958318 tramp-send-command (6) # ((test -e /cygdrive || test -h 
> /cygdrive) && \stat -c '(("%N") %h %u %g %X.0 %Y.0 %Z.0 %s.0 "%A" t %i.0 -1)' 
> /cygdrive || echo nil) 2>/dev/null; echo tramp_exit_status $? 
> 12:44:56.060725 tramp-wait-for-regexp (6) # 
> (("`/cygdrive'") 6 1001 513 1336416294.0 1336416294.0 1164931200.0 0.0 
> "dr-xr-xr-x" t 2.0 -1)
> tramp_exit_status 0
> ///3c806b8bad19f2ed077f215591cfff58$

Dito.

> 12:44:56.062542 tramp-send-command (6) # ((test -e /cygdrive/c || test -h 
> /cygdrive/c) && \stat -c '(("%N") %h %u %g %X.0 %Y.0 %Z.0 %s.0 "%A" t %i.0 
> -1)' /cygdrive/c || echo nil) 2>/dev/null; echo tramp_exit_status $? 
> 12:44:56.165223 tramp-wait-for-regexp (6) # 
> (("`/cygdrive/c'") 1 4294967295 4294967295 1336381259.0 1336381259.0 
> 1336381259.0 0.0 "d---------" t 1407374883553285.0 -1)
> tramp_exit_status 0
> ///3c806b8bad19f2ed077f215591cfff58$
> 12:44:56.165858 tramp-send-command-and-read (1) # File error: `((test -e 
> /cygdrive/c || test -h /cygdrive/c) && \stat -c '(("%N") %h %u %g %X.0 %Y.0 
> %Z.0 %s.0 "%A" t %i.0 -1)' /cygdrive/c || echo nil)' does not return a valid 
> Lisp expression: `(("`/cygdrive/c'") 1 4294967295 4294967295 1336381259.0 
> 1336381259.0 1336381259.0 0.0 "d---------" t 1407374883553285.0 -1)
> '

Here we have the problem. For "/cygdrive/c", stat returns strange values
for the %u and %g fields (uid and gid): 4294967295. In your Emacs
stanza, I suspect this is out of integer range, which is guaranteed only
for -2**29 to 2**29 - 1 (-536870912 to 536870911).

One possible fix could be the following patch (line numbers might vary):

--8<---------------cut here---------------start------------->8---
*** /home/albinus/src/tramp-2-1-stable/lisp/tramp.el.~2.814.2.18~
--- /home/albinus/src/tramp-2-1-stable/lisp/tramp.el
***************
*** 2946,2953 ****
      (tramp-get-test-command vec)
      (tramp-shell-quote-argument localname)
      (tramp-get-remote-stat vec)
!     (if (eq id-format 'integer) "%u" "\"%U\"")
!     (if (eq id-format 'integer) "%g" "\"%G\"")
      (tramp-shell-quote-argument localname))))
  
  (defun tramp-handle-set-visited-file-modtime (&optional time-list)
--- 2946,2953 ----
      (tramp-get-test-command vec)
      (tramp-shell-quote-argument localname)
      (tramp-get-remote-stat vec)
!     (if (eq id-format 'integer) "%ue0" "\"%U\"")
!     (if (eq id-format 'integer) "%ge0" "\"%G\"")
      (tramp-shell-quote-argument localname))))
  
  (defun tramp-handle-set-visited-file-modtime (&optional time-list)
--8<---------------cut here---------------end--------------->8---

Another possibility would be to switch to the "smb" method, which is the
natural choice when accessing MS Windows machines. But this would
require a local installation of the Samba client on your Mac; don't know
whether this is possible.

> Many thanks for any suggestions,
> Tim

Best regards, Michael.



reply via email to

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