diff options
author | Andrew Bartlett <abartlet@samba.org> | 2011-06-24 16:26:23 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-06-24 16:26:23 +1000 |
commit | 6da26870e0ae5acd6ff49a30ec2f6886b44d095e (patch) | |
tree | 850c71039563c16a5d563c47e7ba2ab645baf198 /source3/utils/net_conf.c | |
parent | 6925a799d04c6fa59dd2ddef1f5510f9bb7d17d1 (diff) | |
parent | 2610c05b5b95cc7036b3d6dfb894c6cfbdb68483 (diff) | |
download | samba-6da26870e0ae5acd6ff49a30ec2f6886b44d095e.tar.gz samba-6da26870e0ae5acd6ff49a30ec2f6886b44d095e.tar.bz2 samba-6da26870e0ae5acd6ff49a30ec2f6886b44d095e.zip |
Merge 2610c05b5b95cc7036b3d6dfb894c6cfbdb68483 as Samba-4.0alpha16
Diffstat (limited to 'source3/utils/net_conf.c')
-rw-r--r-- | source3/utils/net_conf.c | 306 |
1 files changed, 144 insertions, 162 deletions
diff --git a/source3/utils/net_conf.c b/source3/utils/net_conf.c index fd00c008dd..9381159814 100644 --- a/source3/utils/net_conf.c +++ b/source3/utils/net_conf.c @@ -174,12 +174,12 @@ static int net_conf_delincludes_usage(struct net_context *c, int argc, /** * This functions process a service previously loaded with libsmbconf. */ -static WERROR import_process_service(struct net_context *c, +static sbcErr import_process_service(struct net_context *c, struct smbconf_ctx *conf_ctx, struct smbconf_service *service) { uint32_t idx; - WERROR werr = WERR_OK; + sbcErr err = SBC_ERR_OK; uint32_t num_includes = 0; char **includes = NULL; TALLOC_CTX *mem_ctx = talloc_stackframe(); @@ -200,54 +200,58 @@ static WERROR import_process_service(struct net_context *c, } if (smbconf_share_exists(conf_ctx, service->name)) { - werr = smbconf_delete_share(conf_ctx, service->name); - if (!W_ERROR_IS_OK(werr)) { + err = smbconf_delete_share(conf_ctx, service->name); + if (!SBC_ERROR_IS_OK(err)) { goto done; } } - werr = smbconf_create_share(conf_ctx, service->name); - if (!W_ERROR_IS_OK(werr)) { + err = smbconf_create_share(conf_ctx, service->name); + if (!SBC_ERROR_IS_OK(err)) { goto done; } for (idx = 0; idx < service->num_params; idx ++) { if (strequal(service->param_names[idx], "include")) { - includes = TALLOC_REALLOC_ARRAY(mem_ctx, + includes = talloc_realloc(mem_ctx, includes, char *, num_includes+1); if (includes == NULL) { - werr = WERR_NOMEM; + err = SBC_ERR_NOMEM; goto done; } includes[num_includes] = talloc_strdup(includes, service->param_values[idx]); if (includes[num_includes] == NULL) { - werr = WERR_NOMEM; + err = SBC_ERR_NOMEM; goto done; } num_includes++; } else { - werr = smbconf_set_parameter(conf_ctx, + err = smbconf_set_parameter(conf_ctx, service->name, service->param_names[idx], service->param_values[idx]); - if (!W_ERROR_IS_OK(werr)) { + if (!SBC_ERROR_IS_OK(err)) { d_fprintf(stderr, _("Error in section [%s], parameter \"%s\": %s\n"), service->name, service->param_names[idx], - win_errstr(werr)); + sbcErrorString(err)); goto done; } } } - werr = smbconf_set_includes(conf_ctx, service->name, num_includes, - (const char **)includes); + err = smbconf_set_includes(conf_ctx, service->name, num_includes, + (const char **)includes); + if (!SBC_ERROR_IS_OK(err)) { + goto done; + } + err = SBC_ERR_OK; done: TALLOC_FREE(mem_ctx); - return werr; + return err; } @@ -260,7 +264,7 @@ done: static int net_conf_list(struct net_context *c, struct smbconf_ctx *conf_ctx, int argc, const char **argv) { - WERROR werr = WERR_OK; + sbcErr err; int ret = -1; TALLOC_CTX *mem_ctx; uint32_t num_shares; @@ -274,10 +278,10 @@ static int net_conf_list(struct net_context *c, struct smbconf_ctx *conf_ctx, goto done; } - werr = smbconf_get_config(conf_ctx, mem_ctx, &num_shares, &shares); - if (!W_ERROR_IS_OK(werr)) { + err = smbconf_get_config(conf_ctx, mem_ctx, &num_shares, &shares); + if (!SBC_ERROR_IS_OK(err)) { d_fprintf(stderr, _("Error getting config: %s\n"), - win_errstr(werr)); + sbcErrorString(err)); goto done; } @@ -315,7 +319,7 @@ static int net_conf_import(struct net_context *c, struct smbconf_ctx *conf_ctx, char *conf_source = NULL; TALLOC_CTX *mem_ctx; struct smbconf_ctx *txt_ctx; - WERROR werr; + sbcErr err; if (c->display_usage) return net_conf_import_usage(c, argc, argv); @@ -347,10 +351,10 @@ static int net_conf_import(struct net_context *c, struct smbconf_ctx *conf_ctx, goto done; } - werr = smbconf_init(mem_ctx, &txt_ctx, conf_source); - if (!W_ERROR_IS_OK(werr)) { + err = smbconf_init(mem_ctx, &txt_ctx, conf_source); + if (!SBC_ERROR_IS_OK(err)) { d_printf(_("error loading file '%s': %s\n"), filename, - win_errstr(werr)); + sbcErrorString(err)); goto done; } @@ -362,37 +366,36 @@ static int net_conf_import(struct net_context *c, struct smbconf_ctx *conf_ctx, if (servicename != NULL) { struct smbconf_service *service = NULL; - werr = smbconf_get_share(txt_ctx, mem_ctx, - servicename, - &service); - if (!W_ERROR_IS_OK(werr)) { + err = smbconf_get_share(txt_ctx, mem_ctx, + servicename, + &service); + if (!SBC_ERROR_IS_OK(err)) { goto cancel; } - werr = smbconf_transaction_start(conf_ctx); - if (!W_ERROR_IS_OK(werr)) { + err = smbconf_transaction_start(conf_ctx); + if (!SBC_ERROR_IS_OK(err)) { d_printf(_("error starting transaction: %s\n"), - win_errstr(werr)); + sbcErrorString(err)); goto done; } - werr = import_process_service(c, conf_ctx, service); - if (!W_ERROR_IS_OK(werr)) { + err = import_process_service(c, conf_ctx, service); + if (!SBC_ERROR_IS_OK(err)) { goto cancel; } } else { struct smbconf_service **services = NULL; uint32_t num_shares, sidx; - werr = smbconf_get_config(txt_ctx, mem_ctx, + err = smbconf_get_config(txt_ctx, mem_ctx, &num_shares, &services); - if (!W_ERROR_IS_OK(werr)) { + if (!SBC_ERROR_IS_OK(err)) { goto cancel; } if (!c->opt_testmode) { - werr = smbconf_drop(conf_ctx); - if (!W_ERROR_IS_OK(werr)) { + if (!SBC_ERROR_IS_OK(smbconf_drop(conf_ctx))) { goto cancel; } } @@ -405,17 +408,17 @@ static int net_conf_import(struct net_context *c, struct smbconf_ctx *conf_ctx, * imported shares, the MAX_TALLOC_SIZE of 256 MB * was exceeded. */ - werr = smbconf_transaction_start(conf_ctx); - if (!W_ERROR_IS_OK(werr)) { + err = smbconf_transaction_start(conf_ctx); + if (!SBC_ERROR_IS_OK(err)) { d_printf(_("error starting transaction: %s\n"), - win_errstr(werr)); + sbcErrorString(err)); goto done; } for (sidx = 0; sidx < num_shares; sidx++) { - werr = import_process_service(c, conf_ctx, - services[sidx]); - if (!W_ERROR_IS_OK(werr)) { + err = import_process_service(c, conf_ctx, + services[sidx]); + if (!SBC_ERROR_IS_OK(err)) { goto cancel; } @@ -423,26 +426,26 @@ static int net_conf_import(struct net_context *c, struct smbconf_ctx *conf_ctx, continue; } - werr = smbconf_transaction_commit(conf_ctx); - if (!W_ERROR_IS_OK(werr)) { + err = smbconf_transaction_commit(conf_ctx); + if (!SBC_ERROR_IS_OK(err)) { d_printf(_("error committing transaction: " "%s\n"), - win_errstr(werr)); + sbcErrorString(err)); goto done; } - werr = smbconf_transaction_start(conf_ctx); - if (!W_ERROR_IS_OK(werr)) { + err = smbconf_transaction_start(conf_ctx); + if (!SBC_ERROR_IS_OK(err)) { d_printf(_("error starting transaction: %s\n"), - win_errstr(werr)); + sbcErrorString(err)); goto done; } } } - werr = smbconf_transaction_commit(conf_ctx); - if (!W_ERROR_IS_OK(werr)) { + err = smbconf_transaction_commit(conf_ctx); + if (!SBC_ERROR_IS_OK(err)) { d_printf(_("error committing transaction: %s\n"), - win_errstr(werr)); + sbcErrorString(err)); } else { ret = 0; } @@ -450,10 +453,10 @@ static int net_conf_import(struct net_context *c, struct smbconf_ctx *conf_ctx, goto done; cancel: - werr = smbconf_transaction_cancel(conf_ctx); - if (!W_ERROR_IS_OK(werr)) { + err = smbconf_transaction_cancel(conf_ctx); + if (!SBC_ERROR_IS_OK(err)) { d_printf(_("error cancelling transaction: %s\n"), - win_errstr(werr)); + sbcErrorString(err)); } done: @@ -465,7 +468,7 @@ static int net_conf_listshares(struct net_context *c, struct smbconf_ctx *conf_ctx, int argc, const char **argv) { - WERROR werr = WERR_OK; + sbcErr err; int ret = -1; uint32_t count, num_shares = 0; char **share_names = NULL; @@ -478,9 +481,9 @@ static int net_conf_listshares(struct net_context *c, goto done; } - werr = smbconf_get_share_names(conf_ctx, mem_ctx, &num_shares, - &share_names); - if (!W_ERROR_IS_OK(werr)) { + err = smbconf_get_share_names(conf_ctx, mem_ctx, &num_shares, + &share_names); + if (!SBC_ERROR_IS_OK(err)) { goto done; } @@ -500,17 +503,17 @@ static int net_conf_drop(struct net_context *c, struct smbconf_ctx *conf_ctx, int argc, const char **argv) { int ret = -1; - WERROR werr; + sbcErr err; if (argc != 0 || c->display_usage) { net_conf_drop_usage(c, argc, argv); goto done; } - werr = smbconf_drop(conf_ctx); - if (!W_ERROR_IS_OK(werr)) { + err = smbconf_drop(conf_ctx); + if (!SBC_ERROR_IS_OK(err)) { d_fprintf(stderr, _("Error deleting configuration: %s\n"), - win_errstr(werr)); + sbcErrorString(err)); goto done; } @@ -525,7 +528,7 @@ static int net_conf_showshare(struct net_context *c, const char **argv) { int ret = -1; - WERROR werr = WERR_OK; + sbcErr err; const char *sharename = NULL; TALLOC_CTX *mem_ctx; uint32_t count; @@ -544,10 +547,10 @@ static int net_conf_showshare(struct net_context *c, goto done; } - werr = smbconf_get_share(conf_ctx, mem_ctx, sharename, &service); - if (!W_ERROR_IS_OK(werr)) { + err = smbconf_get_share(conf_ctx, mem_ctx, sharename, &service); + if (!SBC_ERROR_IS_OK(err)) { d_printf(_("error getting share parameters: %s\n"), - win_errstr(werr)); + sbcErrorString(err)); goto done; } @@ -576,13 +579,12 @@ static int net_conf_addshare(struct net_context *c, const char **argv) { int ret = -1; - WERROR werr = WERR_OK; + sbcErr err; char *sharename = NULL; const char *path = NULL; const char *comment = NULL; const char *guest_ok = "no"; const char *writeable = "no"; - SMB_STRUCT_STAT sbuf; TALLOC_CTX *mem_ctx = talloc_stackframe(); if (c->display_usage) { @@ -682,30 +684,14 @@ static int net_conf_addshare(struct net_context *c, goto done; } - if (sys_stat(path, &sbuf, false) != 0) { - d_fprintf(stderr, - _("ERROR: cannot stat path '%s' to ensure " - "this is a directory.\n" - "Error was '%s'.\n"), - path, strerror(errno)); - goto done; - } - - if (!S_ISDIR(sbuf.st_ex_mode)) { - d_fprintf(stderr, - _("ERROR: path '%s' is not a directory.\n"), - path); - goto done; - } - /* * start a transaction */ - werr = smbconf_transaction_start(conf_ctx); - if (!W_ERROR_IS_OK(werr)) { + err = smbconf_transaction_start(conf_ctx); + if (!SBC_ERROR_IS_OK(err)) { d_printf("error starting transaction: %s\n", - win_errstr(werr)); + sbcErrorString(err)); goto done; } @@ -713,10 +699,10 @@ static int net_conf_addshare(struct net_context *c, * create the share */ - werr = smbconf_create_share(conf_ctx, sharename); - if (!W_ERROR_IS_OK(werr)) { + err = smbconf_create_share(conf_ctx, sharename); + if (!SBC_ERROR_IS_OK(err)) { d_fprintf(stderr, _("Error creating share %s: %s\n"), - sharename, win_errstr(werr)); + sharename, sbcErrorString(err)); goto cancel; } @@ -724,35 +710,35 @@ static int net_conf_addshare(struct net_context *c, * fill the share with parameters */ - werr = smbconf_set_parameter(conf_ctx, sharename, "path", path); - if (!W_ERROR_IS_OK(werr)) { + err = smbconf_set_parameter(conf_ctx, sharename, "path", path); + if (!SBC_ERROR_IS_OK(err)) { d_fprintf(stderr, _("Error setting parameter %s: %s\n"), - "path", win_errstr(werr)); + "path", sbcErrorString(err)); goto cancel; } if (comment != NULL) { - werr = smbconf_set_parameter(conf_ctx, sharename, "comment", - comment); - if (!W_ERROR_IS_OK(werr)) { + err = smbconf_set_parameter(conf_ctx, sharename, "comment", + comment); + if (!SBC_ERROR_IS_OK(err)) { d_fprintf(stderr, _("Error setting parameter %s: %s\n"), - "comment", win_errstr(werr)); + "comment", sbcErrorString(err)); goto cancel; } } - werr = smbconf_set_parameter(conf_ctx, sharename, "guest ok", guest_ok); - if (!W_ERROR_IS_OK(werr)) { + err = smbconf_set_parameter(conf_ctx, sharename, "guest ok", guest_ok); + if (!SBC_ERROR_IS_OK(err)) { d_fprintf(stderr, _("Error setting parameter %s: %s\n"), - "'guest ok'", win_errstr(werr)); + "'guest ok'", sbcErrorString(err)); goto cancel; } - werr = smbconf_set_parameter(conf_ctx, sharename, "writeable", - writeable); - if (!W_ERROR_IS_OK(werr)) { + err = smbconf_set_parameter(conf_ctx, sharename, "writeable", + writeable); + if (!SBC_ERROR_IS_OK(err)) { d_fprintf(stderr, _("Error setting parameter %s: %s\n"), - "writeable", win_errstr(werr)); + "writeable", sbcErrorString(err)); goto cancel; } @@ -760,10 +746,10 @@ static int net_conf_addshare(struct net_context *c, * commit the whole thing */ - werr = smbconf_transaction_commit(conf_ctx); - if (!W_ERROR_IS_OK(werr)) { + err = smbconf_transaction_commit(conf_ctx); + if (!SBC_ERROR_IS_OK(err)) { d_printf("error committing transaction: %s\n", - win_errstr(werr)); + sbcErrorString(err)); } else { ret = 0; } @@ -771,10 +757,10 @@ static int net_conf_addshare(struct net_context *c, goto done; cancel: - werr = smbconf_transaction_cancel(conf_ctx); - if (!W_ERROR_IS_OK(werr)) { + err = smbconf_transaction_cancel(conf_ctx); + if (!SBC_ERROR_IS_OK(err)) { d_printf("error cancelling transaction: %s\n", - win_errstr(werr)); + sbcErrorString(err)); } done: @@ -788,7 +774,7 @@ static int net_conf_delshare(struct net_context *c, { int ret = -1; const char *sharename = NULL; - WERROR werr = WERR_OK; + sbcErr err; TALLOC_CTX *mem_ctx = talloc_stackframe(); if (argc != 1 || c->display_usage) { @@ -801,10 +787,10 @@ static int net_conf_delshare(struct net_context *c, goto done; } - werr = smbconf_delete_share(conf_ctx, sharename); - if (!W_ERROR_IS_OK(werr)) { + err = smbconf_delete_share(conf_ctx, sharename); + if (!SBC_ERROR_IS_OK(err)) { d_fprintf(stderr, _("Error deleting share %s: %s\n"), - sharename, win_errstr(werr)); + sharename, sbcErrorString(err)); goto done; } @@ -818,7 +804,7 @@ static int net_conf_setparm(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; const char *value_str = NULL; @@ -846,34 +832,33 @@ static int net_conf_setparm(struct net_context *c, struct smbconf_ctx *conf_ctx, } value_str = argv[2]; - werr = smbconf_transaction_start(conf_ctx); - if (!W_ERROR_IS_OK(werr)) { + err = smbconf_transaction_start(conf_ctx); + if (!SBC_ERROR_IS_OK(err)) { d_printf(_("error starting transaction: %s\n"), - win_errstr(werr)); + sbcErrorString(err)); goto done; } if (!smbconf_share_exists(conf_ctx, service)) { - werr = smbconf_create_share(conf_ctx, service); - if (!W_ERROR_IS_OK(werr)) { + err = smbconf_create_share(conf_ctx, service); + if (!SBC_ERROR_IS_OK(err)) { d_fprintf(stderr, _("Error creating share '%s': %s\n"), - service, win_errstr(werr)); + service, sbcErrorString(err)); goto cancel; } } - werr = smbconf_set_parameter(conf_ctx, service, param, value_str); - - if (!W_ERROR_IS_OK(werr)) { + err = smbconf_set_parameter(conf_ctx, service, param, value_str); + if (!SBC_ERROR_IS_OK(err)) { d_fprintf(stderr, _("Error setting value '%s': %s\n"), - param, win_errstr(werr)); + param, sbcErrorString(err)); goto cancel; } - werr = smbconf_transaction_commit(conf_ctx); - if (!W_ERROR_IS_OK(werr)) { + err = smbconf_transaction_commit(conf_ctx); + if (!SBC_ERROR_IS_OK(err)) { d_printf(_("error committing transaction: %s\n"), - win_errstr(werr)); + sbcErrorString(err)); } else { ret = 0; } @@ -881,10 +866,10 @@ static int net_conf_setparm(struct net_context *c, struct smbconf_ctx *conf_ctx, goto done; cancel: - werr = smbconf_transaction_cancel(conf_ctx); - if (!W_ERROR_IS_OK(werr)) { + err = smbconf_transaction_cancel(conf_ctx); + if (!SBC_ERROR_IS_OK(err)) { d_printf(_("error cancelling transaction: %s\n"), - win_errstr(werr)); + sbcErrorString(err)); } done: @@ -896,7 +881,7 @@ static int net_conf_getparm(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; char *valstr = NULL; @@ -925,21 +910,20 @@ static int net_conf_getparm(struct net_context *c, struct smbconf_ctx *conf_ctx, goto done; } - werr = smbconf_get_parameter(conf_ctx, mem_ctx, service, param, &valstr); - - if (W_ERROR_EQUAL(werr, WERR_NO_SUCH_SERVICE)) { + err = smbconf_get_parameter(conf_ctx, mem_ctx, service, param, &valstr); + 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 getting value '%s': %s.\n"), - param, win_errstr(werr)); + param, sbcErrorString(err)); goto done; } @@ -955,7 +939,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(); @@ -981,21 +965,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; } @@ -1010,7 +993,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; @@ -1029,10 +1012,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; } @@ -1051,7 +1034,7 @@ static int net_conf_setincludes(struct net_context *c, struct smbconf_ctx *conf_ctx, int argc, const char **argv) { - WERROR werr; + sbcErr err; char *service; uint32_t num_includes; const char **includes; @@ -1076,9 +1059,9 @@ static int net_conf_setincludes(struct net_context *c, includes = argv + 1; } - werr = smbconf_set_includes(conf_ctx, service, num_includes, includes); - if (!W_ERROR_IS_OK(werr)) { - d_printf(_("error setting includes: %s\n"), win_errstr(werr)); + err = smbconf_set_includes(conf_ctx, service, num_includes, includes); + if (!SBC_ERROR_IS_OK(err)) { + d_printf(_("error setting includes: %s\n"), sbcErrorString(err)); goto done; } @@ -1093,7 +1076,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(); @@ -1109,9 +1092,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; } @@ -1140,14 +1123,13 @@ static int net_conf_wrap_function(struct net_context *c, int, const char **), int argc, const char **argv) { - WERROR werr; + sbcErr err; TALLOC_CTX *mem_ctx = talloc_stackframe(); struct smbconf_ctx *conf_ctx; int ret = -1; - werr = smbconf_init(mem_ctx, &conf_ctx, "registry:"); - - if (!W_ERROR_IS_OK(werr)) { + err = smbconf_init(mem_ctx, &conf_ctx, "registry:"); + if (!SBC_ERROR_IS_OK(err)) { return -1; } @@ -1184,7 +1166,7 @@ static int net_conf_run_function(struct net_context *c, int argc, if (argc != 0) { for (i=0; table[i].funcname; i++) { - if (StrCaseCmp(argv[0], table[i].funcname) == 0) + if (strcasecmp_m(argv[0], table[i].funcname) == 0) return net_conf_wrap_function(c, table[i].fn, argc-1, argv+1); |