From 00992caa2dd5c9e91567d2f38154362ad52ca272 Mon Sep 17 00:00:00 2001 From: Murilo Varela Date: Thu, 11 Jun 2026 11:30:34 -0300 Subject: [PATCH] fix: explicit env var passthrough for sudo on env_reset distros On distros with env_reset in sudoers (RHEL, Fedora, Amazon Linux, etc.), sudo -E does not reliably pass through VANTA_KEY, VANTA_OWNER_EMAIL, or VANTA_REGION to the dpkg/rpm postinst. Replace sudo -E with plain sudo and forward only the required vars explicitly via sudo env. Co-Authored-By: Claude Sonnet 4.6 --- install-linux.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/install-linux.sh b/install-linux.sh index c624ada..17c0af2 100755 --- a/install-linux.sh +++ b/install-linux.sh @@ -32,7 +32,7 @@ fi if [ $(echo "$UID") = "0" ]; then SUDO='' else - SUDO='sudo -E' + SUDO='sudo' fi function get_platform() { @@ -156,7 +156,12 @@ fi # Install Vanta Device Monitor ## printf "\033[34m\n* Installing Vanta Device Monitor. You might be asked for your password...\n\033[0m" -$SUDO $INSTALL_CMD $PKG_PATH +$SUDO env \ + VANTA_KEY="$VANTA_KEY" \ + VANTA_OWNER_EMAIL="$VANTA_OWNER_EMAIL" \ + VANTA_REGION="$VANTA_REGION" \ + ${VANTA_NOSTART:+VANTA_NOSTART="$VANTA_NOSTART"} \ + $INSTALL_CMD $PKG_PATH ##