r13615: Make ldb_set_errstring get ldb instead of module as parameter.
authorSimo Sorce <idra@samba.org>
Wed, 22 Feb 2006 05:21:43 +0000 (05:21 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:51:59 +0000 (13:51 -0500)
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)

15 files changed:
source4/dsdb/samdb/ldb_modules/kludge_acl.c
source4/dsdb/samdb/ldb_modules/password_hash.c
source4/dsdb/samdb/ldb_modules/proxy.c
source4/dsdb/samdb/ldb_modules/samldb.c
source4/lib/ldb/common/ldb.c
source4/lib/ldb/common/ldb_debug.c
source4/lib/ldb/include/ldb.h
source4/lib/ldb/include/ldb_private.h
source4/lib/ldb/ldb_ildap/ldb_ildap.c
source4/lib/ldb/ldb_ldap/ldb_ldap.c
source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c
source4/lib/ldb/ldb_tdb/ldb_tdb.c
source4/lib/ldb/modules/ldb_map.c
source4/lib/ldb/modules/objectclass.c
source4/nbt_server/wins/wins_ldb.c

index 83c7d14da4c3341948fd4b959af5f6ccf08cc02a..9ce32171042a9b4b6d6bfc2251e812a361e27184 100644 (file)
@@ -135,7 +135,7 @@ static int kludge_acl_change(struct ldb_module *module, struct ldb_request *req)
        case ADMINISTRATOR:
                return ldb_next_request(module, req);
        default:
