summaryrefslogtreecommitdiff
path: root/source3/libnet
diff options
context:
space:
mode:
Diffstat (limited to 'source3/libnet')
-rw-r--r--source3/libnet/libnet_conf.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/source3/libnet/libnet_conf.c b/source3/libnet/libnet_conf.c
index dfea724497..1e9e033205 100644
--- a/source3/libnet/libnet_conf.c
+++ b/source3/libnet/libnet_conf.c
@@ -359,12 +359,17 @@ done:
WERROR libnet_smbconf_getparm(TALLOC_CTX *mem_ctx,
const char *service,
const char *param,
- struct registry_value **value)
+ char **valstr)
{
- WERROR werr;
+ WERROR werr = WERR_OK;
struct registry_key *key = NULL;
struct registry_value *value = NULL;
+ if (valstr == NULL) {
+ werr = WERR_INVALID_PARAM;
+ goto done;
+ }
+
if (!libnet_smbconf_key_exists(service)) {
werr = WERR_NO_SUCH_SERVICE;
goto done;
@@ -381,10 +386,20 @@ WERROR libnet_smbconf_getparm(TALLOC_CTX *mem_ctx,
goto done;
}
- werr = reg_queryvalue(mem_ctx, key, param, value);
+ werr = reg_queryvalue(mem_ctx, key, param, &value);
+ if (!W_ERROR_IS_OK(werr)) {
+ goto done;
+ }
+
+ *valstr = libnet_smbconf_format_registry_value(mem_ctx, value);
+
+ if (*valstr == NULL) {
+ werr = WERR_NOMEM;
+ }
done:
TALLOC_FREE(key);
+ TALLOC_FREE(value);
return werr;
}