s4/rodc: Fix the callbacks up the stack to handle referrals on modify requests
authorAnatoliy Atanasov <anatoliy.atanasov@postpath.com>
Tue, 4 May 2010 09:48:18 +0000 (11:48 +0200)
committerAnatoliy Atanasov <anatoliy.atanasov@postpath.com>
Tue, 4 May 2010 16:31:47 +0000 (18:31 +0200)
source4/dsdb/samdb/ldb_modules/descriptor.c
source4/dsdb/samdb/ldb_modules/instancetype.c
source4/dsdb/samdb/ldb_modules/objectclass.c
source4/dsdb/samdb/ldb_modules/password_hash.c
source4/dsdb/samdb/ldb_modules/samldb.c
source4/dsdb/samdb/ldb_modules/subtree_rename.c
source4/lib/ldb/modules/rdn_name.c

index 70b02e8086ad9f0c9d1cbd486ce49a786f83174c..8fc5e3a47bb0dd0219c10901af1f97e2e02405c8 100644 (file)
@@ -490,6 +490,11 @@ static int descriptor_op_callback(struct ldb_request *req, struct ldb_reply *are
                return ldb_module_done(ac->req, NULL, NULL,
                                        LDB_ERR_OPERATIONS_ERROR);
        }
+
+       if (ares->type == LDB_REPLY_REFERRAL) {
+               return ldb_module_send_referral(ac->req, ares->referral);
+       }
+
        if (ares->error != LDB_SUCCESS) {
                return ldb_module_done(ac->req, ares->controls,
                                        ares->response, ares->error);
index 0a297d587a9e13744e4f093d22e6c24072ebd382..7828ce1d2699f726ef2c95839265a6e3eedbb3c9 100644 (file)
@@ -57,6 +57,10 @@ static int it_add_callback(struct ldb_request *req, struct ldb_reply *ares)
                                        LDB_ERR_OPERATIONS_ERROR);
        }
 
+       if (ares->type == LDB_REPLY_REFERRAL) {
+               return ldb_module_send_referral(ac->req, ares->referral);
+       }
+
        if (ares->error != LDB_SUCCESS) {
                return ldb_module_done(ac->req, ares->controls,
                                        ares->response, ares->error);
index 329bd81ae3630c56780a8b969f1a5f1c3ffd45c5..fdff3a8ff37589d69b17c99f118f95383a03cae2 100644 (file)
@@ -274,6 +274,11 @@ static int oc_op_callback(struct ldb_request *req, struct ldb_reply *ares)
                return ldb_module_done(ac->req, NULL, NULL,
                                        LDB_ERR_OPERATIONS_ERROR);
        }
+
+       if (ares->type == LDB_REPLY_REFERRAL) {
+               return ldb_module_send_referral(ac->req, ares->referral);
+       }
+
        if (ares->error != LDB_SUCCESS) {
                return ldb_module_done(ac->req, ares->controls,
                                        ares->response, ares->error);
@@ -891,6 +896,11 @@ static int oc_modify_callback(struct ldb_request *req, struct ldb_reply *ares)
                return ldb_module_done(ac->req, NULL, NULL,
                                        LDB_ERR_OPERATIONS_ERROR);
        }
+
+       if (ares->type == LDB_REPLY_REFERRAL) {
+               return ldb_module_send_referral(ac->req, ares->referral);
+       }
+
        if (ares->error != LDB_SUCCESS) {
                return ldb_module_done(ac->req, ares->controls,
                                        ares->response, ares->error);
index 3cefa184e5dae2c401cd62e42ef8aadaba9fdceb..53b2a471689686f58c933691969b0c81614016e5 100644 (file)
@@ -1527,6 +1527,11 @@ static int ph_op_callback(struct ldb_request *req, struct ldb_reply *ares)
                return ldb_module_done(ac->req, NULL, NULL,
                                        LDB_ERR_OPERATIONS_ERROR);
        }
+
+       if (ares->type == LDB_REPLY_REFERRAL) {
+               return ldb_module_send_referral(ac->req, ares->referral);
+       }
+
        if (ares->error != LDB_SUCCESS) {
                return ldb_module_done(ac->req, ares->controls,
                                        ares->response, ares->error);
@@ -1975,6 +1980,11 @@ static int ph_modify_callback(struct ldb_request *req, struct ldb_reply *ares)
                return ldb_module_done(ac->req, NULL, NULL,
                                        LDB_ERR_OPERATIONS_ERROR);
        }
