s3:testparm: avoid spurious warnings about dos mode mapping and create mask if store...
authorGregor Beck <gbeck@sernet.de>
Wed, 6 Jul 2011 13:10:27 +0000 (15:10 +0200)
committerMichael Adam <obnox@samba.org>
Wed, 27 Jul 2011 14:20:13 +0000 (16:20 +0200)
source3/utils/testparm.c

index 6076a57eb45e662483aec59f639cea727fa15ea0..ff750f0493be7223d38d3c95c96156adddcfe5b4 100644 (file)
@@ -301,25 +301,33 @@ static void do_per_share_checks(int s)
                           lp_servicename(s) );
        }
 
-       if (lp_map_hidden(s) && !(lp_create_mask(s) & S_IXOTH)) {
-               fprintf(stderr,"Invalid combination of parameters for service %s. \
-                          Map hidden can only work if create mask includes octal 01 (S_IXOTH).\n",
-                          lp_servicename(s) );
-       }
-       if (lp_map_hidden(s) && (lp_force_create_mode(s) & S_IXOTH)) {
-               fprintf(stderr,"Invalid combination of parameters for service %s. \
-                          Map hidden can only work if force create mode excludes octal 01 (S_IXOTH).\n",
-                          lp_servicename(s) );
-       }
-       if (lp_map_system(s) && !(lp_create_mask(s) & S_IXGRP)) {
-               fprintf(stderr,"Invalid combination of parameters for service %s. \
-                          Map system can only work if create mask includes octal 010 (S_IXGRP).\n",
-                          lp_servicename(s) );
-       }
-       if (lp_map_system(s) && (lp_force_create_mode(s) & S_IXGRP)) {
-               fprintf(stderr,"Invalid combination of parameters for service %s. \
-                          Map system can only work if force create mode excludes octal 010 (S_IXGRP).\n",
-                          lp_servicename(s) );
+       if (!lp_store_dos_attributes(s) && lp_map_hidden(s)
+           && !(lp_create_mask(s) & S_IXOTH))
+       {
+               fprintf(stderr,"Invalid combination of parameters for service "
+                       "%s. Map hidden can only work if create mask includes "
+                       "octal 01 (S_IXOTH).\n", lp_servicename(s));
+       }
+       if (!lp_store_dos_attributes(s) && lp_map_hidden(s)
+           && (lp_force_create_mode(s) & S_IXOTH))
+       {
+               fprintf(stderr,"Invalid combination of parameters for service "
+                       "%s. Map hidden can only work if force create mode "
+                       "excludes octal 01 (S_IXOTH).\n", lp_servicename(s));
+       }
+       if (!lp_store_dos_attributes(s) && lp_map_system(s)
+           && !(lp_create_mask(s) & S_IXGRP))
+       {
+               fprintf(stderr,"Invalid combination of parameters for service "
+                       "%s. Map system can only work if create mask includes "
+                       "octal 010 (S_IXGRP).\n", lp_servicename(s));
+       }
+       if (!lp_store_dos_attributes(s) && lp_map_system(s)
+           && (lp_force_create_mode(s) & S_IXGRP))
+       {
+               fprintf(stderr,"Invalid combination of parameters for service "
+                       "%s. Map system can only work if force create mode "
+                       "excludes octal 010 (S_IXGRP).\n", lp_servicename(s));
        }
 #ifdef HAVE_CUPS
        if (lp_printing(s) == PRINT_CUPS && *(lp_printcommand(s)) != '\0') {