-               ldb_set_errstring(module, 
+               ldb_set_errstring(module->ldb
                                  talloc_asprintf(req, "kludge_acl_change: "
                                                  "attempted database modify not permitted. User %s is not SYSTEM or an administrator",
                                                  user_name(req, module)));
index 630edf1c7a96b0826eecc74be4d27d49ce65ac04..e28c85ae37d80501ed5076a32062f08f9a8c2fcf 100644 (file)
@@ -167,7 +167,7 @@ static int password_hash_handle(struct ldb_module *module, struct ldb_request *r
        
        if (req->operation == LDB_REQ_ADD) {
                if (attribute->num_values > 1) {
-                       ldb_set_errstring(module
+                       ldb_set_errstring(module->ldb,
                                          talloc_asprintf(mem_ctx, "sambaPassword_handle: "
                                                          "attempted set of multiple sambaPassword attributes on %s rejected",
                                                          ldb_dn_linearize(mem_ctx, dn)));
@@ -182,7 +182,7 @@ static int password_hash_handle(struct ldb_module *module, struct ldb_request *r
        } else if (((attribute->flags & LDB_FLAG_MOD_MASK) == LDB_FLAG_MOD_ADD)
                   || ((attribute->flags & LDB_FLAG_MOD_MASK) == LDB_FLAG_MOD_REPLACE)) {
                if (attribute->num_values > 1) {
-                       ldb_set_errstring(module
+                       ldb_set_errstring(module->ldb,
                                          talloc_asprintf(mem_ctx, "sambaPassword_handle: "
                                                          "attempted set of multiple sambaPassword attributes on %s rejected",
                                                          ldb_dn_linearize(mem_ctx, dn)));
@@ -234,7 +234,7 @@ static int password_hash_handle(struct ldb_module *module, struct ldb_request *r
                talloc_free(search_request);
                
                if (old_res->count != 1) {
-                       ldb_set_errstring(module, 
+                       ldb_set_errstring(module->ldb
                                          talloc_asprintf(mem_ctx, "password_hash_handle: "
                                                          "(pre) search for %s found %d != 1 objects, for entry we just modified",
                                                          ldb_dn_linearize(mem_ctx, dn),
@@ -280,7 +280,7 @@ static int password_hash_handle(struct ldb_module *module, struct ldb_request *r
        talloc_free(search_request);
 
        if (res->count != 1) {
-               ldb_set_errstring(module
+               ldb_set_errstring(module->ldb,
                                  talloc_asprintf(mem_ctx, "password_hash_handle: "
                                                  "search for %s found %d != 1 objects, for entry we just added/modified",
                                                  ldb_dn_linearize(mem_ctx, dn),
@@ -308,7 +308,7 @@ static int password_hash_handle(struct ldb_module *module, struct ldb_request *r
                /* Not a 'person', so the rest of this doesn't make
                 * sense.  How we got a sambaPassword this far I don't
                 * know... */
-               ldb_set_errstring(module
+               ldb_set_errstring(module->ldb,
                                  talloc_asprintf(mem_ctx, "password_hash_handle: "
                                                  "attempted set of sambaPassword on non-'person' object %s rejected",
                                                  ldb_dn_linearize(mem_ctx, dn)));
@@ -338,7 +338,7 @@ static int password_hash_handle(struct ldb_module *module, struct ldb_request *r
 
        if (dom_res->count != 1) {
                /* What happend?  The user we are modifying must be odd... */
-               ldb_set_errstring(module, 
+               ldb_set_errstring(module->ldb
                                  talloc_asprintf(mem_ctx, "password_hash_handle: "
                                                  "search for domain %s found %d != 1 objects",
                                                  dom_sid_string(mem_ctx, domain_sid),
@@ -414,7 +414,7 @@ static int password_hash_handle(struct ldb_module *module, struct ldb_request *r
                        char *samAccountName = talloc_strdup(mem_ctx, ldb_msg_find_string(res->msgs[0], "samAccountName", NULL));
                        char *saltbody;
                        if (!samAccountName) {
-                               ldb_set_errstring(module
+                               ldb_set_errstring(module->ldb,
                                                  talloc_asprintf(mem_ctx, "password_hash_handle: "
                                                                  "generation of new kerberos keys failed: %s is a computer without a samAccountName",
                                                                  ldb_dn_linearize(mem_ctx, dn)));
@@ -443,7 +443,7 @@ static int password_hash_handle(struct ldb_module *module, struct ldb_request *r
                } else {
                        const char *samAccountName = ldb_msg_find_string(res->msgs[0], "samAccountName", NULL);
                        if (!samAccountName) {
-                               ldb_set_errstring(module
+                               ldb_set_errstring(module->ldb,
                                                  talloc_asprintf(mem_ctx, "password_hash_handle: "
                                                                  "generation of new kerberos keys failed: %s has no samAccountName",
                                                                  ldb_dn_linearize(mem_ctx, dn)));
@@ -455,7 +455,7 @@ static int password_hash_handle(struct ldb_module *module, struct ldb_request *r
 
 
                if (krb5_ret) {
-                       ldb_set_errstring(module
+                       ldb_set_errstring(module->ldb,
                                          talloc_asprintf(mem_ctx, "password_hash_handle: "
                                                          "generation of a saltking principal failed: %s",
                                                          smb_get_krb5_error_message(smb_krb5_context->krb5_context, 
@@ -470,7 +470,7 @@ static int password_hash_handle(struct ldb_module *module, struct ldb_request *r
                krb5_free_principal(smb_krb5_context->krb5_context, salt_principal);
 
                if (krb5_ret) {
-                       ldb_set_errstring(module
+                       ldb_set_errstring(module->ldb,
                                          talloc_asprintf(mem_ctx, "password_hash_handle: "
                                                          "generation of new kerberos keys failed: %s",
                                                          smb_get_krb5_error_message(smb_krb5_context->krb5_context, 
index 2c66d2c1ec6079891efdfe9fc5f2d65a4ff5ba99..511f9aeec587c9eecda88bbf36a9b6fe6a7c21f0 100644 (file)
@@ -291,7 +291,7 @@ static int proxy_search_bytree(struct ldb_module *module, struct ldb_request *re
        newreq.controls = req->controls;
        ret = ldb_request(proxy->upstream, &newreq);
        if (ret != LDB_SUCCESS) {
-               ldb_set_errstring(module, talloc_strdup(module, ldb_errstring(proxy->upstream)));
+               ldb_set_errstring(module->ldb, talloc_strdup(module, ldb_errstring(proxy->upstream)));
                return -1;
        }
 
index 07f617f4b5cb531a1f7c193676b78a5a617b0ebe..a582127bbeab2f552ccc03bbb697923355192b2b 100644 (file)
@@ -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) {
index 68722cde96fdbdbef748c73dbb65403943758293..87705a855a0970be3ef824996ed409a5bd86e71d 100644 (file)
@@ -106,12 +106,12 @@ int ldb_connect(struct ldb_context *ldb, const char *url, unsigned int flags, co
        return LDB_SUCCESS;
 }
 
-void ldb_set_errstring(struct ldb_module *module, char *err_string)
+void ldb_set_errstring(struct ldb_context *ldb, char *err_string)
 {
-       if (module->ldb->err_string) {
-               talloc_free(module->ldb->err_string);
+       if (ldb->err_string) {
+               talloc_free(ldb->err_string);
        }
-       module->ldb->err_string = talloc_steal(module->ldb, err_string);
+       ldb->err_string = talloc_steal(ldb, err_string);
 }
 
 void ldb_reset_err_string(struct ldb_context *ldb)
@@ -158,7 +158,7 @@ int ldb_transaction_start(struct ldb_context *ldb)
        if (status != LDB_SUCCESS) {
                if (ldb->err_string == NULL) {
                        /* no error string was setup by the backend */
-                       ldb_set_errstring(ldb->modules
+                       ldb_set_errstring(ldb, 
                                          talloc_asprintf(ldb, "ldb transaction start error %d", status));
                }
        }
@@ -186,7 +186,7 @@ int ldb_transaction_commit(struct ldb_context *ldb)
        if (status != LDB_SUCCESS) {
                if (ldb->err_string == NULL) {
                        /* no error string was setup by the backend */
-                       ldb_set_errstring(ldb->modules
+                       ldb_set_errstring(ldb, 
                                          talloc_asprintf(ldb, "ldb transaction commit error %d", status));
                }
        }
@@ -212,7 +212,7 @@ int ldb_transaction_cancel(struct ldb_context *ldb)
        if (status != LDB_SUCCESS) {
                if (ldb->err_string == NULL) {
                        /* no error string was setup by the backend */
-                       ldb_set_errstring(ldb->modules
+                       ldb_set_errstring(ldb, 
                                          talloc_asprintf(ldb, "ldb transaction cancel error %d", status));
                }
        }
@@ -238,7 +238,7 @@ static int ldb_op_finish(struct ldb_context *ldb, int status)
        }
        if (ldb->err_string == NULL) {
                /* no error string was setup by the backend */
-               ldb_set_errstring(ldb->modules
+               ldb_set_errstring(ldb, 
                                  talloc_asprintf(ldb, "ldb error %d", status));
        }
        ldb_transaction_cancel(ldb);
@@ -330,7 +330,7 @@ int ldb_search(struct ldb_context *ldb,
 
        tree = ldb_parse_tree(ldb, expression);
        if (tree == NULL) {
-               ldb_set_errstring(ldb->modules, talloc_strdup(ldb, "Unable to parse search expression"));
+               ldb_set_errstring(ldb, talloc_strdup(ldb, "Unable to parse search expression"));
                return -1;
        }
 
index 21b02956b8745dafb37b9ae08d8402bd623cad79..c4718c7f52284c5f4c9a6c44522e9b0555e919d6 100644 (file)
@@ -97,7 +97,7 @@ void ldb_debug_set(struct ldb_context *ldb, enum ldb_debug_level level,
        msg = talloc_vasprintf(ldb, fmt, ap);
        va_end(ap);
        if (msg != NULL) {
-               ldb_set_errstring(ldb->modules, msg);
+               ldb_set_errstring(ldb, msg);
                ldb_debug(ldb, level, "%s", msg);
        }
 }
index 4a40e34363279bea59b83d282c424944a6c5a948..8a9e8bea76ad5a1d745ef71b4b5c067a242d5321 100644 (file)
@@ -577,10 +577,12 @@ enum ldb_reply_type {
 
 enum ldb_async_wait_type {
        LDB_WAIT_ALL,
+       LDB_WAIT_ONCE,
        LDB_WAIT_NONE
 };
 
 enum ldb_async_state {
+       LDB_ASYNC_INIT,
        LDB_ASYNC_PENDING,
        LDB_ASYNC_DONE
 };
index db34b5885876a7fa34a3503866327d7a7b185556..24967faeeaf00e8bb31e02742cd170b9f306b312 100644 (file)
@@ -133,7 +133,7 @@ int ldb_next_end_trans(struct ldb_module *module);
 int ldb_next_del_trans(struct ldb_module *module);
 int ldb_next_second_stage_init(struct ldb_module *module);
 
-void ldb_set_errstring(struct ldb_module *module, char *err_string);
+void ldb_set_errstring(struct ldb_context *ldb, char *err_string);
 void ldb_reset_err_string(struct ldb_context *ldb);
 
 /* The following definitions come from lib/ldb/common/ldb_debug.c  */
index 33d3954a73ae00b8b99eef00244cc9fd9208cb97..de32c10ba4e6a0498d657c08fe775dd377ec6e05 100644 (file)
@@ -230,7 +230,7 @@ static void ildb_async_callback(struct ldap_request *req)
                                }
                                if (msg->r.SearchResultDone.resultcode) {
                                        if (msg->r.SearchResultDone.errormessage) {
-                                               ldb_set_errstring(ac->module, talloc_strdup(ac->module, msg->r.SearchResultDone.errormessage));
+                                               ldb_set_errstring(ac->module->ldb, talloc_strdup(ac->module, msg->r.SearchResultDone.errormessage));
                                        }
                                }
 
@@ -309,13 +309,13 @@ static int ildb_request_send(struct ldb_module *module, struct ldap_message *msg
 
        h = talloc_zero(ildb->ldap, struct ldb_async_handle);
        if (h == NULL) {
-               ldb_set_errstring(module, talloc_asprintf(module, "Out of Memory"));
+               ldb_set_errstring(module->ldb, talloc_asprintf(module, "Out of Memory"));
                return LDB_ERR_OPERATIONS_ERROR;
        }
 
        ildb_ac = talloc(h, struct ildb_async_context);
        if (ildb_ac == NULL) {
-               ldb_set_errstring(module, talloc_asprintf(module, "Out of Memory"));
+               ldb_set_errstring(module->ldb, talloc_asprintf(module, "Out of Memory"));
                talloc_free(h);
                return LDB_ERR_OPERATIONS_ERROR;
        }
@@ -324,7 +324,7 @@ static int ildb_request_send(struct ldb_module *module, struct ldap_message *msg
 
        req = ldap_request_send(ildb->ldap, msg);
        if (req == NULL) {
-               ldb_set_errstring(module, talloc_asprintf(module, "async send request failed"));
+               ldb_set_errstring(module->ldb, talloc_asprintf(module, "async send request failed"));
                return LDB_ERR_OPERATIONS_ERROR;
        }
 
@@ -369,18 +369,18 @@ static int ildb_search_async(struct ldb_module *module, const struct ldb_dn *bas
        *handle = NULL;
 
        if (!callback || !context) {
-               ldb_set_errstring(module, talloc_asprintf(module, "Async interface called with NULL callback function or NULL context"));
+               ldb_set_errstring(module->ldb, talloc_asprintf(module, "Async interface called with NULL callback function or NULL context"));
                return LDB_ERR_OPERATIONS_ERROR;
        }
        
        if (tree == NULL) {
-               ldb_set_errstring(module, talloc_asprintf(module, "Invalid expression parse tree"));
+               ldb_set_errstring(module->ldb, talloc_asprintf(module, "Invalid expression parse tree"));
                return LDB_ERR_OPERATIONS_ERROR;
        }
 
        msg = new_ldap_message(ildb);
        if (msg == NULL) {
-               ldb_set_errstring(module, talloc_asprintf(module, "Out of Memory"));
+               ldb_set_errstring(module->ldb, talloc_asprintf(module, "Out of Memory"));
                return LDB_ERR_OPERATIONS_ERROR;
        }
 
@@ -397,7 +397,7 @@ static int ildb_search_async(struct ldb_module *module, const struct ldb_dn *bas
                msg->r.SearchRequest.basedn  = ldb_dn_linearize(msg, base);
        }
        if (msg->r.SearchRequest.basedn == NULL) {
-               ldb_set_errstring(module, talloc_asprintf(module, "Unable to determine baseDN"));
+               ldb_set_errstring(module->ldb, talloc_asprintf(module, "Unable to determine baseDN"));
                talloc_free(msg);
                return LDB_ERR_OPERATIONS_ERROR;
        }
@@ -434,7 +434,7 @@ static int ildb_search_sync_callback(struct ldb_context *ldb, void *context, str
        int n;
        
        if (!context) {
-               ldb_set_errstring(ldb->modules, talloc_asprintf(ldb, "NULL Context in callback"));
+               ldb_set_errstring(ldb, talloc_asprintf(ldb, "NULL Context in callback"));
                return LDB_ERR_OPERATIONS_ERROR;
        }       
 
@@ -923,6 +923,14 @@ static int ildb_async_wait(struct ldb_async_handle *handle, enum ldb_async_wait_
                        return LDB_ERR_OTHER;
                }
                break;
+       case LDB_WAIT_ONCE:
+               handle->state = LDB_ASYNC_INIT;
+               while (handle->status == LDB_SUCCESS && handle->state == LDB_ASYNC_INIT) {
+                      if (event_loop_once(ac->req->conn->event.event_ctx) != 0) {
+                               return LDB_ERR_OTHER;
+                       }
+               }
+               break;
        case LDB_WAIT_ALL:
                while (handle->status == LDB_SUCCESS && handle->state != LDB_ASYNC_DONE) {
                        if (event_loop_once(ac->req->conn->event.event_ctx) != 0) {
index 7233498eb36ee47bf1f3973f1809facf5c2f0873..c27ded7767625d43b9f433599dd83a09c4bd4ba4 100644 (file)
@@ -78,7 +78,7 @@ static int lldb_rename(struct ldb_module *module, const struct ldb_dn *olddn, co
 
        lldb->last_rc = ldap_rename_s(lldb->ldap, old_dn, newrdn, parentdn, 1, NULL, NULL);
        if (lldb->last_rc != LDAP_SUCCESS) {
-               ldb_set_errstring(module, talloc_strdup(module, ldap_err2string(lldb->last_rc)));
+               ldb_set_errstring(module->ldb, talloc_strdup(module, ldap_err2string(lldb->last_rc)));
                ret = -1;
        }
 
@@ -108,7 +108,7 @@ static int lldb_delete(struct ldb_module *module, const struct ldb_dn *edn)
 
        lldb->last_rc = ldap_delete_s(lldb->ldap, dn);
        if (lldb->last_rc != LDAP_SUCCESS) {
-               ldb_set_errstring(module, talloc_strdup(module, ldap_err2string(lldb->last_rc)));
+               ldb_set_errstring(module->ldb, talloc_strdup(module, ldap_err2string(lldb->last_rc)));
                ret = -1;
        }
 
@@ -226,7 +226,7 @@ static int lldb_search_bytree(struct ldb_module *module, const struct ldb_dn *ba
                                      0, &ldapres);
        talloc_free(search_base);
        if (lldb->last_rc != LDAP_SUCCESS) {
-               ldb_set_errstring(module, talloc_strdup(module, ldap_err2string(lldb->last_rc)));
+               ldb_set_errstring(module->ldb, talloc_strdup(module, ldap_err2string(lldb->last_rc)));
                return lldb->last_rc;
        }
 
@@ -412,7 +412,7 @@ static int lldb_add(struct ldb_module *module, const struct ldb_message *msg)
 
        lldb->last_rc = ldap_add_s(lldb->ldap, dn, mods);
        if (lldb->last_rc != LDAP_SUCCESS) {
-               ldb_set_errstring(module, talloc_strdup(module, ldap_err2string(lldb->last_rc)));
+               ldb_set_errstring(module->ldb, talloc_strdup(module, ldap_err2string(lldb->last_rc)));
                ret = -1;
        }
 
@@ -451,7 +451,7 @@ static int lldb_modify(struct ldb_module *module, const struct ldb_message *msg)
 
        lldb->last_rc = ldap_modify_s(lldb->ldap, dn, mods);
        if (lldb->last_rc != LDAP_SUCCESS) {
-               ldb_set_errstring(module, talloc_strdup(module, ldap_err2string(lldb->last_rc)));
+               ldb_set_errstring(module->ldb, talloc_strdup(module, ldap_err2string(lldb->last_rc)));
                ret = -1;
        }
 
index 48d849746fe2479f8d0f5955d6a4d33e7d12f4da..aedba4e89582eefadce0a6916b6280cdcf928442 100644 (file)
@@ -943,7 +943,7 @@ static int lsqlite3_search_bytree(struct ldb_module * module, const struct ldb_d
        ret = sqlite3_exec(lsqlite3->sqlite, query, lsqlite3_search_callback, &msgs, &errmsg);
        if (ret != SQLITE_OK) {
                if (errmsg) {
-                       ldb_set_errstring(module, talloc_strdup(module, errmsg));
+                       ldb_set_errstring(module->ldb, talloc_strdup(module, errmsg));
                        free(errmsg);
                }
                ret = LDB_ERR_OTHER;
@@ -1039,7 +1039,7 @@ static int lsqlite3_add(struct ldb_module *module, const struct ldb_message *msg
        ret = sqlite3_exec(lsqlite3->sqlite, query, NULL, NULL, &errmsg);
        if (ret != SQLITE_OK) {
                if (errmsg) {
-                       ldb_set_errstring(module, talloc_strdup(module, errmsg));
+                       ldb_set_errstring(module->ldb, talloc_strdup(module, errmsg));
                        free(errmsg);
                }
                ret = LDB_ERR_OTHER;
@@ -1094,7 +1094,7 @@ static int lsqlite3_add(struct ldb_module *module, const struct ldb_message *msg
                        ret = sqlite3_exec(lsqlite3->sqlite, insert, NULL, NULL, &errmsg);
                        if (ret != SQLITE_OK) {
                                if (errmsg) {
-                                       ldb_set_errstring(module, talloc_strdup(module, errmsg));
+                                       ldb_set_errstring(module->ldb, talloc_strdup(module, errmsg));
                                        free(errmsg);
                                }
                                ret = LDB_ERR_OTHER;
@@ -1184,7 +1184,7 @@ static int lsqlite3_modify(struct ldb_module *module, const struct ldb_message *
                        ret = sqlite3_exec(lsqlite3->sqlite, mod, NULL, NULL, &errmsg);
                        if (ret != SQLITE_OK) {
                                if (errmsg) {
-                                       ldb_set_errstring(module, talloc_strdup(module, errmsg));
+                                       ldb_set_errstring(module->ldb, talloc_strdup(module, errmsg));
                                        free(errmsg);
                                }
                                ret = LDB_ERR_OTHER;
@@ -1222,7 +1222,7 @@ static int lsqlite3_modify(struct ldb_module *module, const struct ldb_message *
                                ret = sqlite3_exec(lsqlite3->sqlite, mod, NULL, NULL, &errmsg);
                                if (ret != SQLITE_OK) {
                                        if (errmsg) {
-                                               ldb_set_errstring(module, talloc_strdup(module, errmsg));
+                                               ldb_set_errstring(module->ldb, talloc_strdup(module, errmsg));
                                                free(errmsg);
                                        }
                                        ret = LDB_ERR_OTHER;
@@ -1248,7 +1248,7 @@ static int lsqlite3_modify(struct ldb_module *module, const struct ldb_message *
                                ret = sqlite3_exec(lsqlite3->sqlite, mod, NULL, NULL, &errmsg);
                                if (ret != SQLITE_OK) {
                                        if (errmsg) {
-                                               ldb_set_errstring(module, talloc_strdup(module, errmsg));
+                                               ldb_set_errstring(module->ldb, talloc_strdup(module, errmsg));
                                                free(errmsg);
                                        }
                                        ret = LDB_ERR_OTHER;
@@ -1282,7 +1282,7 @@ static int lsqlite3_modify(struct ldb_module *module, const struct ldb_message *
                                ret = sqlite3_exec(lsqlite3->sqlite, mod, NULL, NULL, &errmsg);
                                if (ret != SQLITE_OK) {
                                        if (errmsg) {
-                                               ldb_set_errstring(module, talloc_strdup(module, errmsg));
+                                               ldb_set_errstring(module->ldb, talloc_strdup(module, errmsg));
                                                free(errmsg);
                                        }
                                        ret = LDB_ERR_OTHER;
@@ -1343,7 +1343,7 @@ static int lsqlite3_delete(struct ldb_module *module, const struct ldb_dn *dn)
        ret = sqlite3_exec(lsqlite3->sqlite, query, NULL, NULL, &errmsg);
        if (ret != SQLITE_OK) {
                if (errmsg) {
-                       ldb_set_errstring(module, talloc_strdup(module, errmsg));
+                       ldb_set_errstring(module->ldb, talloc_strdup(module, errmsg));
                        free(errmsg);
                }
                ret = LDB_ERR_OTHER;
@@ -1402,7 +1402,7 @@ static int lsqlite3_rename(struct ldb_module *module, const struct ldb_dn *olddn
        ret = sqlite3_exec(lsqlite3->sqlite, query, NULL, NULL, &errmsg);
        if (ret != SQLITE_OK) {
                if (errmsg) {
-                       ldb_set_errstring(module, talloc_strdup(module, errmsg));
+                       ldb_set_errstring(module->ldb, talloc_strdup(module, errmsg));
                        free(errmsg);
                }
                ret = LDB_ERR_OTHER;
index 1be11bc64c24d6c5405c926b2f93a6f99265ef36..8d8c01278d98b32477173c2563c9d29d004222cf 100644 (file)
@@ -142,7 +142,7 @@ int ltdb_check_special_dn(struct ldb_module *module, const struct ldb_message *m
                        if (ltdb_check_at_attributes_values(&msg->elements[i].values[j]) != 0) {
                                char *err_string = talloc_strdup(module, "Invalid attribute value in an @ATTRIBUTES entry");
                                if (err_string) {
-                                       ldb_set_errstring(module, err_string);
+                                       ldb_set_errstring(module->ldb, err_string);
                                }
                                return LDB_ERR_INVALID_ATTRIBUTE_SYNTAX;
                        }
@@ -532,7 +532,7 @@ int ltdb_modify_internal(struct ldb_module *module, const struct ldb_message *ms
                        for (j=0;j<el->num_values;j++) {
                                if (ldb_msg_find_val(el2, &el->values[j])) {
                                        err_string = talloc_strdup(module, "Type or value exists");
-                                       if (err_string) ldb_set_errstring(module, err_string);
+                                       if (err_string) ldb_set_errstring(module->ldb, err_string);
                                        ret = LDB_ERR_ATTRIBUTE_OR_VALUE_EXISTS;
                                        goto failed;
                                }
@@ -577,7 +577,7 @@ int ltdb_modify_internal(struct ldb_module *module, const struct ldb_message *ms
                                if (msg_delete_attribute(module, ldb, msg2, 
                                                         msg->elements[i].name) != 0) {
                                        err_string = talloc_asprintf(module, "No such attribute: %s", msg->elements[i].name);
-                                       if (err_string) ldb_set_errstring(module, err_string);
+                                       if (err_string) ldb_set_errstring(module->ldb, err_string);
                                        ret = LDB_ERR_NO_SUCH_ATTRIBUTE;
                                        goto failed;
                                }
@@ -589,7 +589,7 @@ int ltdb_modify_internal(struct ldb_module *module, const struct ldb_message *ms
                                                       msg->elements[i].name,
                                                       &msg->elements[i].values[j]) != 0) {
                                        err_string = talloc_asprintf(module, "No such attribute: %s", msg->elements[i].name);
-                                       if (err_string) ldb_set_errstring(module, err_string);
+                                       if (err_string) ldb_set_errstring(module->ldb, err_string);
                                        ret = LDB_ERR_NO_SUCH_ATTRIBUTE;
                                        goto failed;
                                }
@@ -602,7 +602,7 @@ int ltdb_modify_internal(struct ldb_module *module, const struct ldb_message *ms
                        err_string = talloc_asprintf(module, "Invalid ldb_modify flags on %s: 0x%x", 
                                                     msg->elements[i].name, 
                                                     msg->elements[i].flags & LDB_FLAG_MOD_MASK);
-                       if (err_string) ldb_set_errstring(module, err_string);
+                       if (err_string) ldb_set_errstring(module->ldb, err_string);
                        ret = LDB_ERR_PROTOCOL_ERROR;
                        goto failed;
                }
@@ -690,7 +690,7 @@ static int ltdb_rename(struct ldb_module *module, const struct ldb_dn *olddn, co
                ltdb_delete(module, newdn);
        }
 
-       ldb_set_errstring(module, error_str);
+       ldb_set_errstring(module->ldb, error_str);
 
        talloc_free(msg);
 
index 4c2ef5b239b1dffcf5cfd9424554d7a03173ddfc..f313a6e564b69a7eb69648fb46c6b58bdae3c766 100644 (file)
@@ -827,7 +827,7 @@ static int map_search_mp(struct ldb_module *module, struct ldb_request *req)
        talloc_free(newattrs);
 
        if (mpret != LDB_SUCCESS) {
-               ldb_set_errstring(module, talloc_strdup(module, ldb_errstring(privdat->mapped_ldb)));
+               ldb_set_errstring(module->ldb, talloc_strdup(module, ldb_errstring(privdat->mapped_ldb)));
                return mpret;
        }
 
index 479d943a91a85aa3295cf8a57e3cac0a2d61b18a..8b4ad598cc53786b6fb972e0819010d97f149f12 100644 (file)
@@ -115,7 +115,7 @@ static int objectclass_handle(struct ldb_module *module, struct ldb_request *req
        res = search_request->op.search.res;
        talloc_steal(mem_ctx, res);
        if (res->count != 1) {
-               ldb_set_errstring(module, 
+               ldb_set_errstring(module->ldb
                                  talloc_asprintf(mem_ctx, "objectClass_handle: "
                                                  "search for %s found %d != 1 objects, for entry we just added/modified",
                                                  ldb_dn_linearize(mem_ctx, msg->dn),
index 7bf1fa9916a7cd256ca3317260f4ef97a8edc49d..d348c3231faa55004bab9d33e037598049b7cd18 100644 (file)
@@ -45,7 +45,7 @@ static int wins_ldb_verify(struct ldb_module *module, struct ldb_request *req, c
        if (!h) {
                error = talloc_strdup(module, "WINS_LDB: INTERNAL ERROR: no winsdb_handle present!");
                ldb_debug(module->ldb, LDB_DEBUG_FATAL, "%s", error);
-               ldb_set_errstring(module, error);
+               ldb_set_errstring(module->ldb, error);
                return LDB_ERR_OTHER;
        }