Skip to content

Commit

Permalink
vm_img_mkfs: only use unshare if $UID != 0
Browse files Browse the repository at this point in the history
  • Loading branch information
mlschroe committed Jul 25, 2023
1 parent 4b8ac98 commit 21db5f5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion build-vm
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ vm_img_mkfs() {
# Doesn't matter too much when setting up the build root initially as
# rpm is called inside anway to fix everything. However, when reusing
# an image suddenly all ownerships would change.
[ -x "/usr/bin/unshare" ] && mkfs="unshare --user --map-root-user $mkfs"
test $UID != 0 -a -x /usr/bin/unshare && mkfs="unshare --user --map-root-user $mkfs"
else
print "ERROR: populating the filesystem is only supported with ext file systems"
cleanup_and_exit 1
Expand Down

0 comments on commit 21db5f5

Please sign in to comment.