Bug 1901332

Summary: Read-only files that have changed xattrs fail to allow xattr changes
Product: Red Hat Enterprise Linux 7 Reporter: Carlos Santos <casantos>
Component: rsyncAssignee: Michal Ruprich <mruprich>
Status: CLOSED WONTFIX QA Contact: qe-baseos-daemons
Severity: medium Docs Contact:
Priority: medium    
Version: 7.9CC: fkrska, jshivers, kurathod, rmullett
Target Milestone: rcKeywords: Patch
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1907443 (view as bug list) Environment:
Last Closed: 2022-03-01 15:02:27 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1907443, 2077431    

Description Carlos Santos 2020-11-24 21:26:42 UTC
Description of problem:

When sending files with the --xattrs, if a file is read-only and has new extended
attributes, a non-root receiving user can fail to set the new attributes.

Version-Release number of selected component (if applicable):

rsync-3.1.3-9.el8.x86_64

How reproducible:

Always

Steps to Reproduce:

    $ rm -rf orig a
    $ touch orig a
    $ setfattr -n user.attrib -v value orig
    $ chmod -w orig a
    $ rsync -av --xattrs orig a

Actual results:

sending incremental file list
rsync: rsync_xal_set: lsetxattr(""/home/casantos/a"","user.attrib") failed: Permission denied (13)

sent 129 bytes  received 123 bytes  504.00 bytes/sec
total size is 0  speedup is 0.00
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1179) [sender=3.1.2]

Expected results:

Files should be synchronized without errors.

Additional info:

It is possible to circumvent the problem by means of the --fake-super argument

    $ rsync -av --fake-super --xattrs orig a
    sending incremental file list

    sent 164 bytes  received 21 bytes  370.00 bytes/sec
    total size is 0  speedup is 0.00

The problem has been reported upstream a log time ago and is still not fixed.