Ignore:
Timestamp:
Nov 14, 2012, 12:59:34 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update vendor to 3.6.0

Location:
vendor/current/source4/libcli/wbclient
Files:
1 added
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/source4/libcli/wbclient/wbclient.c

    r414 r740  
    2121
    2222#include "includes.h"
     23#include <tevent.h>
    2324#include "libcli/wbclient/wbclient.h"
    24 
    25 /**
    26  * Get the server_id of the winbind task.
    27  *
    28  * \param[in] msg_ctx message context to use
    29  * \param[in] mem_ctx talloc context to use
    30  * \param[out] ids array of server_id structs containing the winbind id
    31  * \return NT_STATUS_OK on success, NT_STATUS_INTERNAL_ERROR on failure
    32  */
    33 static NTSTATUS get_server_id(struct messaging_context *msg_ctx,
    34                               TALLOC_CTX *mem_ctx, struct server_id **ids)
    35 {
    36         *ids = irpc_servers_byname(msg_ctx, mem_ctx, "winbind_server");
    37         if (*ids == NULL || (*ids)[0].id == 0) {
    38                 DEBUG(0, ("Geting the winbind server ID failed.\n"));
    39                 return NT_STATUS_INTERNAL_ERROR;
    40         }
    41         return NT_STATUS_OK;
    42 }
    4325
    4426/**
     
    5436{
    5537        struct wbc_context *ctx;
    56         NTSTATUS status;
    5738
    5839        ctx = talloc(mem_ctx, struct wbc_context);
    5940        if (ctx == NULL) return NULL;
    6041
    61         status = get_server_id(msg_ctx, mem_ctx, &ctx->ids);
    62         if (!NT_STATUS_IS_OK(status)) {
     42        ctx->event_ctx = event_ctx;
     43
     44        ctx->irpc_handle = irpc_binding_handle_by_name(ctx, msg_ctx,
     45                                                       "winbind_server",
     46                                                       &ndr_table_winbind);
     47        if (ctx->irpc_handle == NULL) {
    6348                talloc_free(ctx);
    6449                return NULL;
    6550        }
    66 
    67         ctx->msg_ctx = msg_ctx;
    68         ctx->event_ctx = event_ctx;
    6951
    7052        return ctx;
     
    7456        struct composite_context *ctx;
    7557        struct winbind_get_idmap *req;
    76         struct irpc_request *irpc_req;
    77         struct id_mapping *ids;
     58        struct id_map *ids;
    7859};
    7960
    80 static void sids_to_xids_recv_ids(struct irpc_request *req);
     61static void sids_to_xids_recv_ids(struct tevent_req *subreq);
    8162
    8263struct composite_context *wbc_sids_to_xids_send(struct wbc_context *wbc_ctx,
    8364                                                TALLOC_CTX *mem_ctx,
    8465                                                uint32_t count,
    85                                                 struct id_mapping *ids)
     66                                                struct id_map *ids)
    8667{
    8768        struct composite_context *ctx;
    8869        struct wbc_idmap_state *state;
     70        struct tevent_req *subreq;
    8971
    9072        DEBUG(5, ("wbc_sids_to_xids called\n"));
     
    10587        state->ctx = ctx;
    10688
    107         state->irpc_req = IRPC_CALL_SEND(wbc_ctx->msg_ctx, wbc_ctx->ids[0],
    108                                          winbind, WINBIND_GET_IDMAP, state->req,
    109                                          state);
    110         if (composite_nomem(state->irpc_req, ctx)) return ctx;
     89        subreq = dcerpc_winbind_get_idmap_r_send(state,
     90                                                 wbc_ctx->event_ctx,
     91                                                 wbc_ctx->irpc_handle,
     92                                                 state->req);
     93        if (composite_nomem(subreq, ctx)) return ctx;
    11194
    112         composite_continue_irpc(ctx, state->irpc_req, sids_to_xids_recv_ids,
    113                                 state);
     95        tevent_req_set_callback(subreq, sids_to_xids_recv_ids, state);
     96
    11497        return ctx;
    11598}
    11699
    117 static void sids_to_xids_recv_ids(struct irpc_request *req)
     100static void sids_to_xids_recv_ids(struct tevent_req *subreq)
    118101{
    119         struct wbc_idmap_state *state = talloc_get_type_abort(
    120                                                         req->async.private_data,
    121                                                         struct wbc_idmap_state);
     102        struct wbc_idmap_state *state =
     103                tevent_req_callback_data(subreq,
     104                struct wbc_idmap_state);
    122105
    123         state->ctx->status = irpc_call_recv(state->irpc_req);
     106        state->ctx->status = dcerpc_winbind_get_idmap_r_recv(subreq, state);
     107        TALLOC_FREE(subreq);
    124108        if (!composite_is_ok(state->ctx)) return;
    125109
     
    129113
    130114NTSTATUS wbc_sids_to_xids_recv(struct composite_context *ctx,
    131                                struct id_mapping **ids)
     115                               struct id_map **ids)
    132116{
    133117        NTSTATUS status = composite_wait(ctx);
     
    143127}
    144128
    145 static void xids_to_sids_recv_ids(struct irpc_request *req);
     129static void xids_to_sids_recv_ids(struct tevent_req *subreq);
    146130
    147131struct composite_context *wbc_xids_to_sids_send(struct wbc_context *wbc_ctx,
    148132                                                TALLOC_CTX *mem_ctx,
    149133                                                uint32_t count,
    150                                                 struct id_mapping *ids)
     134                                                struct id_map *ids)
    151135{
    152136        struct composite_context *ctx;
    153137        struct wbc_idmap_state *state;
     138        struct tevent_req *subreq;
    154139
    155140        DEBUG(5, ("wbc_xids_to_sids called\n"));
     
    170155        state->ctx = ctx;
    171156
    172         state->irpc_req = IRPC_CALL_SEND(wbc_ctx->msg_ctx, wbc_ctx->ids[0],
    173                                          winbind, WINBIND_GET_IDMAP, state->req,
    174                                          state);
    175         if (composite_nomem(state->irpc_req, ctx)) return ctx;
     157        subreq = dcerpc_winbind_get_idmap_r_send(state,
     158                                                 wbc_ctx->event_ctx,
     159                                                 wbc_ctx->irpc_handle,
     160                                                 state->req);
     161        if (composite_nomem(subreq, ctx)) return ctx;
    176162
    177         composite_continue_irpc(ctx, state->irpc_req, xids_to_sids_recv_ids,
    178                         state);
     163        tevent_req_set_callback(subreq, xids_to_sids_recv_ids, state);
    179164
    180165        return ctx;
    181166}
    182167
    183 static void xids_to_sids_recv_ids(struct irpc_request *req)
     168static void xids_to_sids_recv_ids(struct tevent_req *subreq)
    184169{
    185         struct wbc_idmap_state *state = talloc_get_type_abort(
    186                                                         req->async.private_data,
    187                                                         struct wbc_idmap_state);
     170        struct wbc_idmap_state *state =
     171                tevent_req_callback_data(subreq,
     172                struct wbc_idmap_state);
    188173
    189         state->ctx->status = irpc_call_recv(state->irpc_req);
     174        state->ctx->status = dcerpc_winbind_get_idmap_r_recv(subreq, state);
     175        TALLOC_FREE(subreq);
    190176        if (!composite_is_ok(state->ctx)) return;
    191177
     
    195181
    196182NTSTATUS wbc_xids_to_sids_recv(struct composite_context *ctx,
    197                                struct id_mapping **ids)
     183                               struct id_map **ids)
    198184{
    199185        NTSTATUS status = composite_wait(ctx);
  • vendor/current/source4/libcli/wbclient/wbclient.h

    r414 r740  
    2121#include "lib/messaging/irpc.h"
    2222#include "libcli/composite/composite.h"
    23 #include "librpc/gen_ndr/ndr_winbind.h"
     23#include "librpc/gen_ndr/ndr_winbind_c.h"
    2424
    2525struct wbc_context {
    26         struct messaging_context *msg_ctx;
    2726        struct tevent_context *event_ctx;
    28         struct server_id *ids;
     27        struct dcerpc_binding_handle *irpc_handle;
    2928};
    3029
     
    3635                                                TALLOC_CTX *mem_ctx,
    3736                                                uint32_t count,
    38                                                 struct id_mapping *ids);
     37                                                struct id_map *ids);
    3938
    4039NTSTATUS wbc_sids_to_xids_recv(struct composite_context *ctx,
    41                                struct id_mapping **ids);
     40                               struct id_map **ids);
    4241
    4342struct composite_context *wbc_xids_to_sids_send(struct wbc_context *wbc_ctx,
    4443                                                TALLOC_CTX *mem_ctx,
    4544                                                uint32_t count,
    46                                                 struct id_mapping *ids);
     45                                                struct id_map *ids);
    4746
    4847NTSTATUS wbc_xids_to_sids_recv(struct composite_context *ctx,
    49                                struct id_mapping **ids);
     48                               struct id_map **ids);
    5049
Note: See TracChangeset for help on using the changeset viewer.