summaryrefslogtreecommitdiffstats
path: root/source3
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2011-04-11 13:50:53 +0200
committerMichael Adam <obnox@samba.org>2011-05-10 19:13:21 +0200
commitff5838d97aad5b283073726052456b06ecf410b2 (patch)
tree17758bb35392865491bba9ad6a4fb8a4b69046dc /source3
parentddc28a683fcf036a279a0d3d7b23504364316fa6 (diff)
downloadsamba-ff5838d97aad5b283073726052456b06ecf410b2.tar.gz
samba-ff5838d97aad5b283073726052456b06ecf410b2.tar.xz
samba-ff5838d97aad5b283073726052456b06ecf410b2.zip
libsmbconf: Convert smbconf_get_parameter() to sbcErr.
Signed-off-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/lib/smbconf/smbconf_reg.c13
-rw-r--r--source3/utils/net_conf.c13
2 files changed, 12 insertions, 14 deletions
diff --git a/source3/lib/smbconf/smbconf_reg.c b/source3/lib/smbconf/smbconf_reg.c
index f7faf51e7d..42eb6d18b9 100644
--- a/source3/lib/smbconf/smbconf_reg.c
+++ b/source3/lib/smbconf/smbconf_reg.c
@@ -989,7 +989,7 @@ done:
/**
* get the value of a configuration parameter as a string
*/
-static WERROR smbconf_reg_get_parameter(struct smbconf_ctx *ctx,
+static sbcErr smbconf_reg_get_parameter(struct smbconf_ctx *ctx,
TALLOC_CTX *mem_ctx,
const char *service,
const char *param,
@@ -1003,35 +1003,34 @@ static WERROR smbconf_reg_get_parameter(struct smbconf_ctx *ctx,
err = smbconf_reg_open_service_key(mem_ctx, ctx, service,
REG_KEY_READ, &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_INVALID_PARAM;
goto done;
}
werr = reg_queryvalue(mem_ctx, key, param, &value);
if (!W_ERROR_IS_OK(werr)) {
+ err = SBC_ERR_NOMEM;
goto done;
}
*valstr = smbconf_format_registry_value(mem_ctx, value);
-
if (*valstr == NULL) {
- werr = WERR_NOMEM;
+ err = SBC_ERR_NOMEM;
}
done:
talloc_free(key);
talloc_free(value);
- return werr;
+ return err;
}
/**
diff --git a/source3/utils/net_conf.c b/source3/utils/net_conf.c
index 4be91e35a8..187735027b 100644
--- a/source3/utils/net_conf.c
+++ b/source3/utils/net_conf.c
@@ -902,7 +902,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;
@@ -931,21 +931,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;
}