bugzilla-daemon at mindrot.org
2023-Sep-05  20:05 UTC
[Bug 3611] New: scp -r does not handle sym links to directories correctly
https://bugzilla.mindrot.org/show_bug.cgi?id=3611
            Bug ID: 3611
           Summary: scp -r does not handle sym links to directories
                    correctly
           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
Example:
scp  -r /tmp/dir1/ `hostname`:/tmp/scp
/tmp/dir1/dir3 is not a regular file
Uploading of file /tmp/dir1/dir3 to /tmp/scp/dir1/dir3 failed!
failed to upload directory /tmp/dir1 to /tmp/scp/dir1
ls -lart /tmp/dir1/dir3 
lrwxrwxrwx 1 root root 13 Sep  5 11:33 /tmp/dir1/dir3 -> ../dir2/dir3/
Works with -O:
scp -O  -r `hostname`:/tmp/dir1/  /tmp/scp
abc 
I assume it has something to do with the new protocol. Apologies if
this is already fix, but didn't find anything when I looked.
Thanks
-- 
You are receiving this mail because:
You are watching the assignee of the bug.
bugzilla-daemon at mindrot.org
2023-Sep-05  20:08 UTC
[Bug 3611] scp -r does not handle sym links to directories correctly
https://bugzilla.mindrot.org/show_bug.cgi?id=3611
--- Comment #1 from Ryan <ryman559 at hotmail.com> ---
Seems to conflict with this in the man page:
     -r      Recursively copy entire directories.  Note that scp
follows symbolic links encountered in the tree traversal.
-- 
You are receiving this mail because:
You are watching the assignee of the bug.
bugzilla-daemon at mindrot.org
2023-Sep-07  16:01 UTC
[Bug 3611] scp -r does not handle sym links to directories correctly
https://bugzilla.mindrot.org/show_bug.cgi?id=3611
--- Comment #2 from Ryan <ryman559 at hotmail.com> ---
Seems the behaviour is different between the two.
sftp:
If the -R flag is specified then directories will be copied
recursively.  Note that sftp does not follow symbolic links when
performing recursive transfers.
scp:
     -r      Recursively copy entire directories.  Note that scp
follows symbolic links encountered in the tree traversal.
-- 
You are receiving this mail because:
You are watching the assignee of the bug.
bugzilla-daemon at mindrot.org
2023-Sep-08  01:50 UTC
[Bug 3611] scp -r does not handle sym links to directories correctly
https://bugzilla.mindrot.org/show_bug.cgi?id=3611
Damien Miller <djm at mindrot.org> changed:
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |djm at mindrot.org,
                   |                            |dtucker at dtucker.net
   Attachment #3728|                            |ok?(dtucker at dtucker.net)
              Flags|                            |
--- Comment #3 from Damien Miller <djm at mindrot.org> ---
Created attachment 3728
  --> https://bugzilla.mindrot.org/attachment.cgi?id=3728&action=edit
handle symlinked directories on sftp upload path
The sftp upload code wasn't handling symlinked directories correctly,
only simlinked files. This should fix it.
-- 
You are receiving this mail because:
You are watching someone on the CC list of the bug.
You are watching the assignee of the bug.
bugzilla-daemon at mindrot.org
2023-Sep-08  02:41 UTC
[Bug 3611] scp -r does not handle sym links to directories correctly
https://bugzilla.mindrot.org/show_bug.cgi?id=3611
Darren Tucker <dtucker at dtucker.net> changed:
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Attachment #3728|ok?(dtucker at dtucker.net)    |ok+
              Flags|                            |
--- Comment #4 from Darren Tucker <dtucker at dtucker.net> ---
Comment on attachment 3728
  --> https://bugzilla.mindrot.org/attachment.cgi?id=3728
handle symlinked directories on sftp upload path
should there be a regression test for this?
-- 
You are receiving this mail because:
You are watching the assignee of the bug.
You are watching someone on the CC list of the bug.
bugzilla-daemon at mindrot.org
2023-Sep-08  04:36 UTC
[Bug 3611] scp -r does not handle sym links to directories correctly
https://bugzilla.mindrot.org/show_bug.cgi?id=3611
Damien Miller <djm at mindrot.org> changed:
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Attachment #3728|0                           |1
        is obsolete|                            |
   Attachment #3729|                            |ok?
              Flags|                            |
--- Comment #5 from Damien Miller <djm at mindrot.org> ---
Created attachment 3729
  --> https://bugzilla.mindrot.org/attachment.cgi?id=3729&action=edit
fix download path too, add regress test
regress test too. The download path was also similarly broken
-- 
You are receiving this mail because:
You are watching the assignee of the bug.
You are watching someone on the CC list of the bug.
bugzilla-daemon at mindrot.org
2023-Sep-08  04:38 UTC
[Bug 3611] scp -r does not handle sym links to directories correctly
https://bugzilla.mindrot.org/show_bug.cgi?id=3611 --- Comment #6 from Damien Miller <djm at mindrot.org> --- sigh, pretend this bit> -for mode in scp sftp ; do > +for mode in sftp ; dois already reverted when reading the regress diff -- You are receiving this mail because: You are watching the assignee of the bug. You are watching someone on the CC list of the bug.
bugzilla-daemon at mindrot.org
2023-Sep-08  04:44 UTC
[Bug 3611] scp -r does not handle sym links to directories correctly
https://bugzilla.mindrot.org/show_bug.cgi?id=3611
Darren Tucker <dtucker at dtucker.net> changed:
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Attachment #3729|ok?                         |ok+
              Flags|                            |
-- 
You are receiving this mail because:
You are watching someone on the CC list of the bug.
You are watching the assignee of the bug.
bugzilla-daemon at mindrot.org
2023-Sep-08  06:02 UTC
[Bug 3611] scp -r does not handle sym links to directories correctly
https://bugzilla.mindrot.org/show_bug.cgi?id=3611
Damien Miller <djm at mindrot.org> changed:
           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Blocks|                            |3605
             Status|NEW                         |RESOLVED
--- Comment #7 from Damien Miller <djm at mindrot.org> ---
This has been committed and will be in OpenSSH 9.5, due in a few months
- thanks!
Referenced Bugs:
https://bugzilla.mindrot.org/show_bug.cgi?id=3605
[Bug 3605] Tracking bug for OpenSSH 9.5
-- 
You are receiving this mail because:
You are watching someone on the CC list of the bug.
You are watching the assignee of the bug.
bugzilla-daemon at mindrot.org
2024-Jan-02  20:12 UTC
[Bug 3611] scp -r does not handle sym links to directories correctly
https://bugzilla.mindrot.org/show_bug.cgi?id=3611 --- Comment #8 from Ryan <ryman559 at hotmail.com> --- Is there a good way to check if scp is using SFTP? I've had success by greping to output of "scp -O" and searching for "unknown option". Just curious if there's a better way? -- You are receiving this mail because: You are watching the assignee of the bug. You are watching someone on the CC list of the bug.