This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
+ the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "includes.h"
struct composite_context *ctx;
struct dom_sid *dom_sid;
uint32_t user_rid;
- int num_rids;
+ uint32_t num_rids;
uint32_t *rids;
};
struct composite_context *result, *ctx;
struct cmd_userdomgroups_state *state;
- result = talloc(mem_ctx, struct composite_context);
+ result = composite_create(mem_ctx, service->task->event_ctx);
if (result == NULL) goto failed;
- result->state = COMPOSITE_STATE_IN_PROGRESS;
- result->async.fn = NULL;
- result->event_ctx = service->task->event_ctx;
state = talloc(result, struct cmd_userdomgroups_state);
if (state == NULL) goto failed;
state->user_rid = sid->sub_auths[sid->num_auths-1];
ctx = wb_sid2domain_send(state, service, sid);
- if (ctx == NULL) goto failed;
- ctx->async.fn = userdomgroups_recv_domain;
- ctx->async.private_data = state;
- return result;
+ composite_continue(state->ctx, ctx, userdomgroups_recv_domain, state);
+
+ if (ctx) {
+ return result;
+ }
failed:
talloc_free(result);
state->ctx->status = wb_sid2domain_recv(ctx, &domain);
if (!composite_is_ok(state->ctx)) return;
- ctx = wb_samr_userdomgroups_send(state, domain->samr_pipe,
- domain->domain_handle,
+ ctx = wb_samr_userdomgroups_send(state, domain->libnet_ctx->samr.pipe,
+ &domain->libnet_ctx->samr.handle,
state->user_rid);
composite_continue(state->ctx, ctx, userdomgroups_recv_rids, state);
NTSTATUS wb_cmd_userdomgroups_recv(struct composite_context *c,
TALLOC_CTX *mem_ctx,
- int *num_sids, struct dom_sid ***sids)
+ uint32_t *num_sids, struct dom_sid ***sids)
{
struct cmd_userdomgroups_state *state =
talloc_get_type(c->private_data,
struct cmd_userdomgroups_state);
- int i;
+ uint32_t i;
NTSTATUS status;
status = composite_wait(c);
NTSTATUS wb_cmd_userdomgroups(TALLOC_CTX *mem_ctx,
struct wbsrv_service *service,
const struct dom_sid *sid,
- int *num_sids, struct dom_sid ***sids)
+ uint32_t *num_sids, struct dom_sid ***sids)
{
struct composite_context *c =
wb_cmd_userdomgroups_send(mem_ctx, service, sid);