summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2011-04-11 14:20:32 +0200
committerMichael Adam <obnox@samba.org>2011-05-10 19:13:21 +0200
commite19c4f278b5467327df7a90256802382c7999414 (patch)
tree5319762a937aefe7ce2c6dc935b0ebc4c4a5b407 /source3/lib
parentff5838d97aad5b283073726052456b06ecf410b2 (diff)
downloadsamba-e19c4f278b5467327df7a90256802382c7999414.tar.gz
samba-e19c4f278b5467327df7a90256802382c7999414.tar.bz2
samba-e19c4f278b5467327df7a90256802382c7999414.zip
libsmbconf: Convert smbconf_delete_parameter() to sbcErr.
Signed-off-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/smbconf/smbconf_reg.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/source3/lib/smbconf/smbconf_reg.c b/source3/lib/smbconf/smbconf_reg.c
index 42eb6d18b9..f78c3555ab 100644
--- a/source3/lib/smbconf/smbconf_reg.c
+++ b/source3/lib/smbconf/smbconf_reg.c
@@ -1036,37 +1036,39 @@ done:
/**
* delete a parameter from configuration
*/
-static WERROR smbconf_reg_delete_parameter(struct smbconf_ctx *ctx,
+static sbcErr smbconf_reg_delete_parameter(struct smbconf_ctx *ctx,
const char *service,
const char *param)
{
struct registry_key *key = NULL;
- WERROR werr = WERR_OK;
+ WERROR werr;
sbcErr err;
TALLOC_CTX *mem_ctx = talloc_stackframe();
err = smbconf_reg_open_service_key(mem_ctx, ctx, service,
REG_KEY_ALL, &key);
if (!SBC_ERROR_IS_OK(err)) {
- werr = WERR_NOMEM;
goto done;
}
if (!smbconf_reg_valname_valid(param)) {
- werr = WERR_INVALID_PARAM;
+ err = SBC_ERR_INVALID_PARAM;
goto done;
}
if (!smbconf_value_exists(key, param)) {
- werr = WERR_INVALID_PARAM;
+ err = SBC_ERR_CAN_NOT_COMPLETE;
goto done;
}
werr = reg_deletevalue(key, param);
+ if (!W_ERROR_IS_OK(werr)) {
+ err = SBC_ERR_ACCESS_DENIED;
+ }
done:
talloc_free(mem_ctx);
- return werr;
+ return err;
}
static WERROR smbconf_reg_get_includes(struct smbconf_ctx *ctx,