Remove all use of sudoers file (#3477)

This commit is contained in:
Geoff Bourne
2025-06-01 10:04:37 -05:00
committed by GitHub
parent 3616847e8e
commit 85648d5916
5 changed files with 6 additions and 11 deletions

View File

@@ -17,8 +17,9 @@ if [ ! -p "${CONSOLE_IN_NAMED_PIPE}" ]; then
exit 1
fi
if [ "$(id -u)" = 0 -a $UID != 0 ]; then
exec $(getSudoFromDistro) minecraft bash -c "echo '$*' > '${CONSOLE_IN_NAMED_PIPE}'"
if [[ "$(id -u)" = 0 ]] && [[ $UID != 0 ]]; then
error "Exec needs to be run with user ID $UID"
exit 2
else
echo "$@" >"${CONSOLE_IN_NAMED_PIPE}"
fi