tramp-devel
[Top][All Lists]
Advanced

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

Re: Shell-quoting issue for sshx/scpx on MS Windows


From: Jim Porter
Subject: Re: Shell-quoting issue for sshx/scpx on MS Windows
Date: Thu, 6 May 2021 18:32:54 -0700

On Thu, May 6, 2021 at 8:23 AM Michael Albinus <michael.albinus@gmx.de> wrote:
>
> I've pushed a patch to the repositories, checking for "scp -T", which
> seems to help. At least file names with spaces could be handled properly
> by the scpx method now. Other special characters in file names, like
> dollar, are not handled properly, this needs further investigation.
>
> Could you pls check how it works in your environment?

´╗┐Ok, I've tested in all the combinations I can, with the results in
the table below. "tramp-dev" is the latest Git revision, whereas
"tramp-2.5.0.4" is the version on GNU ELPA. I tested against the Win32
versions of OpenSSH (both v7.7 and v8.1) as well as the MSYS2 version
(I have v8.3). The "spaces" test is attempting to open `~/foo
bar.txt', and "quotes" is attempting to open `~/a "quoted" file.txt'.
I've also included the scp command, and the error message, if any.

(I saved logs with `tramp-verbose' set to 6, but they're pretty large
even compressed, and I'm not sure they'd be that useful anyway. If you
want me to send them over, just let me know.)

>From my tests, the best version combination is Tramp 2.5.0.4 with the
MSYS2 port of OpenSSH: both files open correctly. However, the
development version of Tramp *is* an improvement for anyone with
Win32-OpenSSH v8.1.

Would it be possible to enable your fix only for the Win32 version? It
looks like you can tell them apart by checking `ssh -V'. The Win32
version looks like:

  OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5

and the MSYS2 version looks like:

  OpenSSH_8.3p1, OpenSSL 1.1.1g  21 Apr 2020

I mentioned it in the other thread, but I'm starting to think that the
MSYS2 port of OpenSSH is the best way to use SSH on MS Windows. It
seems that it even supports the ControlMaster option, so Tramp could
use it on MS Windows, and only disable that feature when it detects
"OpenSSH_for_Windows".

---------- Begin Testing Results ----------

tramp-dev  ssh-win32-7.7  spaces    FAIL
  scp -p -q -r jim@server:"/home/jim/foo bar.txt" [[dest]]
  scp: /home/jim/foo: No such file or directory
tramp-dev  ssh-win32-7.7  quotes    FAIL
  scp -p -q -r jim@server:^"/home/jim/a \^"quoted\^" file.txt^" [[dest]]
  scp: ^/home/jim/a: No such file or directory

tramp-dev  ssh-win32-8.1  spaces    ok
  scp -p -T -q -r jim@server:"/home/jim/foo bar.txt" [[dest]]
tramp-dev  ssh-win32-8.1  quotes    FAIL
  scp -p -T -q -r jim@server:^"/home/jim/a \^"quoted\^" file.txt^" [[dest]]
  scp: ^/home/jim/a /^quoted/^ file.txt^: No such file or directory

tramp-dev  ssh-msys2-8.3  spaces    ok
  scp -p -T -q -r jim@server:"/home/jim/foo bar.txt" [[dest]]
tramp-dev  ssh-msys2-8.3  quotes    FAIL
  scp -p -T -q -r jim@server:^"/home/jim/a \^"quoted\^" file.txt^" [[dest]]
  scp: ^/home/jim/a \^quoted^ file.txt^: No such file or directory


tramp-2.5.0.4  ssh-win32-7.7  spaces    FAIL
  scp -p -q -r jim@server:/home/jim/foo\ bar.txt [[dest]]
  scp: /home/jim/foo: No such file or directory
tramp-2.5.0.4  ssh-win32-7.7  quotes    FAIL
  scp -p -q -r jim@server:/home/jim/a\ \"quoted\"\ file.txt [[dest]]
  scp: ^/home/jim/a: No such file or directory

tramp-2.5.0.4  ssh-win32-8.1  spaces    FAIL
  scp -p -q -r jim@server:/home/jim/foo\ bar.txt [[dest]]
  scp: /home/jim/foo: No such file or directory
tramp-2.5.0.4  ssh-win32-8.1  quotes    FAIL
  scp -p -q -r jim@server:/home/jim/a\ \"quoted\"\ file.txt [[dest]]
  scp: ^/home/jim/a: No such file or directory

tramp-2.5.0.4  ssh-msys2-8.3  spaces    ok
  scp -p -q -r jim@server:/home/jim/foo\ bar.txt [[dest]]
tramp-2.5.0.4  ssh-msys2-8.3  quotes    ok
  scp -p -q -r jim@server:/home/jim/a\ \"quoted\"\ file.txt [[dest]]

---------- End Testing Results ----------

- Jim



reply via email to

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