Bug 2027663

Summary: The "filesystem" package fails to update on a rootless container
Product: Red Hat Enterprise Linux 8 Reporter: Teoman ONAY <tonay>
Component: rpmAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED DUPLICATE QA Contact: swm-qe
Severity: medium Docs Contact:
Priority: unspecified    
Version: 8.3CC: mdomonko, pmatilai, pmendezh
Target Milestone: rcKeywords: Triaged
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: Environment:
Last Closed: 2022-01-25 16:52:55 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:

Description Teoman ONAY 2021-11-30 11:14:27 UTC
Description of problem:
[root@localhost packages]# rpm -i filesystem-3.8-3.el8.x86_64.rpm 
error: unpacking of archive failed on file /proc: cpio: chown failed - No such file or directory
error: filesystem-3.8-3.el8.x86_64: install failed

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

How reproducible:
Always

Steps to Reproduce:
1. run a rootless container 
2.
3.

Actual results:
fail to update the package

Expected results:
Having the filesystem package updated without error

Additional info:
Looks similar to this closed BZ against Fedora
https://bugzilla.redhat.com/show_bug.cgi?id=1723266

rpm should skip chowning /proc and /sys when running in a user namespace.

Comment 1 Panu Matilainen 2021-11-30 11:44:52 UTC
> rpm should skip chowning /proc and /sys when running in a user namespace.

rpm doesn't have any concept of magic directories that should be treated specially, quite intentionally.

How does one determine being inside a user namespace?

Comment 2 Pablo Mendez Hernandez 2022-01-24 11:51:40 UTC
(In reply to Panu Matilainen from comment #1)
> > rpm should skip chowning /proc and /sys when running in a user namespace.
> 
> rpm doesn't have any concept of magic directories that should be treated
> specially, quite intentionally.
> 
> How does one determine being inside a user namespace?

As commented by Giuseppe Scrivano in [1]

"$ cat /proc/self/uid_map 
         0          0 4294967295
$ cat /proc/self/gid_map 
         0          0 4294967295

If the content of these files is different than "0 0 4294967295" then you are running in a user namespace where the root user is not mapped to root in the initial user namespace."


Additionally, Debarshi Ray kindly commneted that this same issue was solved
in toolbox 0.0.99.3 by this commit [2].

[1]: https://bugzilla.redhat.com/show_bug.cgi?id=1723266#c11
[2]: https://github.com/containers/toolbox/commit/7542f5fc867b57bf3dc67bbae02cc09ccc0b5df2

Comment 4 Michal Domonkos 2022-01-25 16:52:55 UTC

*** This bug has been marked as a duplicate of bug 1912155 ***