summaryrefslogtreecommitdiff
path: root/source3/libnet/libnet_conf.c
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2007-12-29 02:12:33 +0100
committerMichael Adam <obnox@samba.org>2007-12-29 02:12:33 +0100
commiteb356fbafc4b6e0d94b1ba75c6c466262e3221e5 (patch)
tree723e1fb64733f81a01e7e524bf744ecab9a90d7d /source3/libnet/libnet_conf.c
parent4b75bc63bb82f2322acdb013f1cfa9eb36419856 (diff)
downloadsamba-eb356fbafc4b6e0d94b1ba75c6c466262e3221e5.tar.gz
samba-eb356fbafc4b6e0d94b1ba75c6c466262e3221e5.tar.bz2
samba-eb356fbafc4b6e0d94b1ba75c6c466262e3221e5.zip
Hide the registry backend from libnet_smbconf_getparm().
Return a formatted string of the value instead. Michael (This used to be commit 7d0ec5bae155cda6620db04dcb7bd43db59241aa)
Diffstat (limited to 'source3/libnet/libnet_conf.c')
-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;
}