summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1998-12-10 03:05:28 +0000
committerJeremy Allison <jra@samba.org>1998-12-10 03:05:28 +0000
commite565db420bc6ee4a2688b5de5e9fea83f4b0cc8e (patch)
tree1b7dba17ad3939b4f32b88473ffe780b4dee538a
parent0bf6c811b7b92ec4b816730d2cece483c02c5826 (diff)
downloadsamba-e565db420bc6ee4a2688b5de5e9fea83f4b0cc8e.tar.gz
samba-e565db420bc6ee4a2688b5de5e9fea83f4b0cc8e.tar.xz
samba-e565db420bc6ee4a2688b5de5e9fea83f4b0cc8e.zip
Added check for invalid wildcard characters '*' and '?'
in hosts allow/deny checks. Jeremy.
-rw-r--r--source/utils/testparm.c24
1 files changed, 24 insertions, 0 deletions
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) {