]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
cmdmon: drop handling of NULL and LOGON requests
authorMiroslav Lichvar <mlichvar@redhat.com>
Mon, 10 Feb 2025 14:08:03 +0000 (15:08 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Wed, 12 Feb 2025 13:52:19 +0000 (14:52 +0100)
Handle the NULL and LOGON requests as unknown (invalid) instead of
returning the success and failed status respectively. They have
been unused for very long time now.

candm.h
cmdmon.c
pktlength.c

diff --git a/candm.h b/candm.h
index 401c01568550a143a2e386cdc1e3994d84f60cc3..277fa9a52736e5f0c893d73e0cd2a9935f0d68c9 100644 (file)
--- a/candm.h
+++ b/candm.h
@@ -37,7 +37,6 @@
 #define DEFAULT_CANDM_PORT 323
 
 /* Request codes */
-#define REQ_NULL 0
 #define REQ_ONLINE 1
 #define REQ_OFFLINE 2
 #define REQ_BURST 3
@@ -223,11 +222,6 @@ typedef struct {
   int32_t EOR;
 } REQ_Modify_Makestep;
 
-typedef struct {
-  Timespec ts;
-  int32_t EOR;
-} REQ_Logon;
-
 typedef struct {
   Timespec ts;
   int32_t EOR;
@@ -487,7 +481,6 @@ typedef struct {
     REQ_Modify_Polltarget modify_polltarget;
     REQ_Modify_Maxupdateskew modify_maxupdateskew;
     REQ_Modify_Makestep modify_makestep;
-    REQ_Logon logon;
     REQ_Settime settime;
     REQ_Local local;
     REQ_Manual manual;
index 4accdf6f5356050b132e0ca0e3df36dc956dccce..841f3bd95cb6c1d6df3fab02bb562304107b50b7 100644 (file)
--- a/cmdmon.c
+++ b/cmdmon.c
@@ -1595,10 +1595,6 @@ read_from_cmd_socket(int sock_fd, int event, void *anything)
       LOG_SetContext(LOGC_Command);
 
       switch(rx_command) {
-        case REQ_NULL:
-          /* Do nothing */
-          break;
-
         case REQ_DUMP:
           handle_dump(&rx_message, &tx_message);
           break;
@@ -1643,11 +1639,6 @@ read_from_cmd_socket(int sock_fd, int event, void *anything)
           handle_modify_makestep(&rx_message, &tx_message);
           break;
 
-        case REQ_LOGON:
-          /* Authentication is no longer supported, log-on always fails */
-          tx_message.status = htons(STT_FAILED);
-          break;
-
         case REQ_SETTIME:
           handle_settime(&rx_message, &tx_message);
           break;
index 8d5ffa7ab93a764daabf0d590b9daf7624936bed..d9348efa3d97bb3ff9f05812d70f37592a9a3cfe 100644 (file)
@@ -55,7 +55,7 @@ struct request_length {
 };
 
 static const struct request_length request_lengths[] = {
-  REQ_LENGTH_ENTRY(null, null),                 /* NULL */
+  { 0, 0 },                                     /* NULL - not supported */
   REQ_LENGTH_ENTRY(online, null),               /* ONLINE */
   REQ_LENGTH_ENTRY(offline, null),              /* OFFLINE */
   REQ_LENGTH_ENTRY(burst, null),                /* BURST */
@@ -65,7 +65,7 @@ static const struct request_length request_lengths[] = {
   REQ_LENGTH_ENTRY(modify_maxdelay, null),      /* MODIFY_MAXDELAY */
   REQ_LENGTH_ENTRY(modify_maxdelayratio, null), /* MODIFY_MAXDELAYRATIO */
   REQ_LENGTH_ENTRY(modify_maxupdateskew, null), /* MODIFY_MAXUPDATESKEW */
-  REQ_LENGTH_ENTRY(logon, null),                /* LOGON */
+  { 0, 0 },                                     /* LOGON - not supported */
   REQ_LENGTH_ENTRY(settime, manual_timestamp),  /* SETTIME */
   { 0, 0 },                                     /* LOCAL */
   REQ_LENGTH_ENTRY(manual, null),               /* MANUAL */