Bug 12508 - fileflags & forcechange don't work for hardlinks
Summary: fileflags & forcechange don't work for hardlinks
Status: NEW
Alias: None
Product: rsync
Classification: Unclassified
Component: core (show other bugs)
Version: 3.1.2
Hardware: All FreeBSD
: P5 normal (vote)
Target Milestone: ---
Assignee: Wayne Davison
QA Contact: Rsync QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-10 11:49 UTC by Emanuel Haupt
Modified: 2017-01-10 11:51 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Emanuel Haupt 2017-01-10 11:49:44 UTC
I've received the following bug report in FreeBSD's bugzilla:

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=215688

Use case:

# mkdir -pv /root/debug/{src,dst}
# touch /root/debug/src/0x
# ls -lio /root/debug/src/0x
330810 -rw-r--r--  1 root  wheel  uarch 0 Jan 10 12:40 /root/debug/src/0x
# ln /root/debug/src/0x /root/debug/src/1x
# ln /root/debug/src/0x /root/debug/src/2x
# ln /root/debug/src/0x /root/debug/src/3x
# ls -lio /root/debug/src/
total 2
330810 -rw-r--r--  4 root  wheel  uarch 0 Jan 10 12:40 0x
330810 -rw-r--r--  4 root  wheel  uarch 0 Jan 10 12:40 1x
330810 -rw-r--r--  4 root  wheel  uarch 0 Jan 10 12:40 2x
330810 -rw-r--r--  4 root  wheel  uarch 0 Jan 10 12:40 3x
# chflags schg /root/debug/src/0x
# ls -lio /root/debug/src/
total 2
330810 -rw-r--r--  4 root  wheel  schg,uarch 0 Jan 10 12:40 0x
330810 -rw-r--r--  4 root  wheel  schg,uarch 0 Jan 10 12:40 1x
330810 -rw-r--r--  4 root  wheel  schg,uarch 0 Jan 10 12:40 2x
330810 -rw-r--r--  4 root  wheel  schg,uarch 0 Jan 10 12:40 3x
# rsync -aHXSE --partial --timeout=60 --fileflags --force-change --numeric-ids --force --super -8 /root/debug/src/. /root/debug/dst/
rsync: link "/root/debug/dst/2x" => 3x failed: Operation not permitted (1)
rsync: link "/root/debug/dst/1x" => 3x failed: Operation not permitted (1)
rsync: link "/root/debug/dst/0x" => 3x failed: Operation not permitted (1)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1200) [sender=3.1.2]
# ls -lio /root/debug/dst/
total 1
330826 -rw-r--r--  1 root  wheel  schg,uarch 0 Jan 10 12:40 3x