s3-winbindd: Honour pdb_is_responsible_for_everything_else()
authorAndrew Bartlett <abartlet@samba.org>
Fri, 28 Mar 2014 02:37:19 +0000 (15:37 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Sun, 15 Jun 2014 22:26:26 +0000 (00:26 +0200)
This allows us to avoid running idmap_init_default_domain() which
gives an error in the default AD DC config.

Andrew Bartlett

Change-Id: I923bd941951f6a907e6fa1ad167e5218a01040ff
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
source3/winbindd/idmap.c

index 97a34d4bddb34c8fef41b0b9d5da861be9322926..674f54ced1cd7d1395e0eb48e135d86bbc47783c 100644 (file)
@@ -25,6 +25,7 @@
 #include "winbindd.h"
 #include "idmap.h"
 #include "lib/util_sid_passdb.h"
+#include "passdb.h"
 
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_IDMAP
@@ -330,14 +331,16 @@ static struct idmap_domain *idmap_passdb_domain(TALLOC_CTX *mem_ctx)
 {
        idmap_init();
 
-       /*
-        * Always init the default domain, we can't go without one
-        */
-       if (default_idmap_domain == NULL) {
-               default_idmap_domain = idmap_init_default_domain(NULL);
-       }
-       if (default_idmap_domain == NULL) {
-               return NULL;
+       if (!pdb_is_responsible_for_everything_else()) {
+               /*
+                * Always init the default domain, we can't go without one
+                */
+               if (default_idmap_domain == NULL) {
+                       default_idmap_domain = idmap_init_default_domain(NULL);
+               }
+               if (default_idmap_domain == NULL) {
+                       return NULL;
+               }
        }
 
        if (passdb_idmap_domain != NULL) {