The Samba-Bugzilla – Attachment 18117 Details for
Bug 12806
Deleting in a row of hardlinked snapshots resets file permissions.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
MRE (minimal reproducible example) as bash script to reproduce the bug
setup.txt (text/plain), 1.58 KB, created by
Aryo Da
on 2023-09-21 23:47:52 UTC
(
hide
)
Description:
MRE (minimal reproducible example) as bash script to reproduce the bug
Filename:
MIME Type:
Creator:
Aryo Da
Created:
2023-09-21 23:47:52 UTC
Size:
1.58 KB
patch
obsolete
>#!/bin/bash >clear >echo >echo "Minimal reproducible example (MRE)" >echo "----------------------------------" >echo >echo "Tested with" >echo "- rsync version 3.2.7 protocol version 31" >echo "- ext4 file system" >echo >rm -rf MRE >mkdir MRE >cd MRE >mkdir source >touch source/read_only.txt >chmod 444 source/read_only.txt > >mkdir snapshot1 ># rsync --recursive --times --devices --specials --hard-links --human-readable -s --links --perms --executability --group --owner source/* snapshot1/ >rsync --perms --executability --group --owner source/* snapshot1/ > >mkdir snapshot2 ># rsync --recursive --times --devices --specials --hard-links --human-readable -s --links --perms --executability --group --owner --link-dest=../snapshot1 source/* snapshot2/ >rsync --perms --executability --group --owner --link-dest=../snapshot1 source/* snapshot2/ ># stat snapshot1/read_only.txt >echo "File stats BEFORE rsync --delete": >echo >stat snapshot2/read_only.txt > >mkdir empty ># delete snapshot1 using an empty source directory (shall be the fastest way to delete a subdir) ># --debug=ALL >rsync -a --delete -s empty/ snapshot1/ ># rm -f snapshot1/ # works as expected (unlink does neither change 'Changed' time nor file permissions) ># strace -c rm -rf snapshot1 >echo >stat snapshot2/read_only.txt > >echo >echo "Results (after deleting snapshot1 via rsync --delete):" >echo "1. The 'Change' time of the hardlinked file was updated" >echo "2. The hardlinked file has now different access rights (644 instead of 444 so it is writable again!)" >echo "This does NOT happen if 'rm -f snapshot1/' is used!" >echo > >echo "Files in snapshot2:" >ls -l snapshot2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 12806
:
13239
| 18117