+
+       if (ares->type == LDB_REPLY_REFERRAL) {
+               return ldb_module_send_referral(ac->req, ares->referral);
+       }
+
        if (ares->error != LDB_SUCCESS) {
                return ldb_module_done(ac->req, ares->controls,
                                        ares->response, ares->error);
index 375b624e7939fe9955a4d5b87325925fd2c6f072..473779196162dc85ea3b1233e7f339b0ed411583 100644 (file)
@@ -514,6 +514,11 @@ static int samldb_set_defaultObjectCategory_callback(struct ldb_request *req,
                ret = LDB_ERR_OPERATIONS_ERROR;
                goto done;
        }
+
+       if (ares->type == LDB_REPLY_REFERRAL) {
+               return ldb_module_send_referral(ac->req, ares->referral);
+       }
+
        if (ares->error != LDB_SUCCESS) {
                return ldb_module_done(ac->req, ares->controls,
                                        ares->response, ares->error);
@@ -785,6 +790,11 @@ static int samldb_add_entry_callback(struct ldb_request *req,
                return ldb_module_done(ac->req, NULL, NULL,
                                        LDB_ERR_OPERATIONS_ERROR);
        }
+
+       if (ares->type == LDB_REPLY_REFERRAL) {
+               return ldb_module_send_referral(ac->req, ares->referral);
+       }
+
        if (ares->error != LDB_SUCCESS) {
                return ldb_module_done(ac->req, ares->controls,
                                        ares->response, ares->error);
@@ -1428,6 +1438,11 @@ static int samldb_group_add_del_member_callback(struct ldb_request *req,
                ret = LDB_ERR_OPERATIONS_ERROR;
                goto done;
        }
+
+       if (ares->type == LDB_REPLY_REFERRAL) {
+               return ldb_module_send_referral(ac->req, ares->referral);
+       }
+
        if (ares->error != LDB_SUCCESS) {
                if (ares->error == LDB_ERR_NO_SUCH_ATTRIBUTE) {
                        /* On error "NO_SUCH_ATTRIBUTE" (delete of an invalid
index e2f6b1d05941fe38476b9bac897b83b6193299e5..df211e58b632a1783b8f34758636d33cb9af03b8 100644 (file)
@@ -81,6 +81,10 @@ static int subtree_rename_callback(struct ldb_request *req,
                                        LDB_ERR_OPERATIONS_ERROR);
        }
 
+       if (ares->type == LDB_REPLY_REFERRAL) {
+               return ldb_module_send_referral(ac->req, ares->referral);
+       }
+
        if (ares->error != LDB_SUCCESS) {
                return ldb_module_done(ac->req, ares->controls,
                                        ares->response, ares->error);
index a473f251af61aadaadf7d1e444ead25c36fd8fe3..f1c167cc3943430f88ceb52128d94b85f9c1bfb9 100644 (file)
@@ -70,6 +70,11 @@ static int rdn_name_add_callback(struct ldb_request *req,
                return ldb_module_done(ac->req, NULL, NULL,
                                        LDB_ERR_OPERATIONS_ERROR);
        }
+
+       if (ares->type == LDB_REPLY_REFERRAL) {
+               return ldb_module_send_referral(ac->req, ares->referral);
+       }
+
        if (ares->error != LDB_SUCCESS) {
                return ldb_module_done(ac->req, ares->controls,
                                        ares->response, ares->error);
@@ -193,6 +198,11 @@ static int rdn_modify_callback(struct ldb_request *req, struct ldb_reply *ares)
                return ldb_module_done(ac->req, NULL, NULL,
                                        LDB_ERR_OPERATIONS_ERROR);
        }
+
+       if (ares->type == LDB_REPLY_REFERRAL) {
+               return ldb_module_send_referral(ac->req, ares->referral);
+       }
+
        if (ares->error != LDB_SUCCESS) {
                return ldb_module_done(ac->req, ares->controls,
                                        ares->response, ares->error);
@@ -225,6 +235,11 @@ static int rdn_rename_callback(struct ldb_request *req, struct ldb_reply *ares)
        if (!ares) {
                goto error;
        }
+
+       if (ares->type == LDB_REPLY_REFERRAL) {
+               return ldb_module_send_referral(ac->req, ares->referral);
+       }
+
        if (ares->error != LDB_SUCCESS) {
                return ldb_module_done(ac->req, ares->controls,
                                        ares->response, ares->error);