FS#68349 - [mkinitcpio] not setting uid=0 gid=0 in archive

Attached to Project: Arch Linux
Opened by Arkadij Chistyj (arkdchst) - Tuesday, 20 October 2020, 13:57 GMT
Last edited by Giancarlo Razzolini (grazzolini) - Monday, 29 November 2021, 12:27 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Giancarlo Razzolini (grazzolini)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No

Details

Description:
If you run mkinitcpio as non-root user, uid and gid of each file from archive will be set to your non-zero uid and non-zero gid.

Main problem and how to reproduce it:
If you create initramfs with non-root user and try to boot with it, you will get
mount: /proc: must be superuser to use mount.
mount: /sys: must be superuser to use mount.
mount: /dev: must be superuser to use mount.
mount: /run: must be superuser to use mount.
because all files in your initrd environment have non-zero uid and gid.

Additional info:
I also created a PR that fixes this bug on github: https://github.com/archlinux/mkinitcpio/pull/38
This task depends upon

Closed by  Giancarlo Razzolini (grazzolini)
Monday, 29 November 2021, 12:27 GMT
Reason for closing:  Implemented
Additional comments about closing:  mkinitcpio 31 implements this.

Loading...