diff options
author | Helmut Grohne <helmut@subdivi.de> | 2024-08-12 22:13:46 +0200 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2024-08-12 22:13:46 +0200 |
commit | 984a1155456df7bbda7e2f7c1d6bcedff68f609e (patch) | |
tree | 468a3c795dc08882ec4a59cdb965b44ab6897d8b | |
parent | e4ecc7f745c54a765eff8eff59fc2e9a03371f2e (diff) | |
download | debvm-984a1155456df7bbda7e2f7c1d6bcedff68f609e.tar.gz |
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 <josch@mister-muffin.de>
Fixes: e4ecc7f745c5 ("debvm-create: avoid using passwd --delete")
Closes: #17
-rwxr-xr-x | bin/debvm-create | 4 |
1 files changed, 1 insertions, 3 deletions
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 |