diff options
author | Günther Deschner <gd@samba.org> | 2010-09-21 20:56:23 -0700 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2010-09-23 10:26:25 -0700 |
commit | ffdfcfb514c1a0849ba334ae6b9b00d3ad3c2227 (patch) | |
tree | 536860be90ee3531863894f87e5c24b1cb523702 /source3/utils | |
parent | c3f5d990652aec4b4f1f23a5e1c7b644cd46cbe7 (diff) | |
download | samba-ffdfcfb514c1a0849ba334ae6b9b00d3ad3c2227.tar.gz samba-ffdfcfb514c1a0849ba334ae6b9b00d3ad3c2227.tar.bz2 samba-ffdfcfb514c1a0849ba334ae6b9b00d3ad3c2227.zip |
s3-dsgetdcname: always pass in messaging context.
Volker, please check.
Guenther
Diffstat (limited to 'source3/utils')
-rw-r--r-- | source3/utils/net.c | 6 | ||||
-rw-r--r-- | source3/utils/net.h | 1 | ||||
-rw-r--r-- | source3/utils/net_ads.c | 2 | ||||
-rw-r--r-- | source3/utils/net_lookup.c | 2 |
4 files changed, 10 insertions, 1 deletions
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)); |