]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Corrected parsing of the max_user_ip -s option (forgot the number of allowed
authorhno <>
Fri, 14 Jun 2002 22:27:13 +0000 (22:27 +0000)
committerhno <>
Fri, 14 Jun 2002 22:27:13 +0000 (22:27 +0000)
IPs)

src/acl.cc

index 6a553c560c7c09bd9e3559b1bbebefdf32dd4ac7..7a317ac564cba63b20fc9231dfdd992d60d07a06 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: acl.cc,v 1.275 2002/06/13 17:08:01 hno Exp $
+ * $Id: acl.cc,v 1.276 2002/06/14 16:27:13 hno Exp $
  *
  * DEBUG: section 28    Access Control
  * AUTHOR: Duane Wessels
@@ -1256,17 +1256,22 @@ aclParseUserMaxIP(void *data)
        return;
     }
     *acldata = cbdataAlloc(acl_user_ip_data);
-    if ((t = strtokFile())) {
-       debug(28, 5) ("aclParseUserMaxIP: First token is %s\n", t);
-       if (strcmp("-s", t) == 0) {
-           debug(28, 5) ("aclParseUserMaxIP: Going strict\n");
-           (*acldata)->flags.strict = 1;
-       } else {
-           (*acldata)->max = atoi(t);
-           debug(28, 5) ("aclParseUserMaxIP: Max IP address's %d\n", (int) (*acldata)->max);
-       }
-    } else
-       fatal("aclParseUserMaxIP: Malformed ACL %d\n");
+    t = strtokFile();
+    if (!t)
+       goto error;
+    debug(28, 5) ("aclParseUserMaxIP: First token is %s\n", t);
+    if (strcmp("-s", t) == 0) {
+       debug(28, 5) ("aclParseUserMaxIP: Going strict\n");
+       (*acldata)->flags.strict = 1;
+       t = strtokFile();
+       if (!t)
+           goto error;
+    }
+    (*acldata)->max = atoi(t);
+    debug(28, 5) ("aclParseUserMaxIP: Max IP address's %d\n", (int) (*acldata)->max);
+    return;
+error:
+    fatal("aclParseUserMaxIP: Malformed ACL %d\n");
 }
 
 void