From 984a1155456df7bbda7e2f7c1d6bcedff68f609e Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Mon, 12 Aug 2024 22:13:46 +0200 Subject: debvm-create: revert back to passwd for deleting the root password We should avoid --root as that will chroot and load libraries. The sed solution somehow didn't work due to a quoting issue. What we can use is passed --prefix as that avoids loading libraries and explicitly does not support NIS and LDAP, which we don't need here. Reported-by: Vasyl Vavrychuk Thanks: Johannes Schauer Marin Rodrigues Fixes: e4ecc7f745c5 ("debvm-create: avoid using passwd --delete") Closes: #17 --- bin/debvm-create | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'bin/debvm-create') diff --git a/bin/debvm-create b/bin/debvm-create index eecc803..c9837e8 100755 --- a/bin/debvm-create +++ b/bin/debvm-create @@ -356,9 +356,7 @@ set -- \ "$@" # allow password-less root login -# 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"' "$@" +set -- '--customize-hook=passwd --prefix "$1" --delete root' "$@" if test "$INITSYSTEM" = systemd && ! check_skip systemdnetwork; then # dhcp on all network interfaces, and add a dns resolver -- cgit v1.2.3