Ignore:
Timestamp:
Nov 24, 2016, 1:14:11 PM (9 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update vendor to version 4.4.3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/source4/libnet/userinfo.c

    r860 r988  
    3131
    3232struct userinfo_state {
    33         struct dcerpc_pipe        *pipe;
     33        struct dcerpc_binding_handle *binding_handle;
    3434        struct policy_handle      domain_handle;
    3535        struct policy_handle      user_handle;
     
    6363
    6464        c = tevent_req_callback_data(subreq, struct composite_context);
    65         s = talloc_get_type(c->private_data, struct userinfo_state);
     65        s = talloc_get_type_abort(c->private_data, struct userinfo_state);
    6666
    6767        /* receive samr_Lookup reply */
     
    110110        /* send request */
    111111        subreq = dcerpc_samr_OpenUser_r_send(s, c->event_ctx,
    112                                              s->pipe->binding_handle,
     112                                             s->binding_handle,
    113113                                             &s->openuser);
    114114        if (composite_nomem(subreq, c)) return;
     
    129129
    130130        c = tevent_req_callback_data(subreq, struct composite_context);
    131         s = talloc_get_type(c->private_data, struct userinfo_state);
     131        s = talloc_get_type_abort(c->private_data, struct userinfo_state);
    132132
    133133        /* receive samr_OpenUser reply */
     
    136136        if (!composite_is_ok(c)) return;
    137137
    138         if (!NT_STATUS_IS_OK(s->queryuserinfo.out.result)) {
    139                 composite_error(c, s->queryuserinfo.out.result);
     138        if (!NT_STATUS_IS_OK(s->openuser.out.result)) {
     139                composite_error(c, s->openuser.out.result);
    140140                return;
    141141        }
     
    161161        /* queue rpc call, set event handling and new state */
    162162        subreq = dcerpc_samr_QueryUserInfo_r_send(s, c->event_ctx,
    163                                                   s->pipe->binding_handle,
     163                                                  s->binding_handle,
    164164                                                  &s->queryuserinfo);
    165165        if (composite_nomem(subreq, c)) return;
     
    180180
    181181        c = tevent_req_callback_data(subreq, struct composite_context);
    182         s = talloc_get_type(c->private_data, struct userinfo_state);
     182        s = talloc_get_type_abort(c->private_data, struct userinfo_state);
    183183
    184184        /* receive samr_QueryUserInfo reply */
     
    212212        /* queue rpc call, set event handling and new state */
    213213        subreq = dcerpc_samr_Close_r_send(s, c->event_ctx,
    214                                           s->pipe->binding_handle,
     214                                          s->binding_handle,
    215215                                          &s->samrclose);
    216216        if (composite_nomem(subreq, c)) return;
     
    231231
    232232        c = tevent_req_callback_data(subreq, struct composite_context);
    233         s = talloc_get_type(c->private_data, struct userinfo_state);
     233        s = talloc_get_type_abort(c->private_data, struct userinfo_state);
    234234
    235235        /* receive samr_Close reply */
     
    264264 * @param io arguments and results of the call
    265265 */
    266 struct composite_context *libnet_rpc_userinfo_send(struct dcerpc_pipe *p,
     266struct composite_context *libnet_rpc_userinfo_send(TALLOC_CTX *mem_ctx,
     267                                                   struct tevent_context *ev,
     268                                                   struct dcerpc_binding_handle *b,
    267269                                                   struct libnet_rpc_userinfo *io,
    268270                                                   void (*monitor)(struct monitor_msg*))
     
    273275        struct tevent_req *subreq;
    274276
    275         if (!p || !io) return NULL;
    276        
    277         c = composite_create(p, dcerpc_event_context(p));
     277        if (!b || !io) return NULL;
     278       
     279        c = composite_create(mem_ctx, ev);
    278280        if (c == NULL) return c;
    279281       
     
    284286
    285287        s->level         = io->in.level;
    286         s->pipe          = p;
     288        s->binding_handle= b;
    287289        s->domain_handle = io->in.domain_handle;
    288290        s->monitor_fn    = monitor;
     
    299301                /* send request */
    300302                subreq = dcerpc_samr_OpenUser_r_send(s, c->event_ctx,
    301                                                      p->binding_handle,
     303                                                     s->binding_handle,
    302304                                                     &s->openuser);
    303305                if (composite_nomem(subreq, c)) return c;
     
    321323                /* send request */
    322324                subreq = dcerpc_samr_LookupNames_r_send(s, c->event_ctx,
    323                                                         p->binding_handle,
     325                                                        s->binding_handle,
    324326                                                        &s->lookup);
    325327                if (composite_nomem(subreq, c)) return c;
     
    351353       
    352354        if (NT_STATUS_IS_OK(status) && io) {
    353                 s = talloc_get_type(c->private_data, struct userinfo_state);
     355                s = talloc_get_type_abort(c->private_data, struct userinfo_state);
    354356                talloc_steal(mem_ctx, s->info);
    355357                io->out.info = *s->info;
     
    371373 */
    372374
    373 NTSTATUS libnet_rpc_userinfo(struct dcerpc_pipe *p,
     375NTSTATUS libnet_rpc_userinfo(struct tevent_context *ev,
     376                             struct dcerpc_binding_handle *b,
    374377                             TALLOC_CTX *mem_ctx,
    375378                             struct libnet_rpc_userinfo *io)
    376379{
    377         struct composite_context *c = libnet_rpc_userinfo_send(p, io, NULL);
     380        struct composite_context *c = libnet_rpc_userinfo_send(mem_ctx, ev, b, io, NULL);
    378381        return libnet_rpc_userinfo_recv(c, mem_ctx, io);
    379382}
Note: See TracChangeset for help on using the changeset viewer.