Skip to contentSkip to conversation

root_image: explicitly chmod the image to 644

PATCH Applied Eric Biggers 2 participants 2 messages Apr 2, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 root_image: explicitly chmod the image to 644

From: Eric Biggers <[email protected]>

Otherwise it is inaccessible to non-root users on systems that use a umask of 0077.

---
 root_image | 1 +
 1 file changed, 1 insertion(+)
root_image +1 -0
index f2f36a4..964c791 100755
@@ -331,10 +331,11 @@ cmd_create()
 
     MNT=$(mktemp --tmpdir -d $(basename "$0")-XXXXXXXXXX)
     #trap 'umount_image; rm "$ktest_image"' EXIT
 
     fallocate -l "$IMAGE_SIZE" "$ktest_image"
+    chmod 644 "$ktest_image"
     mkfs.ext4 -F "$ktest_image"
     mount "$ktest_image" "$MNT"
 
     DEBOOTSTRAP_DIR=$ktest_dir/debootstrap $debootstrap	\
 	--no-check-gpg					\

base-commit: 53229b36f8c4df0690af64dedfce3e247334505e

Signature · 1 line
2.49.0
#1 lore raw
Quoted 6 lines · Eric Biggers

From: Eric Biggers <[email protected]>

Otherwise it is inaccessible to non-root users on systems that use a umask of 0077.

Applied

Quoted 25 lines
---
 root_image | 1 +
 1 file changed, 1 insertion(+)
root_image +1 -0
index f2f36a4..964c791 100755
@@ -331,10 +331,11 @@ cmd_create()
 
     MNT=$(mktemp --tmpdir -d $(basename "$0")-XXXXXXXXXX)
     #trap 'umount_image; rm "$ktest_image"' EXIT
 
     fallocate -l "$IMAGE_SIZE" "$ktest_image"
+    chmod 644 "$ktest_image"
     mkfs.ext4 -F "$ktest_image"
     mount "$ktest_image" "$MNT"
 
     DEBOOTSTRAP_DIR=$ktest_dir/debootstrap $debootstrap	\
 	--no-check-gpg					\

base-commit: 53229b36f8c4df0690af64dedfce3e247334505e

Signature · 1 line
2.49.0