From f15c2a6ed0e555f2d3a7c432c9abdbadbbc830d5 Mon Sep 17 00:00:00 2001 From: Tycho Andersen Date: Mon, 20 Nov 2023 11:28:54 -0700 Subject: [PATCH] virtme-init: touch /etc/sudoers if it doesn't exist otherwise we get: mount: /etc/sudoers: mount point does not exist. Signed-off-by: Tycho Andersen --- virtme/guest/virtme-init | 3 +++ 1 file changed, 3 insertions(+) diff --git a/virtme/guest/virtme-init b/virtme/guest/virtme-init index dd90e64..3f80b03 100755 --- a/virtme/guest/virtme-init +++ b/virtme/guest/virtme-init @@ -204,6 +204,9 @@ if [[ -n "virtme_user" ]]; then echo "root ALL = (ALL) NOPASSWD: ALL" > $tmpfile echo "${virtme_user} ALL = (ALL) NOPASSWD: ALL" >> $tmpfile chmod 440 "$tmpfile" + if [ ! -f "$real_sudoers" ]; then + touch "$real_sudoers" + fi mount --bind "$tmpfile" "$real_sudoers" fi