summaryrefslogtreecommitdiff
path: root/source3/lib/smbconf/smbconf_reg.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib/smbconf/smbconf_reg.c')
-rw-r--r--source3/lib/smbconf/smbconf_reg.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/source3/lib/smbconf/smbconf_reg.c b/source3/lib/smbconf/smbconf_reg.c
index 5a5c0ead65..ae6a41151d 100644
--- a/source3/lib/smbconf/smbconf_reg.c
+++ b/source3/lib/smbconf/smbconf_reg.c
@@ -80,12 +80,20 @@ static WERROR smbconf_reg_open_service_key(TALLOC_CTX *mem_ctx,
uint32 desired_access,
struct registry_key **key)
{
+ WERROR werr;
+
if (servicename == NULL) {
*key = rpd(ctx)->base_key;
return WERR_OK;
}
- return reg_openkey(mem_ctx, rpd(ctx)->base_key, servicename,
+ werr = reg_openkey(mem_ctx, rpd(ctx)->base_key, servicename,
desired_access, key);
+
+ if (W_ERROR_EQUAL(werr, WERR_BADFILE)) {
+ werr = WERR_NO_SUCH_SERVICE;
+ }
+
+ return werr;
}
/**
@@ -828,9 +836,6 @@ static WERROR smbconf_reg_get_share(struct smbconf_ctx *ctx,
werr = smbconf_reg_open_service_key(tmp_ctx, ctx, servicename,
REG_KEY_READ, &key);
if (!W_ERROR_IS_OK(werr)) {
- if (W_ERROR_EQUAL(werr, WERR_BADFILE)) {
- werr = WERR_NO_SUCH_SERVICE;
- }
goto done;
}