mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-06 17:55:06 -05:00
cmdmon: refactor command authorization checks
Try to simplify the code and make it more robust to potential bugs. Instead of maintaing a table mapping all commands to open/auth permissions, use a short list of open commands. Split the processing of the commands into two groups, read-write commands and read-only (monitoring) commands, where the first group is processed only with full access. Check both the socket descriptor and address type before giving full access. While moving the code, reorder the commands alphabetically.
This commit is contained in:
7
candm.h
7
candm.h
@@ -510,13 +510,6 @@ typedef struct {
|
||||
|
||||
} CMD_Request;
|
||||
|
||||
/* ================================================== */
|
||||
/* Authority codes for command types */
|
||||
|
||||
#define PERMIT_OPEN 0
|
||||
#define PERMIT_LOCAL 1
|
||||
#define PERMIT_AUTH 2
|
||||
|
||||
/* ================================================== */
|
||||
|
||||
/* Reply codes */
|
||||
|
||||
Reference in New Issue
Block a user