summaryrefslogtreecommitdiff
path: root/source3/lib/smbconf
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2011-04-11 11:39:03 +0200
committerMichael Adam <obnox@samba.org>2011-05-10 19:13:21 +0200
commitfbd7626656d8d76f371e431005fbfa1228ba2029 (patch)
tree94d26a23735d6177f72ffae41bc1ce0418356c69 /source3/lib/smbconf
parent7f355e05f9ca41f9ba2bc7c9f14046a283ebd1d1 (diff)
downloadsamba-fbd7626656d8d76f371e431005fbfa1228ba2029.tar.gz
samba-fbd7626656d8d76f371e431005fbfa1228ba2029.tar.bz2
samba-fbd7626656d8d76f371e431005fbfa1228ba2029.zip
libsmbconf: Convert smbconf_delete_share() to sbcErr.
Signed-off-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'source3/lib/smbconf')
-rw-r--r--source3/lib/smbconf/smbconf_reg.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/source3/lib/smbconf/smbconf_reg.c b/source3/lib/smbconf/smbconf_reg.c
index 2425180bd5..e27a871a13 100644
--- a/source3/lib/smbconf/smbconf_reg.c
+++ b/source3/lib/smbconf/smbconf_reg.c
@@ -538,9 +538,10 @@ static bool smbconf_reg_key_has_values(struct registry_key *key)
/**
* delete all values from a key
*/
-static WERROR smbconf_reg_delete_values(struct registry_key *key)
+static sbcErr smbconf_reg_delete_values(struct registry_key *key)
{
WERROR werr;
+ sbcErr err;
char *valname;
struct registry_value *valvalue;
uint32_t count;
@@ -553,6 +554,7 @@ static WERROR smbconf_reg_delete_values(struct registry_key *key)
{
werr = reg_deletevalue(key, valname);
if (!W_ERROR_IS_OK(werr)) {
+ err = SBC_ERR_ACCESS_DENIED;
goto done;
}
}
@@ -561,14 +563,15 @@ static WERROR smbconf_reg_delete_values(struct registry_key *key)
"Error enumerating values of %s: %s\n",
key->key->name,
win_errstr(werr)));
+ err = SBC_ERR_ACCESS_DENIED;
goto done;
}
- werr = WERR_OK;
+ err = SBC_ERR_OK;
done:
talloc_free(mem_ctx);
- return werr;
+ return err;
}
/**********************************************************************
@@ -934,20 +937,24 @@ done:
/**
* delete a service from configuration
*/
-static WERROR smbconf_reg_delete_share(struct smbconf_ctx *ctx,
+static sbcErr smbconf_reg_delete_share(struct smbconf_ctx *ctx,
const char *servicename)
{
- WERROR werr = WERR_OK;
+ WERROR werr;
+ sbcErr err = SBC_ERR_OK;
TALLOC_CTX *mem_ctx = talloc_stackframe();
if (servicename != NULL) {
werr = reg_deletekey_recursive(rpd(ctx)->base_key, servicename);
+ if (!W_ERROR_IS_OK(werr)) {
+ err = SBC_ERR_ACCESS_DENIED;
+ }
} else {
- werr = smbconf_reg_delete_values(rpd(ctx)->base_key);
+ err = smbconf_reg_delete_values(rpd(ctx)->base_key);
}
talloc_free(mem_ctx);
- return werr;
+ return err;
}
/**