summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2012-03-06 01:29:38 +0100
committerDave Reisner <dreisner@archlinux.org>2012-03-06 01:29:38 +0100
commitd9563ccf4d2fd92e64114844645f90e86d469d50 (patch)
tree33c9b0c8ad152f29dec913c11d4da385ac8e8263
parent1ac0adf4052ff7e0258fcf5f745f19551de3faa5 (diff)
downloadmkinitcpio-d9563ccf4d2fd92e64114844645f90e86d469d50.tar.gz
mkinitcpio-d9563ccf4d2fd92e64114844645f90e86d469d50.tar.xz
mkinitcpio: force UID/GID 0 for files written to image
This fixes a strange edge where-in a user creates an image as non-root and attempts to boot from it. Any setuid binaries (such as mount) will fail, as the ownership is preserved. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
-rwxr-xr-xmkinitcpio2
1 files changed, 1 insertions, 1 deletions
diff --git a/mkinitcpio b/mkinitcpio
index c6528e9..bb34add 100755
--- a/mkinitcpio
+++ b/mkinitcpio
@@ -391,7 +391,7 @@ if [[ "${GENIMG}" ]]; then
pushd "$BUILDROOT" >/dev/null
find . -print0 |
- bsdcpio $( (( QUIET )) && echo '--quiet' ) -0oH newc |
+ bsdcpio $( (( QUIET )) && echo '--quiet' ) -R 0:0 -0oH newc |
$COMPRESSION $COMPRESSION_OPTIONS > "$IMGPATH"
pipesave=("${PIPESTATUS[@]}") # save immediately
popd >/dev/null