From 74e55d24780c13757491c654988c19b082664ff3 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 30 Jun 2021 20:35:27 +0200 Subject: [PATCH] heipers.cpp: use getuid() instead getenv() Enabled only on generic hardware. Thanks seife for hint. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/33a282527cb4427cae40d0b367a18299cc596c91 Author: Thilo Graf Date: 2021-06-30 (Wed, 30 Jun 2021) --- src/system/helpers.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index 6bcf6337b..eb886764f 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -570,6 +570,10 @@ bool exec_controlscript(std::string script) bool exec_initscript(std::string script, std::string command, std::string system_command) { +#if HAVE_GENERIC_HARDWARE + if (getuid()) + dprintf(DEBUG_NORMAL,"[helpers] [%s - %d] WARNING: current user is not root!\n", __func__, __LINE__); +#endif int ret = 1; if (system_command == "service") {