s4:dsdb/repl: expose drsuapi_DsExtendedError to the caller (e.g. the ridalloc client)
authorStefan Metzmacher <metze@samba.org>
Thu, 8 Jul 2010 14:20:11 +0000 (16:20 +0200)
committerStefan Metzmacher <metze@samba.org>
Fri, 9 Jul 2010 07:27:16 +0000 (09:27 +0200)
metze

source4/dsdb/repl/drepl_out_helpers.c
source4/dsdb/repl/drepl_out_pull.c
source4/dsdb/repl/drepl_ridalloc.c
source4/dsdb/repl/drepl_service.h

index d8e5b76fb79ee45e25f15ddb8b2a605b0ae70a86..24110529c5c235db34a4f4ebe79ae84d1428161b 100644 (file)
@@ -428,6 +428,8 @@ static void dreplsrv_op_pull_source_get_changes_done(struct tevent_req *subreq)
        }
 
        if (state->op->extended_op != DRSUAPI_EXOP_NONE) {
+               state->op->extended_ret = extended_ret;
+
                if (extended_ret != DRSUAPI_EXOP_ERR_SUCCESS) {
                        status = NT_STATUS_UNSUCCESSFUL;
                        tevent_req_nterror(req, status);
index c82b48dcbe641900db4ca997ac155f8f313afa22..e9b57a1fec9a1b542d7d8b45923b519037c7eecb 100644 (file)
@@ -154,13 +154,13 @@ static void dreplsrv_pending_op_callback(struct tevent_req *subreq)
 
        DEBUG(1,("dreplsrv_op_pull_source(%s/%s) for %s failures[%u]\n",
                 win_errstr(rf->result_last_attempt),
-                win_errstr(rf->result_last_attempt),
+                nt_errstr(werror_to_ntstatus(rf->result_last_attempt)),
                 ldb_dn_get_linearized(op->source_dsa->partition->dn),
                 rf->consecutive_sync_failures));
 
 done:
        if (op->callback) {
-               op->callback(s, rf->result_last_attempt);
+               op->callback(s, rf->result_last_attempt, op->extended_ret);
        }
        talloc_free(op);
        s->ops.current = NULL;
index 918307b36305a3f599f479c80a0d431cdbc57532..eaff5810835e2b53e935b3755f2d736eeeaf7370 100644 (file)
@@ -100,11 +100,13 @@ static WERROR drepl_create_rid_manager_source_dsa(struct dreplsrv_service *servi
 /*
   called when a rid allocation request has completed
  */
-static void drepl_new_rid_pool_callback(struct dreplsrv_service *service, WERROR werr)
+static void drepl_new_rid_pool_callback(struct dreplsrv_service *service,
+                                       WERROR werr,
+                                       enum drsuapi_DsExtendedError ext_err)
 {
        if (!W_ERROR_IS_OK(werr)) {
-               DEBUG(0,(__location__ ": RID Manager failed RID allocation - %s\n",
-                        win_errstr(werr)));
+               DEBUG(0,(__location__ ": RID Manager failed RID allocation - %s - extended_ret[0x%X]\n",
+                        win_errstr(werr), ext_err));
        } else {
                DEBUG(3,(__location__ ": RID Manager completed RID allocation OK\n"));
        }
index 88be76912867791871d7ea0b8e21bfacd9cfff5e..eefd4da7f4ee1a8cfd99c1ed4ce6cff16df144b0 100644 (file)
@@ -101,7 +101,9 @@ struct dreplsrv_partition {
        struct dreplsrv_partition_source_dsa *sources;
 };
 
-typedef void (*dreplsrv_fsmo_callback_t)(struct dreplsrv_service *, WERROR );
+typedef void (*dreplsrv_fsmo_callback_t)(struct dreplsrv_service *,
+                                        WERROR,
+                                        enum drsuapi_DsExtendedError);
 
 struct dreplsrv_out_operation {
        struct dreplsrv_out_operation *prev, *next;
@@ -113,6 +115,7 @@ struct dreplsrv_out_operation {
        enum drsuapi_DsExtendedOperation extended_op;
        uint64_t fsmo_info;
        dreplsrv_fsmo_callback_t callback;
+       enum drsuapi_DsExtendedError extended_ret;
 };
 
 struct dreplsrv_notify_operation {