summaryrefslogtreecommitdiff
path: root/source3/utils/net_ads.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2010-12-15 10:57:23 -0800
committerJeremy Allison <jra@samba.org>2010-12-15 20:45:25 +0100
commitb3630b4739b8cb7cf99e46ae13bbe52819a95750 (patch)
treef240e128ef8e763f611164b2480d8b3844250ba5 /source3/utils/net_ads.c
parent4a2d39697159c575721dfb3d2ff3940c6259f44b (diff)
downloadsamba-b3630b4739b8cb7cf99e46ae13bbe52819a95750.tar.gz
samba-b3630b4739b8cb7cf99e46ae13bbe52819a95750.tar.bz2
samba-b3630b4739b8cb7cf99e46ae13bbe52819a95750.zip
Fix bug 7866 - "net" in v3-6-test broken.
Someone wasn't careful about testing when not running as root :-). Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Wed Dec 15 20:45:25 CET 2010 on sn-devel-104
Diffstat (limited to 'source3/utils/net_ads.c')
-rw-r--r--source3/utils/net_ads.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c
index 858830f3c1..0b2165d73f 100644
--- a/source3/utils/net_ads.c
+++ b/source3/utils/net_ads.c
@@ -968,6 +968,12 @@ static int net_ads_leave(struct net_context *c, int argc, const char **argv)
use_in_memory_ccache();
}
+ if (!c->msg_ctx) {
+ d_fprintf(stderr, _("Could not initialise message context. "
+ "Try running as root\n"));
+ return -1;
+ }
+
werr = libnet_init_UnjoinCtx(ctx, &r);
if (!W_ERROR_IS_OK(werr)) {
d_fprintf(stderr, _("Could not initialise unjoin context.\n"));
@@ -1348,6 +1354,13 @@ int net_ads_join(struct net_context *c, int argc, const char **argv)
goto fail;
}
+ if (!c->msg_ctx) {
+ d_fprintf(stderr, _("Could not initialise message context. "
+ "Try running as root\n"));
+ werr = WERR_ACCESS_DENIED;
+ goto fail;
+ }
+
/* Do the domain join here */
r->in.domain_name = domain;