summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-04-14 22:58:38 +0200
committerGünther Deschner <gd@samba.org>2008-04-14 22:58:38 +0200
commit4122dabbf9ffce5b2353a25e16794e9d6d38228d (patch)
tree82eafcbfe11e0914fb4c0cbcbfdde5e351a78d1b /source3/utils
parenta31281a751d2ad2528ad99348a5c9c9ae10b99a4 (diff)
downloadsamba-4122dabbf9ffce5b2353a25e16794e9d6d38228d.tar.gz
samba-4122dabbf9ffce5b2353a25e16794e9d6d38228d.tar.bz2
samba-4122dabbf9ffce5b2353a25e16794e9d6d38228d.zip
net: abort when lp_realm is not set in net_ads_leave().
Guenther (This used to be commit 53735edcbb059e73c51ae17d4ff75d2a4dee53e5)
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/net_ads.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c
index b4814521aa..50e5b3752b 100644
--- a/source3/utils/net_ads.c
+++ b/source3/utils/net_ads.c
@@ -816,6 +816,11 @@ static int net_ads_leave(int argc, const char **argv)
struct libnet_UnjoinCtx *r = NULL;
WERROR werr;
+ if (!*lp_realm()) {
+ d_fprintf(stderr, "No realm set, are we joined ?\n");
+ return -1;
+ }
+
if (!(ctx = talloc_init("net_ads_leave"))) {
d_fprintf(stderr, "Could not initialise talloc context.\n");
return -1;