Added check to see if HD44780 is enabled and disable setuid() if it is

This commit is contained in:
Simon
2016-05-05 09:47:54 +01:00
parent 1be436b83b
commit 3617199399

View File

@@ -157,7 +157,7 @@ int CMMDVMHost::run()
::close(STDIN_FILENO); ::close(STDIN_FILENO);
::close(STDOUT_FILENO); ::close(STDOUT_FILENO);
::close(STDERR_FILENO); ::close(STDERR_FILENO);
#if !defined(HD44780)
//If we are currently root... //If we are currently root...
if (getuid() == 0) { if (getuid() == 0) {
//get UID for mmdvm user //get UID for mmdvm user
@@ -191,6 +191,10 @@ int CMMDVMHost::run()
} }
} }
#else
::LogMessage("Warning: dropping root permissions in daemon mode is disabled with HD44780 display");
}
#endif
#endif #endif
LogInfo(HEADER1); LogInfo(HEADER1);