[Bug 8216] New: cp -Ll doesn't dereference symlinks

bugzilla at busybox.net bugzilla at busybox.net
Fri Jul 10 16:52:02 UTC 2015


https://bugs.busybox.net/show_bug.cgi?id=8216

           Summary: cp -Ll doesn't dereference symlinks
           Product: Busybox
           Version: 1.23.x
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: minor
          Priority: P5
         Component: Other
        AssignedTo: unassigned at busybox.net
        ReportedBy: ats at offog.org
                CC: busybox-cvs at busybox.net
   Estimated Hours: 0.0


GNU cp and busybox cp behave differently if both -L (follow symlinks) and -l
(create hardlinks) are specified, and you try to copy a symlink.

GNU cp (8.24) makes a hardlink to the file that's the target of the symlink.

busybox cp (1.23.2) makes a hardlink to the symlink itself.

Here's an example:

$ date >orig
$ ln -s orig symlink
$ cp -Ll symlink gnu-copy
$ busybox cp -Ll symlink busybox-copy
$ ls -li orig symlink gnu-copy busybox-copy
64454 lrwxrwxrwx 2 ats ats  4 Jul 10 17:48 busybox-copy -> orig
64453 -rw-r--r-- 2 ats ats 29 Jul 10 17:48 gnu-copy
64453 -rw-r--r-- 2 ats ats 29 Jul 10 17:48 orig
64454 lrwxrwxrwx 2 ats ats  4 Jul 10 17:48 symlink -> orig

-l isn't specified by POSIX, but the GNU cp behaviour is basically what I'd
expect.

-- 
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


More information about the busybox-cvs mailing list