s4:server: avoid calling into nss_winbind from within 'samba'
[mat/samba.git] / source4 / smbd / server.c
index 0ad3e6ba4157a649f679ce8a2f27eaecb520380b..37aac625b6c8cdfd6500163507c8b7411107541d 100644 (file)
@@ -43,6 +43,7 @@
 #include "cluster/cluster.h"
 #include "dynconfig/dynconfig.h"
 #include "lib/util/samba_modules.h"
+#include "nsswitch/winbind_client.h"
 
 /*
   recursively delete a directory tree
@@ -402,6 +403,12 @@ static int binary_smbd_main(const char *binary_name, int argc, const char *argv[
                }
        }
 
+       /* make sure we won't go through nss_winbind */
+       if (!winbind_off()) {
+               DEBUG(0,("Failed to disable recusive winbindd calls.  Exiting.\n"));
+               exit(1);
+       }
+
        gensec_init(); /* FIXME: */
 
        ntptr_init();   /* FIXME: maybe run this in the initialization function