#include "db_wrap.h"
#include "dsdb/samdb/samdb.h"
#include "dsdb/common/flags.h"
+#include "param/param.h"
/*
connect to the SAM database
struct auth_session_info *session_info)
{
struct ldb_context *ldb;
- ldb = ldb_wrap_connect(mem_ctx, lp_sam_url(), session_info,
+ ldb = ldb_wrap_connect(mem_ctx, global_loadparm,
+ lp_sam_url(global_loadparm), session_info,
NULL, 0, NULL);
if (!ldb) {
return NULL;
{
int i;
struct ldb_message_element *el = ldb_msg_find_element(msg, name);
- struct ldb_val v;
-
- v.data = discard_const_p(uint8_t, value);
- v.length = strlen(value);
if (!el) {
return NULL;
}
for (i=0;i<el->num_values;i++) {
- if (strcasecmp(value, (char *)el->values[i].data) == 0) {
+ if (ldb_attr_cmp(value, (char *)el->values[i].data) == 0) {
return el;
}
}
struct dom_sid *domain_sid;
/* see if we have a cached copy */
- domain_sid = ldb_get_opaque(ldb, "cache.domain_sid");
+ domain_sid = (struct dom_sid *)ldb_get_opaque(ldb, "cache.domain_sid");
if (domain_sid) {
return domain_sid;
}
struct ldb_dn *settings_dn;
/* see if we have a cached copy */
- settings_dn = ldb_get_opaque(ldb, "cache.settings_dn");
+ settings_dn = (struct ldb_dn *)ldb_get_opaque(ldb, "cache.settings_dn");
if (settings_dn) {
return settings_dn;
}
struct GUID *invocation_id;
/* see if we have a cached copy */
- invocation_id = ldb_get_opaque(ldb, "cache.invocation_id");
+ invocation_id = (struct GUID *)ldb_get_opaque(ldb, "cache.invocation_id");
if (invocation_id) {
return invocation_id;
}
struct GUID *invocation_id_old;
/* see if we have a cached copy */
- invocation_id_old = ldb_get_opaque(ldb, "cache.invocation_id");
+ invocation_id_old = (struct GUID *)ldb_get_opaque(ldb,
+ "cache.invocation_id");
tmp_ctx = talloc_new(ldb);
if (tmp_ctx == NULL) {
struct GUID *ntds_guid;
/* see if we have a cached copy */
- ntds_guid = ldb_get_opaque(ldb, "cache.ntds_guid");
+ ntds_guid = (struct GUID *)ldb_get_opaque(ldb, "cache.ntds_guid");
if (ntds_guid) {
return ntds_guid;
}
struct GUID *ntds_guid_old;
/* see if we have a cached copy */
- ntds_guid_old = ldb_get_opaque(ldb, "cache.ntds_guid");
+ ntds_guid_old = (struct GUID *)ldb_get_opaque(ldb, "cache.ntds_guid");
tmp_ctx = talloc_new(ldb);
if (tmp_ctx == NULL) {