aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Lutomirski <luto@kernel.org>2020-11-11 09:53:51 -0800
committerAndy Lutomirski <luto@kernel.org>2020-11-11 09:53:51 -0800
commit1ab5dea159016cd7a079811091d12d2d57a2c023 (patch)
tree576aa6400b9cf73149f3070161514d8a336ea3c7
parentce55e319dd97aaff5d312feabfd93932d04f5724 (diff)
parent8af8c393ced5b6cd93f8627a8d57724b9cb1c3ad (diff)
downloadvirtme-1ab5dea159016cd7a079811091d12d2d57a2c023.tar.gz
Merge branch 'arighi/master' into master
-rwxr-xr-xvirtme/guest/virtme-init7
1 files changed, 7 insertions, 0 deletions
diff --git a/virtme/guest/virtme-init b/virtme/guest/virtme-init
index 56226d3..a3ef852 100755
--- a/virtme/guest/virtme-init
+++ b/virtme/guest/virtme-init
@@ -46,6 +46,13 @@ touch /tmp/fstab
mount --bind /tmp/fstab /etc/fstab
rm /tmp/fstab
+# Populate dummy entries in /etc/shadow to allow switching to any user defined
+# in the system
+(umask 0644 && touch /tmp/shadow)
+sed -e 's/^\([^:]\+\).*/\1:!:::::::/' < /etc/passwd > /tmp/shadow
+mount --bind /tmp/shadow /etc/shadow
+rm /tmp/shadow
+
# Find udevd
if [[ -x /usr/lib/systemd/systemd-udevd ]]; then
udevd=/usr/lib/systemd/systemd-udevd