]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
net: abort when lp_realm is not set in net_ads_leave().
authorGünther Deschner <gd@samba.org>
Mon, 14 Apr 2008 20:58:38 +0000 (22:58 +0200)
committerGünther Deschner <gd@samba.org>
Mon, 14 Apr 2008 20:58:38 +0000 (22:58 +0200)
Guenther

source/utils/net_ads.c

index b4814521aac628654b42f382095c720dfef087aa..50e5b3752bac1b31a8b86c6e9fa6326322132a21 100644 (file)
@@ -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;