s3-testparm Warn more on incorrect use of 'password server'
authorAndrew Bartlett <abartlet@samba.org>
Wed, 18 May 2011 01:53:34 +0000 (11:53 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 18 May 2011 14:12:08 +0000 (16:12 +0200)
source3/utils/testparm.c

index 0e920ec69656e310275a5bdd3cb47aef3d9570a3..edb11a6b055439eece4bb0ad4edd28e7d9e5280f 100644 (file)
@@ -128,17 +128,32 @@ cannot be set in the smb.conf file. nmbd will abort with this setting.\n");
         * Password server sanity checks.
         */
 
-       if((lp_security() == SEC_SERVER || lp_security() >= SEC_DOMAIN) && !lp_passwordserver()) {
+       if((lp_security() == SEC_SERVER || lp_security() >= SEC_DOMAIN) && !*lp_passwordserver()) {
                const char *sec_setting;
                if(lp_security() == SEC_SERVER)
                        sec_setting = "server";
                else if(lp_security() == SEC_DOMAIN)
                        sec_setting = "domain";
+               else if(lp_security() == SEC_ADS)
+                       sec_setting = "ads";
                else
                        sec_setting = "";
 
                fprintf(stderr, "ERROR: The setting 'security=%s' requires the 'password server' parameter be set \
-to a valid password server.\n", sec_setting );
+to the default value * or a valid password server.\n", sec_setting );
+               ret = 1;
+       }
+
+       if((lp_security() >= SEC_DOMAIN) && (strcmp(lp_passwordserver(), "*") != 0)) {
+               const char *sec_setting;
+               if(lp_security() == SEC_DOMAIN)
+                       sec_setting = "domain";
+               else if(lp_security() == SEC_ADS)
+                       sec_setting = "ads";
+               else
+                       sec_setting = "";
+
+               fprintf(stderr, "WARNING: The setting 'security=%s' is should NOT be combined with the 'password server' parameter.\n  (by default Samba will discover the correct DC to contact automatically).\n", sec_setting );
                ret = 1;
        }