summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb/ldb_modules/samldb.c
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2006-02-22 05:21:43 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:51:59 -0500
commitd590dea10b3abf93fcc8138189291e8b66bae7d7 (patch)
treed859a38ca49d480c36e3a8a3ef2ac28e2b964066 /source4/dsdb/samdb/ldb_modules/samldb.c
parent00fe70e5b917769418f68eaa255d3a06a9a08ce7 (diff)
downloadsamba-d590dea10b3abf93fcc8138189291e8b66bae7d7.tar.gz
samba-d590dea10b3abf93fcc8138189291e8b66bae7d7.tar.bz2
samba-d590dea10b3abf93fcc8138189291e8b66bae7d7.zip
r13615: Make ldb_set_errstring get ldb instead of module as parameter.
The module was just used to get to the ldb so it was meningless. Also add LDB_WAIT_ONCE e relative code in ldb_ildap.c (This used to be commit d5b467b7c132b0bd4d23918ba7bf3370b1afcce8)
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules/samldb.c')
-rw-r--r--source4/dsdb/samdb/ldb_modules/samldb.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/samldb.c b/source4/dsdb/samdb/ldb_modules/samldb.c
index 07f617f4b5..a582127bbe 100644
--- a/source4/dsdb/samdb/ldb_modules/samldb.c
+++ b/source4/dsdb/samdb/ldb_modules/samldb.c
@@ -180,7 +180,9 @@ static int samldb_find_next_rid(struct ldb_module *module, TALLOC_CTX *mem_ctx,
str = ldb_msg_find_string(res->msgs[0], "nextRid", NULL);
if (str == NULL) {
- ldb_set_errstring(module, talloc_asprintf(mem_ctx, "attribute nextRid not found in %s\n", ldb_dn_linearize(res, dn)));
+ ldb_set_errstring(module->ldb,
+ talloc_asprintf(mem_ctx, "attribute nextRid not found in %s\n",
+ ldb_dn_linearize(res, dn)));
talloc_free(res);
return -1;
}
@@ -337,7 +339,11 @@ int samldb_notice_sid(struct ldb_module *module,
"objectSid=%s",
ldap_encode_ndr_dom_sid(mem_ctx, sid));
if (ret > 0) {
- ldb_set_errstring(module, talloc_asprintf(mem_ctx, "Attempt to add record with SID %s rejected, because this SID is already in the database", dom_sid_string(mem_ctx, sid)));
+ ldb_set_errstring(module->ldb,
+ talloc_asprintf(mem_ctx,
+ "Attempt to add record with SID %s rejected,"
+ " because this SID is already in the database",
+ dom_sid_string(mem_ctx, sid)));
/* We have a duplicate SID, we must reject the add */
talloc_free(dom_msgs);
return LDB_ERR_CONSTRAINT_VIOLATION;
@@ -605,7 +611,7 @@ static int samldb_fill_user_or_computer_object(struct ldb_module *module, const
rdn = ldb_dn_get_rdn(msg2, msg2->dn);
if (strcasecmp(rdn->name, "cn") != 0) {
- ldb_set_errstring(module, talloc_asprintf(module, "Bad RDN (%s=) for user/computer, should be CN=!\n", rdn->name));
+ ldb_set_errstring(module->ldb, talloc_asprintf(module, "Bad RDN (%s=) for user/computer, should be CN=!\n", rdn->name));
talloc_free(mem_ctx);
return LDB_ERR_CONSTRAINT_VIOLATION;
}
@@ -681,7 +687,7 @@ static int samldb_fill_foreignSecurityPrincipal_object(struct ldb_module *module
rdn = ldb_dn_get_rdn(msg2, msg2->dn);
if (strcasecmp(rdn->name, "cn") != 0) {
- ldb_set_errstring(module, talloc_asprintf(module, "Bad RDN (%s=) for ForeignSecurityPrincipal, should be CN=!", rdn->name));
+ ldb_set_errstring(module->ldb, talloc_asprintf(module, "Bad RDN (%s=) for ForeignSecurityPrincipal, should be CN=!", rdn->name));
talloc_free(mem_ctx);
return LDB_ERR_CONSTRAINT_VIOLATION;
}
@@ -692,7 +698,7 @@ static int samldb_fill_foreignSecurityPrincipal_object(struct ldb_module *module
sid = dom_sid_parse_talloc(msg2, (const char *)rdn->value.data);
if (!sid) {
- ldb_set_errstring(module, talloc_asprintf(module, "No valid found SID in ForeignSecurityPrincipal CN!"));
+ ldb_set_errstring(module->ldb, talloc_asprintf(module, "No valid found SID in ForeignSecurityPrincipal CN!"));
talloc_free(mem_ctx);
return LDB_ERR_CONSTRAINT_VIOLATION;
}
@@ -718,7 +724,7 @@ static int samldb_fill_foreignSecurityPrincipal_object(struct ldb_module *module
ldap_encode_ndr_dom_sid(mem_ctx, dom_sid));
if (ret >= 1) {
const char *name = samdb_result_string(dom_msgs[0], "name", NULL);
- ldb_set_errstring(module, talloc_asprintf(mem_ctx, "Attempt to add foreign SID record with SID %s rejected, because this domian (%s) is already in the database", dom_sid_string(mem_ctx, sid), name));
+ ldb_set_errstring(module->ldb, talloc_asprintf(mem_ctx, "Attempt to add foreign SID record with SID %s rejected, because this domian (%s) is already in the database", dom_sid_string(mem_ctx, sid), name));
/* We don't really like the idea of foreign sids that are not foreign */
return LDB_ERR_CONSTRAINT_VIOLATION;
} else if (ret == -1) {