s3-sessionid: make sure to call sessionid_init() also from the cmdline tools.
authorGünther Deschner <gd@samba.org>
Wed, 4 Sep 2013 14:45:32 +0000 (16:45 +0200)
committerKarolin Seeger <kseeger@samba.org>
Fri, 6 Sep 2013 09:22:34 +0000 (11:22 +0200)
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
source3/utils/net_serverid.c
source3/utils/net_status.c
source3/utils/status.c

index 08a1a7f298bc04ad0bc016b3a6ea0828f957987f..01109b9ffad85153a617228e089d6a8712301c84 100644 (file)
@@ -150,5 +150,10 @@ int net_serverid(struct net_context *c, int argc, const char **argv)
                {NULL, NULL, 0, NULL, NULL}
        };
 
+       if (!sessionid_init()) {
+               d_printf("failed to open sessionid.tdb\n");
+               return -1;
+       };
+
        return net_run_function(c, argc, argv, "net serverid", func);
 }
index d6027433a29c3708a4bc94ea5b64a525aa297f4d..39e2d205e2e248ef12a480b9d1af6fb5b4c49b7a 100644 (file)
@@ -239,5 +239,11 @@ int net_status(struct net_context *c, int argc, const char **argv)
                },
                {NULL, NULL, 0, NULL, NULL}
        };
+
+       if (!sessionid_init()) {
+               d_printf("failed to open sessionid.tdb\n");
+               return -1;
+       }
+
        return net_run_function(c, argc, argv, "net status", func);
 }
index cf625fb73fadffd96a423b8eeab8052136516518..34a7730994c3d9a82982cf453379901fe21bbd06 100644 (file)
@@ -378,6 +378,12 @@ static int traverse_sessionid(const char *key, struct sessionid *session,
        }
 
 
+       if (!sessionid_init()) {
+               fprintf(stderr, "Can't open sessionid.tdb\n");
+               ret = -1;
+               goto done;
+       }
+
        if (lp_clustering()) {
                /*
                 * This implicitly initializes the global ctdbd