From 78e0ce43a3b41059fbacea1210b440353d4ac8ed Mon Sep 17 00:00:00 2001 From: hno <> Date: Fri, 14 Jun 2002 22:27:13 +0000 Subject: [PATCH] Corrected parsing of the max_user_ip -s option (forgot the number of allowed IPs) --- src/acl.cc | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/src/acl.cc b/src/acl.cc index 6a553c560c..7a317ac564 100644 --- a/src/acl.cc +++ b/src/acl.cc @@ -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 -- 2.47.3