bugzilla-daemon at mindrot.org
2024-Dec-09  16:39 UTC
[Bug 3764] New: scp deletes file when copying to localhost
https://bugzilla.mindrot.org/show_bug.cgi?id=3764
            Bug ID: 3764
           Summary: scp deletes file when copying to localhost
           Product: Portable OpenSSH
           Version: 8.7p1
          Hardware: amd64
                OS: Linux
            Status: NEW
          Severity: minor
          Priority: P5
         Component: scp
          Assignee: unassigned-bugs at mindrot.org
          Reporter: ryman559 at hotmail.com
Copying files locally like so causes the file to be deleted. This
$ ls -lart /tmp/a.txt
-rw-r--r-- 1 user build 7 Dec  9 11:34 /tmp/a.txt
$ scp `whoami`@`hostname`:/tmp/a.txt `whoami`@`hostname`:/tmp/a.txt
a.txt                                                                  
                                                                       
                                                                       
                        0%    0     0.0KB/s   --:-- ETA
$ ls -lart /tmp/a.txt
-rw-r--r-- 1 user build 0 Dec  9 11:35 /tmp/a.txt
Note this behaviour is not seen when using -O, so could be a regression
with the move to SFTP
$ ls -lart /tmp/a.txt
-rw-r--r-- 1 user build 17 Dec  9 11:35 /tmp/a.txt
$ scp -O `whoami`@`hostname`:/tmp/a.txt `whoami`@`hostname`:/tmp/a.txt
$ ls -lart /tmp/a.txt
-rw-r--r-- 1 user build 17 Dec  9 11:36 /tmp/a.txt
-- 
You are receiving this mail because:
You are watching the assignee of the bug.
Maybe Matching Threads
- [Bug 3611] New: scp -r does not handle sym links to directories correctly
- [Bug 2193] New: Scp sometimes breaks non-ASCII filenames in copying progress indicator
- file name handling "bug" in scp?
- [Bug 3767] New: scp doesn't report copy of zero-length files to stdout when copying from remote server
- [Bug 799] scp incorrectly reports "stalled" on slow copies