mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 19:55:07 -05:00
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:
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();
|
||||||
|
|||||||
Reference in New Issue
Block a user