Push loading the objectGUID and objectSID handlers earlier.
authorAndrew Bartlett <abartlet@samba.org>
Thu, 21 Aug 2008 07:29:47 +0000 (17:29 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 21 Aug 2008 07:29:47 +0000 (17:29 +1000)
Andrew Bartlett
(This used to be commit 0b6e53f80b063d8702718c84409d7b069aee9c05)

source4/lib/ldb_wrap.c

index 883597108a03638696bf671689ebf91be95d9d33..6c683a1e33068eb49f8d210f7c403966a3df75b7 100644 (file)
@@ -147,17 +147,21 @@ struct ldb_context *ldb_wrap_connect(TALLOC_CTX *mem_ctx,
                talloc_free(ldb);
                return NULL;
        }
                talloc_free(ldb);
                return NULL;
        }
-       
-       if (lp_ctx != NULL && strcmp(lp_sam_url(lp_ctx), url) == 0) {
-               dsdb_set_global_schema(ldb);
-       }
 
 
+       /* This must be done before we load the schema, as these
+        * handlers for objectSid and objectGUID etc must take
+        * precedence over the 'binary attribute' declaration in the
+        * schema */
        ret = ldb_register_samba_handlers(ldb);
        if (ret == -1) {
                talloc_free(ldb);
                return NULL;
        }
 
        ret = ldb_register_samba_handlers(ldb);
        if (ret == -1) {
                talloc_free(ldb);
                return NULL;
        }
 
+       if (lp_ctx != NULL && strcmp(lp_sam_url(lp_ctx), url) == 0) {
+               dsdb_set_global_schema(ldb);
+       }
+
        ldb_set_debug(ldb, ldb_wrap_debug, NULL);
 
        ldb_set_utf8_fns(ldb, NULL, wrap_casefold);
        ldb_set_debug(ldb, ldb_wrap_debug, NULL);
 
        ldb_set_utf8_fns(ldb, NULL, wrap_casefold);