From 368a504fa3bb4dcc04131fd8cbac486e1f880839 Mon Sep 17 00:00:00 2001 From: Santiago Torres Date: Wed, 23 Oct 2019 20:22:50 -0400 Subject: [PATCH] Makefile: use fakeroot for tar-ing rootfs When tar-ing the rootfs, the permissions preserved are from the worker process. This is not the intended behavior, as we want to preserve the permissions of the root user to most of the files. Use fakeroot during the tar process to automagically map the uid of the user to that of root's. Fixes #22 Signed-off-by: Santiago Torres --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 9f7ff04..8a5274a 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,9 @@ rootfs: hooks # remove passwordless login for root (see CVE-2019-5021 for reference) sed -i -e 's/^root::/root:!:/' "$(BUILDDIR)/etc/shadow" - tar --numeric-owner --xattrs --acls --exclude-from=exclude -C $(BUILDDIR) -c . -f archlinux.tar + # fakeroot to map the gid/uid of the builder process to root + # fixes #22 + fakeroot -- tar --numeric-owner --xattrs --acls --exclude-from=exclude -C $(BUILDDIR) -c . -f archlinux.tar rm -rf $(BUILDDIR) alpm-hooks compress-rootfs: archlinux.tar