mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 16:35:06 -05:00
conf: warn if not having read-only access to keys
After dropping root privileges, log a warning message if chronyd doesn't have read access or has (unnecessary) write access to the files containing symmetric and server NTS keys.
This commit is contained in:
6
main.c
6
main.c
@@ -637,9 +637,13 @@ int main
|
||||
}
|
||||
|
||||
/* Drop root privileges if the specified user has a non-zero UID */
|
||||
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);
|
||||
|
||||
/* Warn if missing read access or having write access to keys */
|
||||
CNF_CheckReadOnlyAccess();
|
||||
}
|
||||
|
||||
if (!geteuid())
|
||||
LOG(LOGS_WARN, "Running with root privileges");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user