From 224369d93b1f6d91c6a95dfb089b0e71050d89b9 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Mon, 25 Apr 2022 16:41:27 +0100 Subject: [PATCH] Revert "Run root check before attempting nonint functions" This reverts commit 73e301771542b1034ce3d45947717608cba72ead. Not all raspi-config functions require root in nonint mode. Some scripts rely on this behaviour. Therefore, nonint will assume the user knows what they're doing instead. --- debian/changelog | 6 ------ raspi-config | 12 ++++++------ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/debian/changelog b/debian/changelog index a037636..f35210a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,3 @@ -raspi-config (20220425) UNRELEASED; urgency=medium - - * Run root check before attempting nonint functions - - -- Serge Schneider Mon, 25 Apr 2022 15:00:17 +0100 - raspi-config (20220419) bullseye; urgency=medium * Reinstate -R parameter for xcompmgr diff --git a/raspi-config b/raspi-config index ea645f4..b2109f3 100755 --- a/raspi-config +++ b/raspi-config @@ -2809,12 +2809,6 @@ nonint() { "$@" } -# Everything needs to be run as root -if [ $(id -u) -ne 0 ]; then - printf "Script must be run as root. Try 'sudo raspi-config'\n" - exit 1 -fi - # # Command line options for non-interactive use # @@ -2860,6 +2854,12 @@ done # exit 0 #fi +# Everything else needs to be run as root +if [ $(id -u) -ne 0 ]; then + printf "Script must be run as root. Try 'sudo raspi-config'\n" + exit 1 +fi + if [ -n "${OPT_MEMORY_SPLIT:-}" ]; then set -e # Fail when a command errors set_memory_split "${OPT_MEMORY_SPLIT}"