diff options
author | Helmut Grohne <helmut@subdivi.de> | 2024-08-13 10:18:24 +0200 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2024-08-13 10:18:24 +0200 |
commit | f35ef9a20fabfd6e57db83136dc4486fe7757bdc (patch) | |
tree | 3d92baf3aec9bc15b33e93a8bfeeed8cdfe4a20a | |
parent | 984a1155456df7bbda7e2f7c1d6bcedff68f609e (diff) | |
download | debvm-f35ef9a20fabfd6e57db83136dc4486fe7757bdc.tar.gz |
debvm-create: implement password deletion with correctly quoted sed
While using the --prefix option is great, it's only available in trixie.
Hence, revert back to sed, this time getting the quoting right (by
avoiding backslashes using character sequences) and also apply to all
lines of the file as systemd seems to be adding users to the front.
Reported-by: Vasyl Vavrychuk
Fixes: 984a1155456d ("debvm-create: revert back to passwd for deleting the root password")
Closes: #17
-rwxr-xr-x | bin/debvm-create | 5 | ||||
-rw-r--r-- | debian/control | 1 |
2 files changed, 4 insertions, 2 deletions
diff --git a/bin/debvm-create b/bin/debvm-create index c9837e8..9ab2472 100755 --- a/bin/debvm-create +++ b/bin/debvm-create @@ -356,7 +356,10 @@ set -- \ "$@" # allow password-less root login -set -- '--customize-hook=passwd --prefix "$1" --delete root' "$@" +# In future, we should use passwd --prefix "$1" --delete root here, but the +# --prefix option was added in trixie and the --root option uses chroot() and +# attempts to load shared libraries from a potentially foreign chroot. +set -- '--customize-hook=sed -i -e "s/^root:[*]:/root::/" "$1/etc/shadow"' "$@" if test "$INITSYSTEM" = systemd && ! check_skip systemdnetwork; then # dhcp on all network interfaces, and add a dns resolver diff --git a/debian/control b/debian/control index 341e8a7..87e8141 100644 --- a/debian/control +++ b/debian/control @@ -16,7 +16,6 @@ Depends: dpkg-dev, e2fsprogs, mmdebstrap (>= 1.3.0), - passwd, qemu-kvm (>> 1:8.0) | qemu-system-any, # Required for -device virtio-net-pci,netdev=net0 ipxe-qemu, |