struct auth_session_info *session_info)
{
struct ldb_context *ldb;
+ struct dsdb_schema *schema;
ldb = ldb_wrap_connect(mem_ctx, ev_ctx, lp_ctx,
lpcfg_sam_url(lp_ctx), session_info,
samdb_credentials(ev_ctx, lp_ctx),
0);
+
if (!ldb) {
return NULL;
}
+
+ schema = dsdb_get_schema(ldb, NULL);
+ /* make the resulting schema global */
+ if (schema) {
+ dsdb_make_schema_global(ldb, schema);
+ }
+
return ldb;
}
case LDB_DEBUG_TRACE:
samba_level = 5;
break;
-
+
};
vasprintf(&s, fmt, ap);
if (!s) return;
return 0;
}
+
/*
wrapped connection to a ldb database
to close just talloc_free() the returned ldb_context
DLIST_ADD(ldb_wrap_list, w);
- /* make the resulting schema global */
- if (lp_ctx != NULL && strcmp(lpcfg_sam_url(lp_ctx), url) == 0) {
- struct dsdb_schema *schema = dsdb_get_schema(ldb, NULL);
- if (schema) {
- dsdb_make_schema_global(ldb, schema);
- }
- }
-
DEBUG(3,("ldb_wrap open of %s\n", url));
talloc_set_destructor(w, ldb_wrap_destructor);
return ret;
}
-
}
return LDB_SUCCESS;
autoproto='ldif_handlers_proto.h',
public_deps='ldb',
public_headers='ldb_wrap.h',
- deps='LIBSECURITY SAMDB_SCHEMA LIBNDR NDR_DRSBLOBS CREDENTIALS UTIL_LDB NDR_DNSP'
+ deps='LIBSECURITY LIBNDR NDR_DRSBLOBS CREDENTIALS UTIL_LDB NDR_DNSP'
)