Add auto-detect of time server. Uses master browser.
[kai/samba.git] / source3 / utils / testparm.c
index c1b8b10a84afac87e67c030487a6b8f7075bfec6..b727f883fde9d69b7cb1758d411327a8cb73ad6f 100644 (file)
@@ -1,6 +1,5 @@
 /* 
-   Unix SMB/Netbios implementation.
-   Version 1.9.
+   Unix SMB/CIFS implementation.
    Test validity of smb.conf
    Copyright (C) Karl Auer 1993, 1994-1998
 
@@ -35,6 +34,8 @@
 #include "includes.h"
 #include "smb.h"
 
+extern BOOL AllowDebugChange;
+
 /***********************************************
  Here we do a set of 'hard coded' checks for bad
  configuration settings.
@@ -45,7 +46,7 @@ static int do_global_checks(void)
        int ret = 0;
        SMB_STRUCT_STAT st;
 
-       if (lp_security() == SEC_DOMAIN && !lp_encrypted_passwords()) {
+       if (lp_security() >= SEC_DOMAIN && !lp_encrypted_passwords()) {
                printf("ERROR: in 'security=domain' mode the 'encrypt passwords' parameter must also be set to 'true'.\n");
                ret = 1;
        }
@@ -66,11 +67,17 @@ cannot be set in the smb.conf file. nmbd will abort with this setting.\n");
                ret = 1;
        }
 
+       if (!directory_exist(lp_piddir(), &st)) {
+               printf("ERROR: pid directory %s does not exist\n",
+                      lp_piddir());
+               ret = 1;
+       }
+
        /*
         * 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()) {
                pstring sec_setting;
                if(lp_security() == SEC_SERVER)
                        pstrcpy(sec_setting, "server");
@@ -84,7 +91,7 @@ to a valid password server.\n", sec_setting );
 
        
        /*
-        * Check 'hosts equiv' and 'use rhosts' compatability with 'hostname lookup' value.
+        * Check 'hosts equiv' and 'use rhosts' compatibility with 'hostname lookup' value.
         */
 
        if(*lp_hosts_equiv() && !lp_hostname_lookups()) {
@@ -92,12 +99,6 @@ to a valid password server.\n", sec_setting );
                ret = 1;
        }
 
-       if(lp_use_rhosts() && !lp_hostname_lookups()) {
-               printf("ERROR: The setting 'use rhosts = yes' requires the 'hostname lookups = yes'.\n");
-               ret = 1;
-       }
-
-
        /*
         * Password chat sanity checks.
         */
@@ -157,6 +158,15 @@ via the %%o substitution. With encrypted passwords this is not possible.\n", lp_
                }
        }
 
+       if (strlen(lp_winbind_separator()) != 1) {
+               printf("ERROR: the 'winbind separator' parameter must be a single character.\n");
+               ret = 1;
+       }
+
+       if (*lp_winbind_separator() == '+') {
+               printf("'winbind separator = +' might cause problems with group membership.\n");
+       }
+
        return ret;
 }   
 
@@ -222,6 +232,7 @@ int main(int argc, char *argv[])
 
   dbf = x_stdout;
   DEBUGLEVEL = 2;
+  AllowDebugChange = False;
 
   printf("Load smb config files from %s\n",configfile);