Changeset 988 for vendor/current/source4/libnet/userinfo.c
- Timestamp:
- Nov 24, 2016, 1:14:11 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/source4/libnet/userinfo.c
r860 r988 31 31 32 32 struct userinfo_state { 33 struct dcerpc_ pipe *pipe;33 struct dcerpc_binding_handle *binding_handle; 34 34 struct policy_handle domain_handle; 35 35 struct policy_handle user_handle; … … 63 63 64 64 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); 66 66 67 67 /* receive samr_Lookup reply */ … … 110 110 /* send request */ 111 111 subreq = dcerpc_samr_OpenUser_r_send(s, c->event_ctx, 112 s-> pipe->binding_handle,112 s->binding_handle, 113 113 &s->openuser); 114 114 if (composite_nomem(subreq, c)) return; … … 129 129 130 130 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); 132 132 133 133 /* receive samr_OpenUser reply */ … … 136 136 if (!composite_is_ok(c)) return; 137 137 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); 140 140 return; 141 141 } … … 161 161 /* queue rpc call, set event handling and new state */ 162 162 subreq = dcerpc_samr_QueryUserInfo_r_send(s, c->event_ctx, 163 s-> pipe->binding_handle,163 s->binding_handle, 164 164 &s->queryuserinfo); 165 165 if (composite_nomem(subreq, c)) return; … … 180 180 181 181 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); 183 183 184 184 /* receive samr_QueryUserInfo reply */ … … 212 212 /* queue rpc call, set event handling and new state */ 213 213 subreq = dcerpc_samr_Close_r_send(s, c->event_ctx, 214 s-> pipe->binding_handle,214 s->binding_handle, 215 215 &s->samrclose); 216 216 if (composite_nomem(subreq, c)) return; … … 231 231 232 232 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); 234 234 235 235 /* receive samr_Close reply */ … … 264 264 * @param io arguments and results of the call 265 265 */ 266 struct composite_context *libnet_rpc_userinfo_send(struct dcerpc_pipe *p, 266 struct composite_context *libnet_rpc_userinfo_send(TALLOC_CTX *mem_ctx, 267 struct tevent_context *ev, 268 struct dcerpc_binding_handle *b, 267 269 struct libnet_rpc_userinfo *io, 268 270 void (*monitor)(struct monitor_msg*)) … … 273 275 struct tevent_req *subreq; 274 276 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); 278 280 if (c == NULL) return c; 279 281 … … 284 286 285 287 s->level = io->in.level; 286 s-> pipe = p;288 s->binding_handle= b; 287 289 s->domain_handle = io->in.domain_handle; 288 290 s->monitor_fn = monitor; … … 299 301 /* send request */ 300 302 subreq = dcerpc_samr_OpenUser_r_send(s, c->event_ctx, 301 p->binding_handle,303 s->binding_handle, 302 304 &s->openuser); 303 305 if (composite_nomem(subreq, c)) return c; … … 321 323 /* send request */ 322 324 subreq = dcerpc_samr_LookupNames_r_send(s, c->event_ctx, 323 p->binding_handle,325 s->binding_handle, 324 326 &s->lookup); 325 327 if (composite_nomem(subreq, c)) return c; … … 351 353 352 354 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); 354 356 talloc_steal(mem_ctx, s->info); 355 357 io->out.info = *s->info; … … 371 373 */ 372 374 373 NTSTATUS libnet_rpc_userinfo(struct dcerpc_pipe *p, 375 NTSTATUS libnet_rpc_userinfo(struct tevent_context *ev, 376 struct dcerpc_binding_handle *b, 374 377 TALLOC_CTX *mem_ctx, 375 378 struct libnet_rpc_userinfo *io) 376 379 { 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); 378 381 return libnet_rpc_userinfo_recv(c, mem_ctx, io); 379 382 }
Note:
See TracChangeset
for help on using the changeset viewer.