GNU bug report logs -
#68805
29.2; Tramp: out-of-band copy-file fails when tramp-copy-keep-date is nil
Previous Next
Reported by: Sean Devlin <spd <at> toadstyle.org>
Date: Mon, 29 Jan 2024 22:28:02 UTC
Severity: normal
Found in version 29.2
Fixed in version 29.3
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
[Message part 1 (text/plain, inline)]
Sean Devlin <spd <at> toadstyle.org> writes:
> Hi folks,
Hi Sean,
> I think the issue is due to caching. Before copying, Tramp checks to see
> if the file exists, and it does not. After the transfer, Tramp tries to
> check again because the keep-date argument was set, tramp-copy-keep-date
> is nil or unset, and Tramp wants to set the file time manually. Instead
> of actually doing this file existence check, Tramp instead gets the
> property from cache that was set just prior to the file transfer. It
> then raises a file-missing error.
Thanks for the report and the analysis. It is correct. Could you please
check, whether this patch fixes it:
[Message part 2 (text/x-patch, inline)]
diff --git a/lisp/tramp-sh.el b/lisp/tramp-sh.el
index 1301cd63..50a33cc3 100644
--- a/lisp/tramp-sh.el
+++ b/lisp/tramp-sh.el
@@ -2521,6 +2521,10 @@ The method used must be an out-of-band method."
;; cached password).
(tramp-cleanup-connection v 'keep-debug 'keep-password))))
+ ;; The cached file properties might be wrong if NEWNAME didn't
+ ;; exist. Flush them.
+ (tramp-flush-file-properties v (tramp-file-local-name newname))
+
;; Handle KEEP-DATE argument.
(when (and keep-date (not copy-keep-date))
(tramp-compat-set-file-times
[Message part 3 (text/plain, inline)]
> Thanks,
>
> Sean
Best regards, Michael.
This bug report was last modified 1 year and 167 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.