mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-04 09:05:06 -05:00
ntp: check name and return status from NSR_AddSourceByName()
Return an error status when the name is not printable or contains a space (don't bother with full hostname validation). If the name is an address, return the same status as NSR_AddSource(). Otherwise, return a "not resolved yet" status.
This commit is contained in:
4
cmdmon.c
4
cmdmon.c
@@ -729,6 +729,8 @@ handle_add_source(NTP_Source_Type type, CMD_Request *rx_message, CMD_Reply *tx_m
|
||||
tx_message->status = htons(STT_INVALIDAF);
|
||||
break;
|
||||
case NSR_NoSuchSource:
|
||||
case NSR_InvalidName:
|
||||
case NSR_UnresolvedName:
|
||||
assert(0);
|
||||
break;
|
||||
}
|
||||
@@ -755,6 +757,8 @@ handle_del_source(CMD_Request *rx_message, CMD_Reply *tx_message)
|
||||
case NSR_TooManySources:
|
||||
case NSR_AlreadyInUse:
|
||||
case NSR_InvalidAF:
|
||||
case NSR_InvalidName:
|
||||
case NSR_UnresolvedName:
|
||||
assert(0);
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user