https://bugzilla.samba.org/show_bug.cgi?id=12806
Bug ID: 12806 Summary: Deleting in a row of hardlinked snapshots resets file permissions. Product: rsync Version: 3.1.0 Hardware: All OS: All Status: NEW Severity: normal Priority: P5 Component: core Assignee: way...@samba.org Reporter: h...@delember-wyes.de QA Contact: rsync...@samba.org Created attachment 13239 --> https://bugzilla.samba.org/attachment.cgi?id=13239&action=edit Log file of bug reproduction Overview: In an differential backup system with hard-linked copies of unchanged files, deleting one snapshot resets the permission bit on all files. Steps to reproduce: 1) Set up a source directory, fill in a couple of files. Some text is just fine. Make one of these files have 444 permissions. 2) Set up a different directory to hold snapshots of the source directory. 3) Make a unique name for a snapshot, using e.g. the current date/time. 4) Make a snapshot using rsync: rsync -ar --itemize-changes src/ snapshots/`echo $snap`/ $snap contains the name of the snapshot. Save this name in a file "lastsnapshot". 5) Make a new name for a new snapshot and make it using: rsync -ar --itemize-changes --link-dest=`pwd`/snapshots/`cat lastsnapshot`/ src/ snapshots/`echo $snap`/. Again, save the name of the last snapshot. 6) Repeat step 5) a couple of times. In the snapshot directory, you will get a row of snapshots. All files in each snapshot is hard-linked to the counterparts in the other snapshots. Watch the permission bits of the one file with 444 permissions: Everything is ok. 7) Now, deliberately delete one of the snapshots using e.g. rsync -r --delete `mktemp -d`/ snapshots/2017-05-26-15-00-53/ 8) Now all of the files in all snapshots have 644 permissions. This will cause the re-transmission of that file with the following snapshot. Actual results: On deletion of a snapshot, hardlinked files get the wrong permissions. Expected results: Permission bits should be left intact. Attached is a log file where I documented this behaviour. -- You are receiving this mail because: You are the QA Contact for the bug. -- Please use reply-all for most replies to avoid omitting the mailing list. To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html