diff options
-rw-r--r-- | source3/libnet/libnet_conf.c | 37 |
1 files changed, 10 insertions, 27 deletions
diff --git a/source3/libnet/libnet_conf.c b/source3/libnet/libnet_conf.c index bb0e637b33..3598f6c23c 100644 --- a/source3/libnet/libnet_conf.c +++ b/source3/libnet/libnet_conf.c @@ -29,12 +29,11 @@ /* * Open a subkey of KEY_SMBCONF (i.e a service) - * - variant without error output (q = quiet)- */ -static WERROR libnet_smbconf_open_path_q(TALLOC_CTX *ctx, - const char *subkeyname, - uint32 desired_access, - struct registry_key **key) +WERROR libnet_smbconf_open_path(TALLOC_CTX *ctx, + const char *subkeyname, + uint32 desired_access, + struct registry_key **key) { WERROR werr = WERR_OK; char *path = NULL; @@ -54,6 +53,11 @@ static WERROR libnet_smbconf_open_path_q(TALLOC_CTX *ctx, werr = reg_open_path(ctx, path, desired_access, token, key); + if (!W_ERROR_IS_OK(werr)) { + DEBUG(1, ("Error opening registry path '%s': %s\n", + path, dos_errstr(werr))); + } + done: TALLOC_FREE(path); return werr; @@ -69,7 +73,7 @@ bool libnet_smbconf_key_exists(const char *subkeyname) TALLOC_CTX *mem_ctx = talloc_stackframe(); struct registry_key *key = NULL; - werr = libnet_smbconf_open_path_q(mem_ctx, subkeyname, REG_KEY_READ, &key); + werr = libnet_smbconf_open_path(mem_ctx, subkeyname, REG_KEY_READ, &key); if (W_ERROR_IS_OK(werr)) { ret = true; } @@ -96,27 +100,6 @@ static bool libnet_smbconf_value_exists(struct registry_key *key, } /* - * Open a subkey of KEY_SMBCONF (i.e a service) - * - variant with error output - - */ -WERROR libnet_smbconf_open_path(TALLOC_CTX *ctx, const char *subkeyname, - uint32 desired_access, - struct registry_key **key) -{ - WERROR werr = WERR_OK; - - werr = libnet_smbconf_open_path_q(ctx, subkeyname, desired_access, key); - if (!W_ERROR_IS_OK(werr)) { - d_fprintf(stderr, "Error opening registry path '%s\\%s': %s\n", - KEY_SMBCONF, - (subkeyname == NULL) ? "" : subkeyname, - dos_errstr(werr)); - } - - return werr; -} - -/* * open the base key KEY_SMBCONF */ WERROR libnet_smbconf_open_basepath(TALLOC_CTX *ctx, uint32 desired_access, |