]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
Added check for invalid wildcard characters '*' and '?'
authorJeremy Allison <jra@samba.org>
Thu, 10 Dec 1998 03:05:28 +0000 (03:05 +0000)
committerJeremy Allison <jra@samba.org>
Thu, 10 Dec 1998 03:05:28 +0000 (03:05 +0000)
in hosts allow/deny checks.
Jeremy.

source/utils/testparm.c

index 9bf741e24f14ae3df926ef7da22d69bf7814c9ae..50e8cc3d74d53162577ec742ce3eff41a602cfcb 100644 (file)
@@ -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) {