mirror of
https://github.com/g4klx/MMDVMHost
synced 2025-12-22 08:05:49 +08:00
patch to keep root permision for openwrt
This commit is contained in:
@@ -206,7 +206,7 @@ int CMMDVMHost::run()
|
|||||||
::close(STDOUT_FILENO);
|
::close(STDOUT_FILENO);
|
||||||
::close(STDERR_FILENO);
|
::close(STDERR_FILENO);
|
||||||
|
|
||||||
#if !defined(HD44780) && !defined(OLED)
|
#if !defined(HD44780) && !defined(OLED) && !defined(_OPENWRT)
|
||||||
// If we are currently root...
|
// If we are currently root...
|
||||||
if (getuid() == 0) {
|
if (getuid() == 0) {
|
||||||
struct passwd* user = ::getpwnam("mmdvm");
|
struct passwd* user = ::getpwnam("mmdvm");
|
||||||
@@ -237,7 +237,7 @@ int CMMDVMHost::run()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
::fprintf(stderr, "Dropping root permissions in daemon mode is disabled with HD44780 display\n");
|
::fprintf(stderr, "Dropping root permissions in daemon mode is disabled.\n");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user