summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/lib/smbconf/smbconf_reg.c14
-rw-r--r--source3/libnet/libnet_join.c7
-rw-r--r--source3/utils/net_conf.c13
3 files changed, 19 insertions, 15 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,
diff --git a/source3/libnet/libnet_join.c b/source3/libnet/libnet_join.c
index ef0d5d0850..2b06be5dc1 100644
--- a/source3/libnet/libnet_join.c
+++ b/source3/libnet/libnet_join.c
@@ -1540,8 +1540,11 @@ static WERROR do_unjoin_modify_vals_config(struct libnet_UnjoinCtx *r)
goto done;
}
- werr = smbconf_delete_global_parameter(ctx, "workgroup");
- W_ERROR_NOT_OK_GOTO_DONE(werr);
+ err = smbconf_delete_global_parameter(ctx, "workgroup");
+ if (!SBC_ERROR_IS_OK(err)) {
+ werr = WERR_NO_SUCH_SERVICE;
+ goto done;
+ }
smbconf_delete_global_parameter(ctx, "realm");
}
diff --git a/source3/utils/net_conf.c b/source3/utils/net_conf.c
index 187735027b..bee8dd2a19 100644
--- a/source3/utils/net_conf.c
+++ b/source3/utils/net_conf.c
@@ -960,7 +960,7 @@ static int net_conf_delparm(struct net_context *c, struct smbconf_ctx *conf_ctx,
int argc, const char **argv)
{
int ret = -1;
- WERROR werr = WERR_OK;
+ sbcErr err;
char *service = NULL;
char *param = NULL;
TALLOC_CTX *mem_ctx = talloc_stackframe();
@@ -986,21 +986,20 @@ static int net_conf_delparm(struct net_context *c, struct smbconf_ctx *conf_ctx,
goto done;
}
- werr = smbconf_delete_parameter(conf_ctx, service, param);
-
- if (W_ERROR_EQUAL(werr, WERR_NO_SUCH_SERVICE)) {
+ err = smbconf_delete_parameter(conf_ctx, service, param);
+ if (SBC_ERROR_EQUAL(err, SBC_ERR_NO_SUCH_SERVICE)) {
d_fprintf(stderr,
_("Error: given service '%s' does not exist.\n"),
service);
goto done;
- } else if (W_ERROR_EQUAL(werr, WERR_INVALID_PARAM)) {
+ } else if (SBC_ERROR_EQUAL(err, SBC_ERR_INVALID_PARAM)) {
d_fprintf(stderr,
_("Error: given parameter '%s' is not set.\n"),
param);
goto done;
- } else if (!W_ERROR_IS_OK(werr)) {
+ } else if (!SBC_ERROR_IS_OK(err)) {
d_fprintf(stderr, _("Error deleting value '%s': %s.\n"),
- param, win_errstr(werr));
+ param, sbcErrorString(err));
goto done;
}