From ffdfcfb514c1a0849ba334ae6b9b00d3ad3c2227 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 21 Sep 2010 20:56:23 -0700 Subject: s3-dsgetdcname: always pass in messaging context. Volker, please check. Guenther --- source3/utils/net.c | 6 ++++++ source3/utils/net.h | 1 + source3/utils/net_ads.c | 2 ++ source3/utils/net_lookup.c | 2 +- 4 files changed, 10 insertions(+), 1 deletion(-) (limited to 'source3/utils') diff --git a/source3/utils/net.c b/source3/utils/net.c index eea13ea138..6c2fbad59a 100644 --- a/source3/utils/net.c +++ b/source3/utils/net.c @@ -929,6 +929,12 @@ static struct functable net_func[] = { c->opt_password = getenv("PASSWD"); } + c->msg_ctx = messaging_init(c, procid_self(), + event_context_init(c)); + if (c->msg_ctx == NULL) { + exit(1); + } + rc = net_run_function(c, argc_new-1, argv_new+1, "net", net_func); DEBUG(2,("return code = %d\n", rc)); diff --git a/source3/utils/net.h b/source3/utils/net.h index fc6addf231..d09d9905d7 100644 --- a/source3/utils/net.h +++ b/source3/utils/net.h @@ -78,6 +78,7 @@ struct net_context { struct sockaddr_storage opt_dest_ip; bool smb_encrypt; struct libnetapi_ctx *netapi_ctx; + struct messaging_context *msg_ctx; bool display_usage; void *private_data; diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c index 08bb9d1f60..a07e6c56ea 100644 --- a/source3/utils/net_ads.c +++ b/source3/utils/net_ads.c @@ -986,6 +986,7 @@ static int net_ads_leave(struct net_context *c, int argc, const char **argv) r->in.unjoin_flags = WKSSVC_JOIN_FLAGS_JOIN_TYPE | WKSSVC_JOIN_FLAGS_ACCOUNT_DELETE; r->in.delete_machine_account = true; + r->in.msg_ctx = c->msg_ctx; werr = libnet_Unjoin(ctx, r); if (!W_ERROR_IS_OK(werr)) { @@ -1357,6 +1358,7 @@ int net_ads_join(struct net_context *c, int argc, const char **argv) r->in.join_flags = WKSSVC_JOIN_FLAGS_JOIN_TYPE | WKSSVC_JOIN_FLAGS_ACCOUNT_CREATE | WKSSVC_JOIN_FLAGS_DOMAIN_JOIN_IF_JOINED; + r->in.msg_ctx = c->msg_ctx; werr = libnet_Join(ctx, r); if (!W_ERROR_IS_OK(werr)) { diff --git a/source3/utils/net_lookup.c b/source3/utils/net_lookup.c index 5ff62398f2..3609eacdf8 100644 --- a/source3/utils/net_lookup.c +++ b/source3/utils/net_lookup.c @@ -409,7 +409,7 @@ static int net_lookup_dsgetdcname(struct net_context *c, int argc, const char ** site_name = argv[2]; } - status = dsgetdcname(mem_ctx, NULL, domain_name, NULL, site_name, + status = dsgetdcname(mem_ctx, c->msg_ctx, domain_name, NULL, site_name, flags, &info); if (!NT_STATUS_IS_OK(status)) { d_printf(_("failed with: %s\n"), nt_errstr(status)); -- cgit