From 4085d287730b945b33b6b6ffb206c4bb6ba671df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=AE=E3=83=AA=E7=8C=AB?= Date: Tue, 15 Oct 2024 20:08:17 +0800 Subject: [PATCH] Fix mc-send-to-console running with uid=0(root) (#3106) --- bin/mc-send-to-console | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/mc-send-to-console b/bin/mc-send-to-console index 9f1762a3..80a310c4 100755 --- a/bin/mc-send-to-console +++ b/bin/mc-send-to-console @@ -17,7 +17,7 @@ if [ ! -p "${CONSOLE_IN_NAMED_PIPE}" ]; then exit 1 fi -if [ "$(id -u)" = 0 ]; then +if [ "$(id -u)" = 0 -a $UID != 0 ]; then if [[ $(getDistro) == alpine ]]; then exec su-exec minecraft bash -c "echo '$*' > '${CONSOLE_IN_NAMED_PIPE:-/tmp/minecraft-console-in}'" else