Don't break passwordless sudo in unrestricted admin mode

This commit is contained in:
Aaron Rainbolt 2025-11-18 23:53:03 -06:00
parent d267cf6761
commit 936c799cb5
No known key found for this signature in database
GPG key ID: A709160D73C79109

View file

@ -8,6 +8,8 @@ set -o nounset
set -o errtrace
set -o pipefail
source /usr/libexec/helper-scripts/package_installed_check.sh
if [ -z "${PAM_USER:-}" ]; then
true "$0: ERROR: Environment variable 'PAM_USER' is unset!"
## 'exit 0' here to let the appropriate PAM module handle this.
@ -19,6 +21,11 @@ if [ -z "${PAM_SERVICE:-}" ]; then
exit 0
fi
if ! pkg_installed 'user-sysmaint-split' ; then
true "$0: INFO: user-sysmaint-split not installed. Proceeding, ok."
exit 0
fi
kernel_cmdline=''
if [ -r /proc/cmdline ]; then
kernel_cmdline="$(cat /proc/cmdline)"