s4-winbind: added count argument to wb_sids2xids_recv()
authorAndrew Tridgell <tridge@samba.org>
Tue, 26 Jul 2011 00:50:22 +0000 (10:50 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 8 Sep 2011 13:09:54 +0000 (15:09 +0200)
this allows callers to know how many SIDs were mapped

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

source4/winbind/wb_irpc.c
source4/winbind/wb_sid2gid.c
source4/winbind/wb_sid2uid.c
source4/winbind/wb_sids2xids.c

index 1eed89fd41256f372bf5399acacdc5ebaf383331..2f2b0780c7b1a18fcd0b58b7fdc9ee2f81be9f41 100644 (file)
@@ -172,7 +172,7 @@ static void wb_irpc_get_idmap_callback(struct composite_context *ctx)
 
        switch(s->level) {
                case WINBIND_IDMAP_LEVEL_SIDS_TO_XIDS:
-                       status = wb_sids2xids_recv(ctx, &s->req->out.ids);
+                       status = wb_sids2xids_recv(ctx, &s->req->out.ids, NULL);
                        break;
                case WINBIND_IDMAP_LEVEL_XIDS_TO_SIDS:
                        status = wb_xids2sids_recv(ctx, &s->req->out.ids);
index b4026cd6352fd9be68bba187b06367b1c448c6e9..0b3589561fcda1c85e05649e1d5aaccba931df26 100644 (file)
@@ -72,7 +72,7 @@ static void sid2gid_recv_gid(struct composite_context *ctx)
 
        struct id_map *ids = NULL;
 
-       state->ctx->status = wb_sids2xids_recv(ctx, &ids);
+       state->ctx->status = wb_sids2xids_recv(ctx, &ids, NULL);
        if (!composite_is_ok(state->ctx)) return;
 
        if (ids->status != ID_MAPPED) {
index 1fff66f655af20cc4fe3ee1996f4f988e2e2d13e..f1d9bdd6779a89aa0dfd1cf66a472e46675d8ecb 100644 (file)
@@ -72,7 +72,7 @@ static void sid2uid_recv_uid(struct composite_context *ctx)
 
        struct id_map *ids = NULL;
 
-       state->ctx->status = wb_sids2xids_recv(ctx, &ids);
+       state->ctx->status = wb_sids2xids_recv(ctx, &ids, NULL);
        if (!composite_is_ok(state->ctx)) return;
 
        if (ids->status != ID_MAPPED) {
index c966c40dc07900d84ce1cf5f00050bc836a83d8b..01ad64580b66139a285c1e0040af935f04d08d1b 100644 (file)
@@ -74,7 +74,7 @@ struct composite_context *wb_sids2xids_send(TALLOC_CTX *mem_ctx,
 }
 
 NTSTATUS wb_sids2xids_recv(struct composite_context *ctx,
-                          struct id_map **ids)
+                          struct id_map **ids, unsigned *count)
 {
        NTSTATUS status = composite_wait(ctx);
        struct sids2xids_state *state = talloc_get_type(ctx->private_data,
@@ -86,6 +86,9 @@ NTSTATUS wb_sids2xids_recv(struct composite_context *ctx,
         * the results are filled into the pointers the caller
         * supplied */
        *ids = state->ids;
+       if (count != NULL) {
+               *count = state->count;
+       }
 
        talloc_free(ctx);
        return status;