]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
client: don't allow slash with hostname in allow/deny command
authorMiroslav Lichvar <mlichvar@redhat.com>
Tue, 25 Jul 2017 10:56:59 +0000 (12:56 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Tue, 25 Jul 2017 15:40:35 +0000 (17:40 +0200)
client.c

index eae69832033d15441d50b0e6db8957964c78b77c..cfe18a057080d32ce11ea11954e31840142ff5c5 100644 (file)
--- a/client.c
+++ b/client.c
@@ -796,7 +796,7 @@ parse_allow_deny(CMD_Request *msg, char *line)
         (n = sscanf(p, "%lu.%lu.%lu.%lu", &a, &b, &c, &d)) <= 0) {
 
       /* Try to parse as the name of a machine */
-      if (DNS_Name2IPAddress(p, &ip, 1) != DNS_Success) {
+      if (slashpos || DNS_Name2IPAddress(p, &ip, 1) != DNS_Success) {
         LOG(LOGS_ERR, "Could not read address");
         return 0;
       } else {