Actions
Bug #3619
closedcp -p clobbers permissions/ownership following symbolic links
Start date:
2013-03-11
Due date:
% Done:
20%
Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
Description
When using cp(1) with preserve option recursively, it calls chmod/chown also for symlinks, which affects on symlinks sources:
root@indy:/tmp/testcp# ls -l . total 12 -rw-r--r-- 1 alex staff 0 Mar 11 16:49 a lrwxrwxrwx 1 alex staff 1 Mar 11 16:49 b -> a lrwxrwxrwx 1 root root 1 Mar 11 16:49 x -> a drwxr-xr-x 2 alex staff 291 Mar 11 16:51 z root@indy:/tmp/testcp# ls -l z total 8 lrwxrwxrwx 1 root root 4 Mar 11 16:49 f -> ../a -rw-r--r-- 1 alex staff 0 Mar 11 16:49 v lrwxrwxrwx 1 root root 1 Mar 11 16:51 w -> v root@indy:/tmp/testcp# rm -rf c; mkdir c root@indy:/tmp/testcp# /usr/bin/cp -pPR a b x z c root@indy:/tmp/testcp# ls -l c total 12 -rwxrwxrwx 1 root root 0 Mar 11 16:49 a lrwxrwxrwx 1 alex staff 1 Mar 11 16:53 b -> a lrwxrwxrwx 1 root root 1 Mar 11 16:53 x -> a drwxr-xr-x 2 alex staff 291 Mar 11 16:51 z root@indy:/tmp/testcp# ls -l c/z total 8 lrwxrwxrwx 1 root root 4 Mar 11 16:53 f -> ../a -rwxrwxrwx 1 root root 0 Mar 11 16:51 v lrwxrwxrwx 1 root root 1 Mar 11 16:53 w -> v
Updated by Rich Lowe over 9 years ago
- Subject changed from Wrong symlinks preserve mode for cp -pPR to cp -p clobbers permissions/ownership following symbolic links
- Tags deleted (
needs-triage)
Updated by Gordon Ross over 9 years ago
commit 6cdb72227544a5f07e7428e591c2ed84825f4d1f Author: Alexander Eremin <a.eremin@nexenta.com> Date: Thu Mar 28 00:04:59 2013 +0400 3619 cp -p clobbers permissions/ownership following symbolic links Reviewed by: Garrett D'Amore <garrett@damore.org> Reviewed by: Richard Lowe <richlowe@richlowe.net> Approved by: Gordon Ross <gwr@nexenta.com>
Actions