First part of fix for bug #7777 - When requesting lookups for BUILTIN sids, winbindd...
authorJeremy Allison <jra@samba.org>
Mon, 8 Nov 2010 21:38:13 +0000 (13:38 -0800)
committerJeremy Allison <jra@samba.org>
Mon, 8 Nov 2010 21:38:13 +0000 (13:38 -0800)
Ensure idmap_init_passdb_domain() correctly initialized the default
domain first.

Jeremy.

source3/winbindd/idmap.c

index 102f4ebb7fca7f80eba0c2877962765c206a4bb4..feaf297a7b7b01f2b20ba9e2f04fb0e2e7002018 100644 (file)
@@ -448,6 +448,16 @@ static struct idmap_domain *idmap_init_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 (passdb_idmap_domain != NULL) {
                return passdb_idmap_domain;
        }