From 491afa3a4c0536bd797ab5a1cd1f8c82183122ce Mon Sep 17 00:00:00 2001 From: Gregor Beck Date: Mon, 26 Sep 2011 13:42:15 +0200 Subject: s3:net: avoid unnecessary initialization of the registry. This allows for using help without having access to the registry and prevents update code to run if only a readonly check is to be performed. Signed-off-by: Michael Adam --- source3/utils/net_registry.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/source3/utils/net_registry.c b/source3/utils/net_registry.c index 008d02129f..1d9546a8bd 100644 --- a/source3/utils/net_registry.c +++ b/source3/utils/net_registry.c @@ -1446,8 +1446,13 @@ int net_registry(struct net_context *c, int argc, const char **argv) { NULL, NULL, 0, NULL, NULL } }; - if (!W_ERROR_IS_OK(registry_init_basic())) { - return -1; + if (!c->display_usage + && (strcasecmp_m(argv[0], "convert") != 0) + && (strcasecmp_m(argv[0], "check") != 0)) + { + if (!W_ERROR_IS_OK(registry_init_basic())) { + return -1; + } } ret = net_run_function(c, argc, argv, "net registry", func); -- cgit