diff options
-rw-r--r-- | lib/smbconf/smbconf.c | 11 | ||||
-rw-r--r-- | lib/smbconf/smbconf.h | 4 | ||||
-rw-r--r-- | lib/smbconf/smbconf_private.h | 2 | ||||
-rw-r--r-- | lib/smbconf/smbconf_txt.c | 4 | ||||
-rw-r--r-- | source3/lib/smbconf/smbconf_reg.c | 16 | ||||
-rw-r--r-- | source3/lib/smbconf/testsuite.c | 13 | ||||
-rw-r--r-- | source3/utils/net_conf.c | 8 |
7 files changed, 30 insertions, 28 deletions
diff --git a/lib/smbconf/smbconf.c b/lib/smbconf/smbconf.c index c3ba106d1c..54aaa22f6e 100644 --- a/lib/smbconf/smbconf.c +++ b/lib/smbconf/smbconf.c @@ -404,23 +404,22 @@ sbcErr smbconf_set_global_includes(struct smbconf_ctx *ctx, } -WERROR smbconf_delete_includes(struct smbconf_ctx *ctx, const char *service) +sbcErr smbconf_delete_includes(struct smbconf_ctx *ctx, const char *service) { return ctx->ops->delete_includes(ctx, service); } -WERROR smbconf_delete_global_includes(struct smbconf_ctx *ctx) +sbcErr smbconf_delete_global_includes(struct smbconf_ctx *ctx) { - WERROR werr; sbcErr err; err = smbconf_global_check(ctx); if (!SBC_ERROR_IS_OK(err)) { - return WERR_GENERAL_FAILURE; + return err; } - werr = smbconf_delete_includes(ctx, GLOBAL_NAME); + err = smbconf_delete_includes(ctx, GLOBAL_NAME); - return werr; + return err; } WERROR smbconf_transaction_start(struct smbconf_ctx *ctx) diff --git a/lib/smbconf/smbconf.h b/lib/smbconf/smbconf.h index 8921af4108..798db5b423 100644 --- a/lib/smbconf/smbconf.h +++ b/lib/smbconf/smbconf.h @@ -124,8 +124,8 @@ sbcErr smbconf_set_includes(struct smbconf_ctx *ctx, sbcErr smbconf_set_global_includes(struct smbconf_ctx *ctx, uint32_t num_includes, const char **includes); -WERROR smbconf_delete_includes(struct smbconf_ctx *ctx, const char *service); -WERROR smbconf_delete_global_includes(struct smbconf_ctx *ctx); +sbcErr smbconf_delete_includes(struct smbconf_ctx *ctx, const char *service); +sbcErr smbconf_delete_global_includes(struct smbconf_ctx *ctx); WERROR smbconf_transaction_start(struct smbconf_ctx *ctx); WERROR smbconf_transaction_commit(struct smbconf_ctx *ctx); diff --git a/lib/smbconf/smbconf_private.h b/lib/smbconf/smbconf_private.h index 1cb8b88d13..6672a50de1 100644 --- a/lib/smbconf/smbconf_private.h +++ b/lib/smbconf/smbconf_private.h @@ -66,7 +66,7 @@ struct smbconf_ops { sbcErr (*set_includes)(struct smbconf_ctx *ctx, const char *service, uint32_t num_includes, const char **includes); - WERROR (*delete_includes)(struct smbconf_ctx *ctx, + sbcErr (*delete_includes)(struct smbconf_ctx *ctx, const char *service); WERROR (*transaction_start)(struct smbconf_ctx *ctx); WERROR (*transaction_commit)(struct smbconf_ctx *ctx); diff --git a/lib/smbconf/smbconf_txt.c b/lib/smbconf/smbconf_txt.c index 5502167593..f6194db518 100644 --- a/lib/smbconf/smbconf_txt.c +++ b/lib/smbconf/smbconf_txt.c @@ -602,10 +602,10 @@ static sbcErr smbconf_txt_set_includes(struct smbconf_ctx *ctx, return SBC_ERR_NOT_SUPPORTED; } -static WERROR smbconf_txt_delete_includes(struct smbconf_ctx *ctx, +static sbcErr smbconf_txt_delete_includes(struct smbconf_ctx *ctx, const char *service) { - return WERR_NOT_SUPPORTED; + return SBC_ERR_NOT_SUPPORTED; } static WERROR smbconf_txt_transaction_start(struct smbconf_ctx *ctx) diff --git a/source3/lib/smbconf/smbconf_reg.c b/source3/lib/smbconf/smbconf_reg.c index 124140b178..eb6db29f5c 100644 --- a/source3/lib/smbconf/smbconf_reg.c +++ b/source3/lib/smbconf/smbconf_reg.c @@ -1059,7 +1059,7 @@ static sbcErr smbconf_reg_delete_parameter(struct smbconf_ctx *ctx, } if (!smbconf_value_exists(key, param)) { - err = SBC_ERR_CAN_NOT_COMPLETE; + err = SBC_ERR_OK; goto done; } @@ -1136,10 +1136,10 @@ done: return err; } -static WERROR smbconf_reg_delete_includes(struct smbconf_ctx *ctx, +static sbcErr smbconf_reg_delete_includes(struct smbconf_ctx *ctx, const char *service) { - WERROR werr = WERR_OK; + WERROR werr; sbcErr err; struct registry_key *key = NULL; TALLOC_CTX *tmp_ctx = talloc_stackframe(); @@ -1147,20 +1147,24 @@ static WERROR smbconf_reg_delete_includes(struct smbconf_ctx *ctx, err = smbconf_reg_open_service_key(tmp_ctx, ctx, service, REG_KEY_ALL, &key); if (!SBC_ERROR_IS_OK(err)) { - werr = WERR_NOMEM; goto done; } if (!smbconf_value_exists(key, INCLUDES_VALNAME)) { + err = SBC_ERR_OK; goto done; } werr = reg_deletevalue(key, INCLUDES_VALNAME); + if (!W_ERROR_IS_OK(werr)) { + err = SBC_ERR_ACCESS_DENIED; + goto done; + } - + err = SBC_ERR_OK; done: talloc_free(tmp_ctx); - return werr; + return err; } static WERROR smbconf_reg_transaction_start(struct smbconf_ctx *ctx) diff --git a/source3/lib/smbconf/testsuite.c b/source3/lib/smbconf/testsuite.c index 593839d88f..c2a9a59cbe 100644 --- a/source3/lib/smbconf/testsuite.c +++ b/source3/lib/smbconf/testsuite.c @@ -125,7 +125,6 @@ done: static bool test_delete_includes(struct smbconf_ctx *ctx) { - WERROR werr; sbcErr err; bool ret = false; const char *set_includes[] = { @@ -145,10 +144,10 @@ static bool test_delete_includes(struct smbconf_ctx *ctx) goto done; } - werr = smbconf_delete_global_includes(ctx); - if (!W_ERROR_IS_OK(werr)) { + err = smbconf_delete_global_includes(ctx); + if (!SBC_ERROR_IS_OK(err)) { printf("FAIL: delete_includes (deleting includes) - %s\n", - win_errstr(werr)); + sbcErrorString(err)); goto done; } @@ -165,10 +164,10 @@ static bool test_delete_includes(struct smbconf_ctx *ctx) goto done; } - werr = smbconf_delete_global_includes(ctx); - if (!W_ERROR_IS_OK(werr)) { + err = smbconf_delete_global_includes(ctx); + if (!SBC_ERROR_IS_OK(err)) { printf("FAIL: delete_includes (delete empty includes) - " - "%s\n", win_errstr(werr)); + "%s\n", sbcErrorString(err)); goto done; } diff --git a/source3/utils/net_conf.c b/source3/utils/net_conf.c index 255f14c920..2d7fb7bbb4 100644 --- a/source3/utils/net_conf.c +++ b/source3/utils/net_conf.c @@ -1102,7 +1102,7 @@ static int net_conf_delincludes(struct net_context *c, struct smbconf_ctx *conf_ctx, int argc, const char **argv) { - WERROR werr; + sbcErr err; char *service; int ret = -1; TALLOC_CTX *mem_ctx = talloc_stackframe(); @@ -1118,9 +1118,9 @@ static int net_conf_delincludes(struct net_context *c, goto done; } - werr = smbconf_delete_includes(conf_ctx, service); - if (!W_ERROR_IS_OK(werr)) { - d_printf(_("error deleting includes: %s\n"), win_errstr(werr)); + err = smbconf_delete_includes(conf_ctx, service); + if (!SBC_ERROR_IS_OK(err)) { + d_printf(_("error deleting includes: %s\n"), sbcErrorString(err)); goto done; } |