mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-09-01 09:51:22 +02:00
heipers.cpp: use getuid() instead getenv()
Enabled only on generic hardware. Thanks seife for hint.
This commit is contained in:
@@ -469,13 +469,10 @@ bool exec_controlscript(std::string script)
|
|||||||
|
|
||||||
bool exec_initscript(std::string script, std::string command, std::string system_command)
|
bool exec_initscript(std::string script, std::string command, std::string system_command)
|
||||||
{
|
{
|
||||||
const char* user = getenv("USER");
|
#if HAVE_GENERIC_HARDWARE
|
||||||
if (user != NULL)
|
if (getuid())
|
||||||
{
|
dprintf(DEBUG_NORMAL,"[helpers] [%s - %d] WARNING: current user is not root!\n", __func__, __LINE__);
|
||||||
if (strncmp("root", user, 4))
|
#endif
|
||||||
dprintf(DEBUG_NORMAL,"[helpers] [%s - %d] NOTE: current user %s is not root!\n", __func__, __LINE__, user);
|
|
||||||
}
|
|
||||||
|
|
||||||
int ret = 1;
|
int ret = 1;
|
||||||
if (system_command == "service")
|
if (system_command == "service")
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user