mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-27 15:32:52 +02:00
helpers.cpp: fix possible crash
Possible error is:
terminate called after throwing an instance of 'std::logic_error'
Origin commit data
------------------
Branch: ni/coolstream
Commit: d9c894a1e3
Author: Thilo Graf <dbt@novatux.de>
Date: 2021-06-28 (Mon, 28 Jun 2021)
------------------
This commit was generated by Migit
This commit is contained in:
@@ -570,9 +570,9 @@ 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)
|
||||||
{
|
{
|
||||||
std::string user = getenv("USER");
|
const char* user = getenv("USER");
|
||||||
if (user != "root")
|
if (strncmp("root", user, 4))
|
||||||
dprintf(DEBUG_NORMAL, "[helpers] [%s - %d] NOTE: current user is not root!\n", __func__, __LINE__);
|
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