From 20db5675217b8ec31635ba692f829e5035318874 Mon Sep 17 00:00:00 2001 From: Patrick Schleizer Date: Thu, 21 Nov 2024 07:17:47 -0500 Subject: [PATCH] fix passwordless-root: make sure that VISUAL and SUDO_EDITOR environment variables do not interfere with EDITOR=tee --- usr/bin/passwordless-root | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr/bin/passwordless-root b/usr/bin/passwordless-root index 4b0c892..563866c 100755 --- a/usr/bin/passwordless-root +++ b/usr/bin/passwordless-root @@ -37,7 +37,7 @@ if ! test -w "/etc/sudoers.d/" ; then fi passwordless_sudo_non_qubes() { - echo "user ALL=(ALL:ALL) NOPASSWD:ALL" | EDITOR=tee visudo -f /etc/sudoers.d/nopassword >/dev/null + echo "user ALL=(ALL:ALL) NOPASSWD:ALL" | SUDO_EDITOR="" VISUAL="" EDITOR=tee visudo -f /etc/sudoers.d/nopassword >/dev/null true "\ $0: INFO: OPTIONAL: sudo cat /etc/sudoers.d/nopassword @@ -58,12 +58,12 @@ passwordless_sudo_qubes() { true "$0 INFO: Creating file...: /etc/sudoers.d/nopassword" ## Temporary passwordless sudo until reboot. - echo "user ALL=(ALL:ALL) NOPASSWD:ALL" | EDITOR=tee visudo -f /etc/sudoers.d/nopassword >/dev/null + echo "user ALL=(ALL:ALL) NOPASSWD:ALL" | SUDO_EDITOR="" VISUAL="" EDITOR=tee visudo -f /etc/sudoers.d/nopassword >/dev/null true "$0: INFO: Appending to file...: /rw/config/rc.local" ## Permanent passwordless sudo after reboot. - append-once /rw/config/rc.local 'echo "user ALL=(ALL:ALL) NOPASSWD:ALL" | EDITOR=tee visudo -f /etc/sudoers.d/nopassword >/dev/null' >/dev/null + append-once /rw/config/rc.local 'echo "user ALL=(ALL:ALL) NOPASSWD:ALL" | SUDO_EDITOR="" VISUAL="" EDITOR=tee visudo -f /etc/sudoers.d/nopassword >/dev/null' >/dev/null if ! test -x /rw/config/rc.local ; then chmod +x /rw/config/rc.local