diff options
-rw-r--r-- | lib/smbconf/smbconf.c | 13 | ||||
-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 | 14 | ||||
-rw-r--r-- | source3/lib/smbconf/smbconf_reg.c | 9 | ||||
-rw-r--r-- | source3/lib/smbconf/testsuite.c | 28 | ||||
-rw-r--r-- | source3/utils/net_conf.c | 8 |
7 files changed, 37 insertions, 41 deletions
diff --git a/lib/smbconf/smbconf.c b/lib/smbconf/smbconf.c index a6bb64fec8..f23a802e7c 100644 --- a/lib/smbconf/smbconf.c +++ b/lib/smbconf/smbconf.c @@ -355,7 +355,7 @@ sbcErr smbconf_delete_global_parameter(struct smbconf_ctx *ctx, return err; } -WERROR smbconf_get_includes(struct smbconf_ctx *ctx, +sbcErr smbconf_get_includes(struct smbconf_ctx *ctx, TALLOC_CTX *mem_ctx, const char *service, uint32_t *num_includes, char ***includes) @@ -364,21 +364,20 @@ WERROR smbconf_get_includes(struct smbconf_ctx *ctx, includes); } -WERROR smbconf_get_global_includes(struct smbconf_ctx *ctx, +sbcErr smbconf_get_global_includes(struct smbconf_ctx *ctx, TALLOC_CTX *mem_ctx, uint32_t *num_includes, char ***includes) { - WERROR werr; sbcErr err; err = smbconf_global_check(ctx); - if (SBC_ERROR_IS_OK(err)) { - return WERR_GENERAL_FAILURE; + if (!SBC_ERROR_IS_OK(err)) { + return err; } - werr = smbconf_get_includes(ctx, mem_ctx, GLOBAL_NAME, + err = smbconf_get_includes(ctx, mem_ctx, GLOBAL_NAME, num_includes, includes); - return werr; + return err; } WERROR smbconf_set_includes(struct smbconf_ctx *ctx, diff --git a/lib/smbconf/smbconf.h b/lib/smbconf/smbconf.h index e0a3ed5054..672c256480 100644 --- a/lib/smbconf/smbconf.h +++ b/lib/smbconf/smbconf.h @@ -111,11 +111,11 @@ sbcErr smbconf_delete_parameter(struct smbconf_ctx *ctx, const char *service, const char *param); sbcErr smbconf_delete_global_parameter(struct smbconf_ctx *ctx, const char *param); -WERROR smbconf_get_includes(struct smbconf_ctx *ctx, +sbcErr smbconf_get_includes(struct smbconf_ctx *ctx, TALLOC_CTX *mem_ctx, const char *service, uint32_t *num_includes, char ***includes); -WERROR smbconf_get_global_includes(struct smbconf_ctx *ctx, +sbcErr smbconf_get_global_includes(struct smbconf_ctx *ctx, TALLOC_CTX *mem_ctx, uint32_t *num_includes, char ***includes); WERROR smbconf_set_includes(struct smbconf_ctx *ctx, diff --git a/lib/smbconf/smbconf_private.h b/lib/smbconf/smbconf_private.h index c46d30279b..8fb9c84921 100644 --- a/lib/smbconf/smbconf_private.h +++ b/lib/smbconf/smbconf_private.h @@ -59,7 +59,7 @@ struct smbconf_ops { char **valstr); sbcErr (*delete_parameter)(struct smbconf_ctx *ctx, const char *service, const char *param); - WERROR (*get_includes)(struct smbconf_ctx *ctx, + sbcErr (*get_includes)(struct smbconf_ctx *ctx, TALLOC_CTX *mem_ctx, const char *service, uint32_t *num_includes, char ***includes); diff --git a/lib/smbconf/smbconf_txt.c b/lib/smbconf/smbconf_txt.c index 17dee486d5..7983d925e6 100644 --- a/lib/smbconf/smbconf_txt.c +++ b/lib/smbconf/smbconf_txt.c @@ -533,13 +533,12 @@ static sbcErr smbconf_txt_delete_parameter(struct smbconf_ctx *ctx, return SBC_ERR_NOT_SUPPORTED; } -static WERROR smbconf_txt_get_includes(struct smbconf_ctx *ctx, +static sbcErr smbconf_txt_get_includes(struct smbconf_ctx *ctx, TALLOC_CTX *mem_ctx, const char *service, uint32_t *num_includes, char ***includes) { - WERROR werr; sbcErr err; bool found; uint32_t sidx, count; @@ -549,7 +548,7 @@ static WERROR smbconf_txt_get_includes(struct smbconf_ctx *ctx, err = smbconf_txt_load_file(ctx); if (!SBC_ERROR_IS_OK(err)) { - return WERR_GENERAL_FAILURE; + return err; } found = smbconf_find_in_array(service, @@ -557,7 +556,7 @@ static WERROR smbconf_txt_get_includes(struct smbconf_ctx *ctx, pd(ctx)->cache->num_shares, &sidx); if (!found) { - return WERR_NO_SUCH_SERVICE; + return SBC_ERR_NO_SUCH_SERVICE; } tmp_ctx = talloc_stackframe(); @@ -571,7 +570,6 @@ static WERROR smbconf_txt_get_includes(struct smbconf_ctx *ctx, tmp_num_includes, pd(ctx)->cache->param_values[sidx][count]); if (!SBC_ERROR_IS_OK(err)) { - werr = WERR_NOMEM; goto done; } tmp_num_includes++; @@ -582,18 +580,18 @@ static WERROR smbconf_txt_get_includes(struct smbconf_ctx *ctx, if (*num_includes > 0) { *includes = talloc_move(mem_ctx, &tmp_includes); if (*includes == NULL) { - werr = WERR_NOMEM; + err = SBC_ERR_NOMEM; goto done; } } else { *includes = NULL; } - werr = WERR_OK; + err = SBC_ERR_OK; done: talloc_free(tmp_ctx); - return werr; + return err; } static WERROR smbconf_txt_set_includes(struct smbconf_ctx *ctx, diff --git a/source3/lib/smbconf/smbconf_reg.c b/source3/lib/smbconf/smbconf_reg.c index f78c3555ab..deca6ec68a 100644 --- a/source3/lib/smbconf/smbconf_reg.c +++ b/source3/lib/smbconf/smbconf_reg.c @@ -394,7 +394,6 @@ static sbcErr smbconf_reg_get_includes_internal(TALLOC_CTX *mem_ctx, count, array[count]); if (!SBC_ERROR_IS_OK(err)) { - werr = WERR_NOMEM; goto done; } } @@ -411,6 +410,7 @@ static sbcErr smbconf_reg_get_includes_internal(TALLOC_CTX *mem_ctx, *includes = NULL; } + err = SBC_ERR_OK; done: talloc_free(tmp_ctx); return err; @@ -1071,13 +1071,12 @@ done: return err; } -static WERROR smbconf_reg_get_includes(struct smbconf_ctx *ctx, +static sbcErr smbconf_reg_get_includes(struct smbconf_ctx *ctx, TALLOC_CTX *mem_ctx, const char *service, uint32_t *num_includes, char ***includes) { - WERROR werr; sbcErr err; struct registry_key *key = NULL; TALLOC_CTX *tmp_ctx = talloc_stackframe(); @@ -1085,20 +1084,18 @@ static WERROR smbconf_reg_get_includes(struct smbconf_ctx *ctx, err = smbconf_reg_open_service_key(tmp_ctx, ctx, service, REG_KEY_READ, &key); if (!SBC_ERROR_IS_OK(err)) { - werr = WERR_NOMEM; goto done; } err = smbconf_reg_get_includes_internal(mem_ctx, key, num_includes, includes); if (!SBC_ERROR_IS_OK(err)) { - werr = WERR_NOMEM; goto done; } done: talloc_free(tmp_ctx); - return werr; + return err; } static WERROR smbconf_reg_set_includes(struct smbconf_ctx *ctx, diff --git a/source3/lib/smbconf/testsuite.c b/source3/lib/smbconf/testsuite.c index b52d173768..8a7e2d4c25 100644 --- a/source3/lib/smbconf/testsuite.c +++ b/source3/lib/smbconf/testsuite.c @@ -40,17 +40,17 @@ static void print_strings(const char *prefix, static bool test_get_includes(struct smbconf_ctx *ctx) { - WERROR werr; + sbcErr err; bool ret = false; uint32_t num_includes = 0; char **includes = NULL; TALLOC_CTX *mem_ctx = talloc_stackframe(); printf("TEST: get_includes\n"); - werr = smbconf_get_global_includes(ctx, mem_ctx, - &num_includes, &includes); - if (!W_ERROR_IS_OK(werr)) { - printf("FAIL: get_includes - %s\n", win_errstr(werr)); + err = smbconf_get_global_includes(ctx, mem_ctx, + &num_includes, &includes); + if (!SBC_ERROR_IS_OK(err)) { + printf("FAIL: get_includes - %s\n", sbcErrorString(err)); goto done; } @@ -69,6 +69,7 @@ done: static bool test_set_get_includes(struct smbconf_ctx *ctx) { WERROR werr; + sbcErr err; uint32_t count; bool ret = false; const char *set_includes[] = { @@ -89,11 +90,11 @@ static bool test_set_get_includes(struct smbconf_ctx *ctx) goto done; } - werr = smbconf_get_global_includes(ctx, mem_ctx, &get_num_includes, - &get_includes); - if (!W_ERROR_IS_OK(werr)) { + err = smbconf_get_global_includes(ctx, mem_ctx, &get_num_includes, + &get_includes); + if (!SBC_ERROR_IS_OK(err)) { printf("FAIL: get_set_includes (getting includes) - %s\n", - win_errstr(werr)); + sbcErrorString(err)); goto done; } @@ -126,6 +127,7 @@ done: static bool test_delete_includes(struct smbconf_ctx *ctx) { WERROR werr; + sbcErr err; bool ret = false; const char *set_includes[] = { "/path/to/include", @@ -151,11 +153,11 @@ static bool test_delete_includes(struct smbconf_ctx *ctx) goto done; } - werr = smbconf_get_global_includes(ctx, mem_ctx, &get_num_includes, - &get_includes); - if (!W_ERROR_IS_OK(werr)) { + err = smbconf_get_global_includes(ctx, mem_ctx, &get_num_includes, + &get_includes); + if (!SBC_ERROR_IS_OK(err)) { printf("FAIL: delete_includes (getting includes) - %s\n", - win_errstr(werr)); + sbcErrorString(err)); goto done; } diff --git a/source3/utils/net_conf.c b/source3/utils/net_conf.c index bee8dd2a19..d3c39fdb74 100644 --- a/source3/utils/net_conf.c +++ b/source3/utils/net_conf.c @@ -1014,7 +1014,7 @@ static int net_conf_getincludes(struct net_context *c, struct smbconf_ctx *conf_ctx, int argc, const char **argv) { - WERROR werr; + sbcErr err; uint32_t num_includes; uint32_t count; char *service; @@ -1033,10 +1033,10 @@ static int net_conf_getincludes(struct net_context *c, goto done; } - werr = smbconf_get_includes(conf_ctx, mem_ctx, service, + err = smbconf_get_includes(conf_ctx, mem_ctx, service, &num_includes, &includes); - if (!W_ERROR_IS_OK(werr)) { - d_printf(_("error getting includes: %s\n"), win_errstr(werr)); + if (!SBC_ERROR_IS_OK(err)) { + d_printf(_("error getting includes: %s\n"), sbcErrorString(err)); goto done; } |