bugzilla-daemon at mindrot.org
2004-Jun-23  06:00 UTC
[Bug 882] Scp cannot copy self-referring directories
http://bugzilla.mindrot.org/show_bug.cgi?id=882
           Summary: Scp cannot copy self-referring directories
           Product: Portable OpenSSH
           Version: 3.8p1
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: P2
         Component: scp
        AssignedTo: openssh-bugs at mindrot.org
        ReportedBy: creidieki+sshbugs at gmail.com
Hi,
I was trying to copy a directory from my school web space, and there was a link
in the directory that led back to the directory itself.  When I tried to scp
this directory to my home computer, scp tried to create an infinite number of
copies of the directory!  It was someone else's directory, so I couldn't
just
delete the link.  The directory worked fine with "cp -r", but not with
"scp -r".
I could provide a sample of this kind of directory if that would be helpful.
Thanks!
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
bugzilla-daemon at mindrot.org
2004-Jun-23  06:07 UTC
[Bug 882] Scp cannot copy self-referring directories
http://bugzilla.mindrot.org/show_bug.cgi?id=882 ------- Additional Comments From dtucker at zip.com.au 2004-06-23 16:07 ------- Is that "link" or "symlink"? Hard links to directories are usually the result (or cause!) of filesystem corruption. Show us what it your directory and its link looks like (eg ls -l). ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee.
bugzilla-daemon at mindrot.org
2004-Jun-27  01:57 UTC
[Bug 882] Scp cannot copy self-referring directories
http://bugzilla.mindrot.org/show_bug.cgi?id=882 ------- Additional Comments From creidieki+sshbugs at gmail.com 2004-06-27 11:57 ------- The offending file is named "suzuki". When I "ls -l suzuki" in the directory, it tells me " lrwxr-xr-x 1 8779 staff 1 May 18 1994 suzuki -> . " Thanks. ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee.
bugzilla-daemon at mindrot.org
2004-Jul-01  00:50 UTC
[Bug 882] Scp cannot copy self-referring directories
http://bugzilla.mindrot.org/show_bug.cgi?id=882
------- Additional Comments From dtucker at zip.com.au  2004-07-01 10:50 -------
Right now, scp does not understand symlinks at all, and afaict having it
understand them enough to be able to copy them (like "rsync -l") would
require a
protocol change (which is not going to happen).
Maybe we could add an option to scp to skip links ("scp -l" ?) 
Opinions?
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
bugzilla-daemon at mindrot.org
2004-Jul-01  03:02 UTC
[Bug 882] Scp cannot copy self-referring directories
http://bugzilla.mindrot.org/show_bug.cgi?id=882 ------- Additional Comments From creidieki+sshbugs at gmail.com 2004-07-01 13:02 ------- That seems odd, consider that symlinks are so widely used. I haven't been able to find a copy of the SCP protocol online, but I'd be interested in taking a look at it, and making suggestions for how it could be extended. Do you know where there's a copy? ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee.
bugzilla-daemon at mindrot.org
2004-Jul-01  03:05 UTC
[Bug 882] Scp cannot copy self-referring directories
http://bugzilla.mindrot.org/show_bug.cgi?id=882 ------- Additional Comments From mouring at eviladmin.org 2004-07-01 13:05 ------- SCP is just the old 'rcp' but uses the ssh instead of rsh for the tunnel. And rcp was never really documnted outside of the source. I don't for see us 'extending' this anytime soon. scp is really just for legacy support to help those that are migrating to ssh. sftp is an RFC standard protocol and all work should be done on that. ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee.
bugzilla-daemon at mindrot.org
2004-Jul-01  03:09 UTC
[Bug 882] Scp cannot copy self-referring directories
http://bugzilla.mindrot.org/show_bug.cgi?id=882 ------- Additional Comments From djm at mindrot.org 2004-07-01 13:09 ------- (Ben beat me to this, but I'll add my voice anyway) There is no specification of the scp protocol, it is just rcp over ssh. We aren't interested in extending it at all: it is very widely deployed, undocumented, 20+ year old protocol with uncorrectable flaws and no versioning or migration mechanism. It is better to improve the tools of the sftp (draft-ietf-secsh-filexfer-*) protocol instead. This protocol fixes all of the above flaws and includes the ability to recognise and transfer symlinks. Our sftp tools aren't as complete as the scp ones (in particular, there are no recursive commands yet), but that can be rectified :) ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee.
bugzilla-daemon at mindrot.org
2004-Jul-01  03:16 UTC
[Bug 882] Scp cannot copy self-referring directories
http://bugzilla.mindrot.org/show_bug.cgi?id=882 ------- Additional Comments From creidieki+sshbugs at gmail.com 2004-07-01 13:16 ------- *nod* I hadn't really looked at sftp; that makes sense. Do you expect that scp's functionality will eventually be replaced by command-line arguments to sftp? I think it's very convenient to be able to use scp to copy things quickly. ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee.
bugzilla-daemon at mindrot.org
2004-Jul-01  03:19 UTC
[Bug 882] Scp cannot copy self-referring directories
http://bugzilla.mindrot.org/show_bug.cgi?id=882
dtucker at zip.com.au changed:
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WONTFIX
------- Additional Comments From dtucker at zip.com.au  2004-07-01 13:19 -------
Basically, the spec for scp is "what rcp does", and the spec for rcp
is "what
some guys at Berkeley wrote in the early 80's".  rcp might even predate
the
existence of symlinks.
Like Ben says, the closest thing to a spec for scp is "scp.c".
Suggested workarounds:
1) Don't do that, then.
2) Use tar-over-ssh or rsync-over-ssh to transfer it link and all, eg:
ssh yourhost 'tar cf - dir-to-copy' | tar xvf -
3) Use sftp (it doesn't do recursive yet, one day it will).
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
bugzilla-daemon at mindrot.org
2004-Jul-01  03:35 UTC
[Bug 882] Scp cannot copy self-referring directories
http://bugzilla.mindrot.org/show_bug.cgi?id=882 ------- Additional Comments From djm at mindrot.org 2004-07-01 13:35 ------- Yes, there is even an open bug for this: Bug #634 ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee.
Apparently Analagous Threads
- [Bug 485] scp doesn't preserve symbolic links
- scp: Problem when source and destination are identical
- scp bug: newly created dirs do not inherit sgid bit
- Deprecation of scp protocol and improving sftp client
- Deprecation of scp protocol and improving sftp client