From e19c4f278b5467327df7a90256802382c7999414 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 11 Apr 2011 14:20:32 +0200 Subject: libsmbconf: Convert smbconf_delete_parameter() to sbcErr. Signed-off-by: Michael Adam --- source3/lib/smbconf/smbconf_reg.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'source3/lib/smbconf') diff --git a/source3/lib/smbconf/smbconf_reg.c b/source3/lib/smbconf/smbconf_reg.c index 42eb6d18b93..f78c3555ab5 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, -- cgit v1.2.1