main: warn if running with root privileges
Log a warning message if the main process has not dropped the root privileges, i.e. when the compiled-in user or user specified by the user directive or -u option is root.
This commit is contained in:
parent
8acdb5d1e2
commit
4f878ba144
1 changed files with 3 additions and 0 deletions
3
main.c
3
main.c
|
@ -628,6 +628,9 @@ int main
|
||||||
if (!geteuid() && (pw->pw_uid || pw->pw_gid))
|
if (!geteuid() && (pw->pw_uid || pw->pw_gid))
|
||||||
SYS_DropRoot(pw->pw_uid, pw->pw_gid, SYS_MAIN_PROCESS);
|
SYS_DropRoot(pw->pw_uid, pw->pw_gid, SYS_MAIN_PROCESS);
|
||||||
|
|
||||||
|
if (!geteuid())
|
||||||
|
LOG(LOGS_WARN, "Running with root privileges");
|
||||||
|
|
||||||
REF_Initialise();
|
REF_Initialise();
|
||||||
SST_Initialise();
|
SST_Initialise();
|
||||||
NSR_Initialise();
|
NSR_Initialise();
|
||||||
|
|
Loading…
Reference in a new issue