]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
client: ignore case in add command
authorMiroslav Lichvar <mlichvar@redhat.com>
Mon, 17 Aug 2020 15:18:04 +0000 (17:18 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Wed, 19 Aug 2020 07:39:18 +0000 (09:39 +0200)
For consistency with chronyd configuration, make the source type in the
add command case insensitive.

client.c

index c5d20101ce56bd198e3a9bb0bc16bcb0b071cf96..3d238d09d21417c5b3ca7523654bb476669a4d29 100644 (file)
--- a/client.c
+++ b/client.c
@@ -1057,11 +1057,11 @@ process_cmd_add_source(CMD_Request *msg, char *line)
   word = line;
   line = CPS_SplitWord(line);
 
-  if (!strcmp(word, "server")) {
+  if (!strcasecmp(word, "server")) {
     type = REQ_ADDSRC_SERVER;
-  } else if (!strcmp(word, "peer")) {
+  } else if (!strcasecmp(word, "peer")) {
     type = REQ_ADDSRC_PEER;
-  } else if (!strcmp(word, "pool")) {
+  } else if (!strcasecmp(word, "pool")) {
     type = REQ_ADDSRC_POOL;
   } else {
     LOG(LOGS_ERR, "Invalid syntax for add command");