Bug 1947064

Summary: The use of rsync with a user different than root will not restore links during the recovery
Product: Red Hat Enterprise Linux 7 Reporter: Welterlen Benoit <bwelterl>
Component: rearAssignee: Pavel Cahyna <pcahyna>
Status: CLOSED ERRATA QA Contact: David Jež <djez>
Severity: high Docs Contact:
Priority: urgent    
Version: 7.9CC: djez, fkrska, jreznik, ovasik, pcahyna
Target Milestone: rcKeywords: ZStream
Target Release: ---Flags: pm-rhel: mirror+
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: rear-2.4-14.el7_9 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-01-11 17:36:05 UTC Type: ---
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: 1930662    
Bug Blocks:    

Description Welterlen Benoit 2021-04-07 15:16:06 UTC
This bug was initially created as a copy of Bug #1930662

I am copying this bug because: 
The issue is sneaky, we can backup and restore without error, but the system will not be usable.


Description of problem:
With a the use of rsync + user, the restore will not recreate links, because of --fake-root option of rsync:

BACKUP_URL=rsync://user1.122.220:/home/user1/rear/

Version-Release number of selected component (if applicable):
rear-2.4-17.el8.x86_64

How reproducible:
always

Steps to Reproduce:
1. rear mkbackup with BACKUP_URL=rsync://user1.122.220:/home/user1/rear/
2. rear recover
3.

Actual results:
All links are replaced by files: (/bin /lib)
---
drwxr-xr-x 18 root root  4096 Feb 15 07:19 .
drwxr-xr-x  4 root root    80 Jan 29 13:16 ..
-rw-------  1 root root     0 Feb 15 07:48 .autorelabel
-rwxrwxrwx  1 root root     7 Apr 23  2020 bin
drwxr-xr-x  6 root root  1024 Jan 29 13:54 boot
drwxr-xr-x 16 root root  4096 Feb 15 07:46 dev
drwxr-xr-x 88 root root  4096 Feb 15 07:48 etc
drwxr-xr-x  3 root root  4096 Apr 23  2020 home
-rwxrwxrwx  1 root root     7 Apr 23  2020 lib
-rwxrwxrwx  1 root root     9 Apr 23  2020 lib64
drwx------  2 root root 16384 Jan 15 10:40 lost+found
drwxr-xr-x  2 root root  4096 Apr 23  2020 media
drwxr-xr-x  3 root root  4096 Feb  9 20:35 mnt
drwxr-xr-x  2 root root  4096 Apr 23  2020 opt
drwxr-xr-x  2 root root  4096 Feb  9 15:59 proc
drwxr-x---  5 root root  4096 Feb 15 07:48 root
drwxr-xr-x  2 root root  4096 Feb  9 16:05 run
-rwxrwxrwx  1 root root     8 Apr 23  2020 sbin
drwxr-xr-x  2 root root  4096 Apr 23  2020 srv
drwxr-xr-x  2 root root  4096 Feb  9 15:59 sys
drwxrwxrwx  2 root root  4096 Feb 15 07:19 tmp
drwxr-xr-x 12 root root  4096 Jan 15 10:46 usr
drwxr-xr-x 21 root root  4096 Jan 15 10:55 var
---

Files are used to store permissions details in xattr but are not restored in recover phase.

Expected results:
We should see links:
---
lrwxrwxrwx.   1 root root    7 Apr 23  2020 bin -> usr/bin
lrwxrwxrwx.   1 root root    7 Apr 23  2020 lib -> usr/lib
lrwxrwxrwx.   1 root root    9 Apr 23  2020 lib64 -> usr/lib64
lrwxrwxrwx.   1 root root    8 Apr 23  2020 sbin -> usr/sbin
---

Additional info:
if we don't use -fake-root, the links are recreated, but the owner is wrong.

Comment 12 errata-xmlrpc 2022-01-11 17:36:05 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (rear bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:0069