From e4ecc7f745c54a765eff8eff59fc2e9a03371f2e Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Fri, 9 Aug 2024 14:48:43 +0200 Subject: debvm-create: avoid using passwd --delete passwd will chroot() into the target tree and then load shared libraries. This tends to work badly for old releases and for foreign architectures or combinations thereof. As a result, it sometimes fails with Cannot determine your user name. In practice, it removes a single asterisk from the first line of /etc/shadow (at least for jessie to trixie). This is something, we can also do via sed. Reported-by: Sylvain Beucler Fixes: d2d8b9965d39 ("debvm-create: avoid failing when we install no passwd") --- bin/debvm-create | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'bin/debvm-create') diff --git a/bin/debvm-create b/bin/debvm-create index 0fffd70..eecc803 100755 --- a/bin/debvm-create +++ b/bin/debvm-create @@ -356,7 +356,9 @@ set -- \ "$@" # allow password-less root login -set -- '--customize-hook=passwd --root "$1" --delete root' "$@" +# We would like to use passwd --root "$1" --delete here, but uses chroot() and +# then attempts to load shared libraries, which is doomed in the foreign case. +set -- '--customize-hook=sed -i -e "1s/^root:\\*:/root::/" "$1/etc/shadow"' "$@" if test "$INITSYSTEM" = systemd && ! check_skip systemdnetwork; then # dhcp on all network interfaces, and add a dns resolver -- cgit v1.2.3