From e1572f85d6247b760db10825b2fa688d7ed50bd3 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Wed, 20 Jun 2001 16:54:32 +0000 Subject: initial support for paramter type P_LIST it will avoid problems with lists being longer than 1024 bytes just now only ip list parameters have been converted to the new type (hosts allow, hosts deny, ssl hosts, ssl hosts resign) --- source/utils/testparm.c | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) (limited to 'source/utils/testparm.c') diff --git a/source/utils/testparm.c b/source/utils/testparm.c index ae4a12a8825..b8536d4b9da 100644 --- a/source/utils/testparm.c +++ b/source/utils/testparm.c @@ -237,23 +237,28 @@ int main(int argc, char *argv[]) for (s=0;s<1000;s++) { if (VALID_SNUM(s)) { - char *deny_list = lp_hostsdeny(s); - char *allow_list = lp_hostsallow(s); + char **deny_list = lp_hostsdeny(s); + char **allow_list = lp_hostsallow(s); + int i; if(deny_list) { - char *hasstar = strchr(deny_list, '*'); - char *hasquery = strchr(deny_list, '?'); - if(hasstar || hasquery) { - printf("Invalid character %c in hosts deny list %s for service %s.\n", - hasstar ? *hasstar : *hasquery, deny_list, lp_servicename(s) ); + for (i=0; deny_list[i]; i++) { + char *hasstar = strchr(deny_list[i], '*'); + char *hasquery = strchr(deny_list[i], '?'); + if(hasstar || hasquery) { + printf("Invalid character %c in hosts deny list (%s) for service %s.\n", + hasstar ? *hasstar : *hasquery, deny_list[i], lp_servicename(s) ); + } } } if(allow_list) { - char *hasstar = strchr(allow_list, '*'); - char *hasquery = strchr(allow_list, '?'); - if(hasstar || hasquery) { - printf("Invalid character %c in hosts allow list %s for service %s.\n", - hasstar ? *hasstar : *hasquery, allow_list, lp_servicename(s) ); + for (i=0; allow_list[i]; i++) { + char *hasstar = strchr(allow_list[i], '*'); + char *hasquery = strchr(allow_list[i], '?'); + if(hasstar || hasquery) { + printf("Invalid character %c in hosts allow list (%s) for service %s.\n", + hasstar ? *hasstar : *hasquery, allow_list[i], lp_servicename(s) ); + } } } -- cgit