mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 20:25:07 -05:00
cmdmon: allow unauthenticated commands from Unix domain socket
Allow all commands received from the Unix domain command socket (which is accessible only by the root and chrony user/group), even when they are not authenticated with the command key.
This commit is contained in:
47
cmdmon.c
47
cmdmon.c
@@ -1808,28 +1808,35 @@ read_from_cmd_socket(void *anything)
|
|||||||
/* This should be already handled */
|
/* This should be already handled */
|
||||||
assert(0);
|
assert(0);
|
||||||
} else {
|
} else {
|
||||||
/* Check level of authority required to issue the command */
|
/* Check level of authority required to issue the command. All commands
|
||||||
switch(permissions[rx_command]) {
|
from the Unix domain socket (which is accessible only by the root and
|
||||||
case PERMIT_AUTH:
|
chrony user/group) are allowed. */
|
||||||
if (authenticated) {
|
if (where_from.sa.sa_family == AF_UNIX) {
|
||||||
|
assert(sock_fd == sock_fdu);
|
||||||
|
allowed = 1;
|
||||||
|
} else {
|
||||||
|
switch (permissions[rx_command]) {
|
||||||
|
case PERMIT_AUTH:
|
||||||
|
if (authenticated) {
|
||||||
|
allowed = 1;
|
||||||
|
} else {
|
||||||
|
allowed = 0;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case PERMIT_LOCAL:
|
||||||
|
if (authenticated || localhost) {
|
||||||
|
allowed = 1;
|
||||||
|
} else {
|
||||||
|
allowed = 0;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case PERMIT_OPEN:
|
||||||
allowed = 1;
|
allowed = 1;
|
||||||
} else {
|
break;
|
||||||
|
default:
|
||||||
|
assert(0);
|
||||||
allowed = 0;
|
allowed = 0;
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
case PERMIT_LOCAL:
|
|
||||||
if (authenticated || localhost) {
|
|
||||||
allowed = 1;
|
|
||||||
} else {
|
|
||||||
allowed = 0;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case PERMIT_OPEN:
|
|
||||||
allowed = 1;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
assert(0);
|
|
||||||
allowed = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (allowed) {
|
if (allowed) {
|
||||||
|
|||||||
Reference in New Issue
Block a user