From: Jeremy Allison Date: Thu, 10 Dec 1998 03:05:28 +0000 (+0000) Subject: Added check for invalid wildcard characters '*' and '?' X-Git-Tag: samba-2.0.0beta4~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e565db420bc6ee4a2688b5de5e9fea83f4b0cc8e;p=thirdparty%2Fsamba.git Added check for invalid wildcard characters '*' and '?' in hosts allow/deny checks. Jeremy. --- diff --git a/source/utils/testparm.c b/source/utils/testparm.c index 9bf741e24f1..50e8cc3d74d 100644 --- a/source/utils/testparm.c +++ b/source/utils/testparm.c @@ -130,6 +130,30 @@ cannot be set in the smb.conf file. nmbd will abort with this setting.\n"); break; } + for (s=0;s<1000;s++) { + if (VALID_SNUM(s)) { + char *deny_list = lp_hostsdeny(s); + char *allow_list = lp_hostsallow(s); + 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) ); + } + } + + 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) ); + } + } + } + } + if (argc < 3) { if (!silent_mode) {