s3-testparm Warn about incorrect use of 'password server'
authorAndrew Bartlett <abartlet@samba.org>
Wed, 18 May 2011 01:53:34 +0000 (11:53 +1000)
committerKarolin Seeger <kseeger@samba.org>
Thu, 26 May 2011 18:12:13 +0000 (20:12 +0200)
The last 5 patches address bug #8151 (deprecate security parameters for 3.6).

source3/utils/testparm.c

index 978ada26c653b814ced62d52345442b288932586..6076a57eb45e662483aec59f639cea727fa15ea0 100644 (file)
@@ -128,20 +128,35 @@ 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 );
+               fprintf(stderr, "ERROR: The setting 'security=%s' requires the 'password server' parameter be set\n"
+                       "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' should NOT be combined with the 'password server' parameter.\n"
+                       "(by default Samba will discover the correct DC to contact automatically).\n", sec_setting );
+       }
+
        /*
         * Password chat sanity checks.
         */