GNU bug report logs - #21562
24.5; Copy dir via Tramp pscp does not work

Previous Next

Package: emacs;

Reported by: Warren Lynn <wrn.lynn <at> gmail.com>

Date: Fri, 25 Sep 2015 18:48:02 UTC

Severity: normal

Tags: moreinfo

Found in version 24.5

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Warren Lynn <wrn.lynn <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 21562 <at> debbugs.gnu.org
Subject: bug#21562: 24.5; Copy dir via Tramp pscp does not work
Date: Fri, 2 Oct 2015 12:16:29 -0400
[Message part 1 (text/plain, inline)]
Actually, things were more broken than I thought. The original code did not
handle correctly directory copy from local to remote either. The reason is
function
tramp-make-copy-program-file-name
already quotes the target, and then shell-quote-argument quotes the target
again, so we get double quotes.


I attached a second patch to fix both copying dir from local to remote, or
remote to local. However, I am not so sure if this is a completely correct
fix as I don't know much about the "multi-hop" thing. Anyway, hope this can
serve as a starting point for the ultimate proper fix.

BTW, all the above works out of box on Emacs 23.3.

To be honest, I am quite disappointed with Emacs recent (last 2 or 3 years)
release quality. Seems some convoluted low-quality code was checked in the
first place, and then not enough testing was done before release. Don't
know if I have any right to complain in the first place as I am not an
active developer here. But I would hate to see my favorite editor Emacs
going down this path further.



On Fri, Oct 2, 2015 at 10:35 AM, Warren Lynn <wrn.lynn <at> gmail.com> wrote:

> I found the cause and have a fix for it. Attached is the patch (on top of
> Emacs 24.5.1).:
>
> The cause is the order of the function "shell-quote-argument" and
> "file-name-nondirectory" is wrong. So if I have a target directory name
> "c:\wlynn\tmp\xyz", the buggy code will first quote it into
> "\"c:\wlynn\tmp\xyz\"", and the file-name-nondirectory function will strip
> the last part, ending with something like this:
> "\"c:\wlynn\tmp"
>
> See the dangling leading quote?
>
> I verified that it works now. Let me know if you think the patch is good
> and is merged into the latest dev branch. Thanks.
>
>
> On Sat, Sep 26, 2015 at 5:16 AM, Michael Albinus <michael.albinus <at> gmx.de>
> wrote:
>
>> Warren Lynn <wrn.lynn <at> gmail.com> writes:
>>
>> > I use dired/tramp to view a directory on a remote machine (Linux) with
>> > pscp method, and if I do a copy (recursively) of a remote dir to
>> > either a local or another remote dir with command dired-to-copy, it
>> > fails (after entering the password) with the following message in the
>> > minibuffer:
>> >
>> > ============================================
>> > Tramp failed to connect. If this happens repeatedly try 'M-x
>> > tramp-cleanup-this-connection'
>> > ============================================
>>
>> Please apply (setq tramp-verbose 6) prior to your test. Rerun the test,
>> and show us the resulting Tramp debug buffer.
>>
>> Best regards, Michael.
>>
>
>
[Message part 2 (text/html, inline)]
[emacs-bug-21562-fix.patch2.patch (application/octet-stream, attachment)]

This bug report was last modified 9 years and 223 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.