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/userman.c

    r860 r988  
    3232
    3333struct useradd_state {
    34         struct dcerpc_pipe       *pipe;
     34        struct dcerpc_binding_handle *binding_handle;
    3535        struct policy_handle     domain_handle;
    3636        struct samr_CreateUser   createuser;
     
    9595 */
    9696
    97 struct composite_context *libnet_rpc_useradd_send(struct dcerpc_pipe *p,
     97struct composite_context *libnet_rpc_useradd_send(TALLOC_CTX *mem_ctx,
     98                                                  struct tevent_context *ev,
     99                                                  struct dcerpc_binding_handle *b,
    98100                                                  struct libnet_rpc_useradd *io,
    99101                                                  void (*monitor)(struct monitor_msg*))
     
    103105        struct tevent_req *subreq;
    104106
    105         if (!p || !io) return NULL;
     107        if (!b || !io) return NULL;
    106108
    107109        /* composite allocation and setup */
    108         c = composite_create(p, dcerpc_event_context(p));
     110        c = composite_create(mem_ctx, ev);
    109111        if (c == NULL) return NULL;
    110112       
     
    116118        /* put passed arguments to the state structure */
    117119        s->domain_handle = io->in.domain_handle;
    118         s->pipe          = p;
     120        s->binding_handle= b;
    119121        s->monitor_fn    = monitor;
    120122       
     
    133135        /* send the request */
    134136        subreq = dcerpc_samr_CreateUser_r_send(s, c->event_ctx,
    135                                                p->binding_handle,
     137                                               s->binding_handle,
    136138                                               &s->createuser);
    137139        if (composite_nomem(subreq, c)) return c;
     
    179181 */
    180182
    181 NTSTATUS libnet_rpc_useradd(struct dcerpc_pipe *p,
     183NTSTATUS libnet_rpc_useradd(struct tevent_context *ev,
     184                            struct dcerpc_binding_handle *b,
    182185                            TALLOC_CTX *mem_ctx,
    183186                            struct libnet_rpc_useradd *io)
    184187{
    185         struct composite_context *c = libnet_rpc_useradd_send(p, io, NULL);
     188        struct composite_context *c = libnet_rpc_useradd_send(mem_ctx, ev, b, io, NULL);
    186189        return libnet_rpc_useradd_recv(c, mem_ctx, io);
    187190}
     
    195198
    196199struct userdel_state {
    197         struct dcerpc_pipe        *pipe;
     200        struct dcerpc_binding_handle *binding_handle;
    198201        struct policy_handle      domain_handle;
    199202        struct policy_handle      user_handle;
     
    267270        /* send rpc request */
    268271        subreq = dcerpc_samr_OpenUser_r_send(s, c->event_ctx,
    269                                              s->pipe->binding_handle,
     272                                             s->binding_handle,
    270273                                             &s->openuser);
    271274        if (composite_nomem(subreq, c)) return;
     
    317320        /* send rpc request */
    318321        subreq = dcerpc_samr_DeleteUser_r_send(s, c->event_ctx,
    319                                                s->pipe->binding_handle,
     322                                               s->binding_handle,
    320323                                               &s->deleteuser);
    321324        if (composite_nomem(subreq, c)) return;
     
    370373 */
    371374
    372 struct composite_context *libnet_rpc_userdel_send(struct dcerpc_pipe *p,
     375struct composite_context *libnet_rpc_userdel_send(TALLOC_CTX *mem_ctx,
     376                                                  struct tevent_context *ev,
     377                                                  struct dcerpc_binding_handle *b,
    373378                                                  struct libnet_rpc_userdel *io,
    374379                                                  void (*monitor)(struct monitor_msg*))
     
    379384
    380385        /* composite context allocation and setup */
    381         c = composite_create(p, dcerpc_event_context(p));
     386        c = composite_create(mem_ctx, ev);
    382387        if (c == NULL) return NULL;
    383388
     
    388393
    389394        /* store function parameters in the state structure */
    390         s->pipe          = p;
     395        s->binding_handle= b;
    391396        s->domain_handle = io->in.domain_handle;
    392397        s->monitor_fn    = monitor;
     
    404409        /* send the request */
    405410        subreq = dcerpc_samr_LookupNames_r_send(s, c->event_ctx,
    406                                                 p->binding_handle,
     411                                                s->binding_handle,
    407412                                                &s->lookupname);
    408413        if (composite_nomem(subreq, c)) return c;
     
    450455 */
    451456
    452 NTSTATUS libnet_rpc_userdel(struct dcerpc_pipe *p,
     457NTSTATUS libnet_rpc_userdel(struct tevent_context *ev,
     458                            struct dcerpc_binding_handle *b,
    453459                            TALLOC_CTX *mem_ctx,
    454460                            struct libnet_rpc_userdel *io)
    455461{
    456         struct composite_context *c = libnet_rpc_userdel_send(p, io, NULL);
     462        struct composite_context *c = libnet_rpc_userdel_send(mem_ctx, ev, b, io, NULL);
    457463        return libnet_rpc_userdel_recv(c, mem_ctx, io);
    458464}
     
    470476
    471477struct usermod_state {
    472         struct dcerpc_pipe         *pipe;
     478        struct dcerpc_binding_handle *binding_handle;
    473479        struct policy_handle       domain_handle;
    474480        struct policy_handle       user_handle;
     
    540546        /* send the rpc request */
    541547        subreq = dcerpc_samr_OpenUser_r_send(s, c->event_ctx,
    542                                              s->pipe->binding_handle,
     548                                             s->binding_handle,
    543549                                             &s->openuser);
    544550        if (composite_nomem(subreq, c)) return;
     
    696702                   a particular info level */
    697703                subreq = dcerpc_samr_QueryUserInfo_r_send(s, c->event_ctx,
    698                                                           s->pipe->binding_handle,
     704                                                          s->binding_handle,
    699705                                                          &s->queryuser);
    700706                if (composite_nomem(subreq, c)) return NT_STATUS_NO_MEMORY;
     
    708714                /* send set user info request after making required change */
    709715                subreq = dcerpc_samr_SetUserInfo_r_send(s, c->event_ctx,
    710                                                         s->pipe->binding_handle,
     716                                                        s->binding_handle,
    711717                                                        &s->setuser);
    712718                if (composite_nomem(subreq, c)) return NT_STATUS_NO_MEMORY;
     
    751757        struct usermod_state *s;
    752758        union samr_UserInfo *i;
    753         uint16_t level;
     759        uint16_t level = 0;
    754760       
    755761        c = tevent_req_callback_data(subreq, struct composite_context);
     
    782788        /* send the rpc request */
    783789        subreq = dcerpc_samr_SetUserInfo_r_send(s, c->event_ctx,
    784                                                 s->pipe->binding_handle,
     790                                                s->binding_handle,
    785791                                                &s->setuser);
    786792        if (composite_nomem(subreq, c)) return;
     
    831837 */
    832838
    833 struct composite_context *libnet_rpc_usermod_send(struct dcerpc_pipe *p,
     839struct composite_context *libnet_rpc_usermod_send(TALLOC_CTX *mem_ctx,
     840                                                  struct tevent_context *ev,
     841                                                  struct dcerpc_binding_handle *b,
    834842                                                  struct libnet_rpc_usermod *io,
    835843                                                  void (*monitor)(struct monitor_msg*))
     
    840848
    841849        /* composite context allocation and setup */
    842         c = composite_create(p, dcerpc_event_context(p));
     850        c = composite_create(mem_ctx, ev);
    843851        if (c == NULL) return NULL;
    844852        s = talloc_zero(c, struct usermod_state);
     
    848856
    849857        /* store parameters in the call structure */
    850         s->pipe          = p;
     858        s->binding_handle= b;
    851859        s->domain_handle = io->in.domain_handle;
    852860        s->change        = io->in.change;
     
    865873        /* send the rpc request */
    866874        subreq = dcerpc_samr_LookupNames_r_send(s, c->event_ctx,
    867                                                 p->binding_handle,
     875                                                s->binding_handle,
    868876                                                &s->lookupname);
    869877        if (composite_nomem(subreq, c)) return c;
     
    905913 */
    906914
    907 NTSTATUS libnet_rpc_usermod(struct dcerpc_pipe *p,
     915NTSTATUS libnet_rpc_usermod(struct tevent_context *ev,
     916                            struct dcerpc_binding_handle *b,
    908917                            TALLOC_CTX *mem_ctx,
    909918                            struct libnet_rpc_usermod *io)
    910919{
    911         struct composite_context *c = libnet_rpc_usermod_send(p, io, NULL);
     920        struct composite_context *c = libnet_rpc_usermod_send(mem_ctx, ev, b, io, NULL);
    912921        return libnet_rpc_usermod_recv(c, mem_ctx, io);
    913922}
Note: See TracChangeset for help on using the changeset viewer.