diff options
author | Gregor Beck <gbeck@sernet.de> | 2011-09-26 13:42:15 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2011-10-12 22:45:53 +0200 |
commit | 491afa3a4c0536bd797ab5a1cd1f8c82183122ce (patch) | |
tree | 03e69a2da0df9235c53062fe6ed4779af9e4e81c /source3/utils | |
parent | 83748ae49c3d04bd087cbc75bf00e01bca670008 (diff) | |
download | samba-491afa3a4c0536bd797ab5a1cd1f8c82183122ce.tar.gz samba-491afa3a4c0536bd797ab5a1cd1f8c82183122ce.tar.bz2 samba-491afa3a4c0536bd797ab5a1cd1f8c82183122ce.zip |
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 <obnox@samba.org>
Diffstat (limited to 'source3/utils')
-rw-r--r-- | source3/utils/net_registry.c | 9 |
1 files 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); |