mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 16:35:06 -05:00
ntp+cmdmon: log allow/deny commands
Log added NTP and command access restrictions, using INFO severity if from a chronyc command, DEBUG otherwise (i.e. from the config).
This commit is contained in:
3
cmdmon.c
3
cmdmon.c
@@ -1799,6 +1799,9 @@ CAM_AddAccessRestriction(IPAddr *ip_addr, int subnet_bits, int allow, int all)
|
||||
if (status == ADF_BADSUBNET) {
|
||||
return 0;
|
||||
} else if (status == ADF_SUCCESS) {
|
||||
LOG(LOG_GetContextSeverity(LOGC_Command), "%s%s %s access from %s",
|
||||
allow ? "Allowed" : "Denied", all ? " all" : "", "command",
|
||||
UTI_IPSubnetToString(ip_addr, subnet_bits));
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user