diff options
author | Michael Adam <obnox@samba.org> | 2007-12-23 02:55:25 +0100 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2007-12-23 04:10:31 +0100 |
commit | b04708866f146ada8a7cc353347244df54821fbf (patch) | |
tree | 993ad031df8f302c7c6d9f77cf45ca68a6bd8ad2 /source3/libnet | |
parent | ec3e8587ecdef8e4a52d4c37ac379d9e414b861b (diff) | |
download | samba-b04708866f146ada8a7cc353347244df54821fbf.tar.gz samba-b04708866f146ada8a7cc353347244df54821fbf.tar.bz2 samba-b04708866f146ada8a7cc353347244df54821fbf.zip |
Move logic of net_smbconf_delparm() to libnet/libnet_conf.c
Logic in new function libnet_smbconf_delparm().
Michael
(This used to be commit 0cff79e3552e91ba0b6bc054802d28afcf4e8da4)
Diffstat (limited to 'source3/libnet')
-rw-r--r-- | source3/libnet/libnet_conf.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/source3/libnet/libnet_conf.c b/source3/libnet/libnet_conf.c index 9f64e7fc0d..960ee80dbc 100644 --- a/source3/libnet/libnet_conf.c +++ b/source3/libnet/libnet_conf.c @@ -194,7 +194,7 @@ WERROR libnet_smbconf_set_global_param(TALLOC_CTX *mem_ctx, return do_modify_val_config(key, param, val); } -bool libnet_smbconf_value_exists(TALLOC_CTX *ctx, +static bool libnet_smbconf_value_exists(TALLOC_CTX *ctx, struct registry_key *key, const char *param) { @@ -211,3 +211,26 @@ bool libnet_smbconf_value_exists(TALLOC_CTX *ctx, return ret; } +WERROR libnet_smbconf_delparm(TALLOC_CTX *mem_ctx, + const char *service, + const char *param) +{ + struct registry_key *key = NULL; + WERROR werr = WERR_OK; + + if (!libnet_smbconf_key_exists(mem_ctx, service)) { + return WERR_NO_SUCH_SERVICE; + } + + werr = libnet_smbconf_open_path(mem_ctx, service, REG_KEY_READ, &key); + W_ERROR_NOT_OK_RETURN(werr); + + if (!libnet_smbconf_value_exists(mem_ctx, key, param)) { + return WERR_INVALID_PARAM; + } + + werr = reg_deletevalue(key, param); + W_ERROR_NOT_OK_RETURN(werr); + + return WERR_OK; +} |