summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2009-03-04 22:02:07 +0100
committerMichael Adam <obnox@samba.org>2009-03-04 22:49:24 +0100
commit9d798494a90c13d605a52644a1a386a9fb109063 (patch)
treeee0c8e49be78055f14b26b135c842029c9cfe758
parent094578903184e2702d2a5000bf448a89954acf95 (diff)
downloadsamba-9d798494a90c13d605a52644a1a386a9fb109063.tar.gz
samba-9d798494a90c13d605a52644a1a386a9fb109063.tar.bz2
samba-9d798494a90c13d605a52644a1a386a9fb109063.zip
s3:smbconf: move smbconf_share_exists checks into backend
Michael
-rw-r--r--lib/smbconf/smbconf.c24
-rw-r--r--source3/lib/smbconf/smbconf_reg.c13
2 files changed, 9 insertions, 28 deletions
diff --git a/lib/smbconf/smbconf.c b/lib/smbconf/smbconf.c
index f25ccae0d4..80fe9aac37 100644
--- a/lib/smbconf/smbconf.c
+++ b/lib/smbconf/smbconf.c
@@ -226,10 +226,6 @@ WERROR smbconf_set_parameter(struct smbconf_ctx *ctx,
const char *param,
const char *valstr)
{
- if (!smbconf_share_exists(ctx, service)) {
- return WERR_NO_SUCH_SERVICE;
- }
-
return ctx->ops->set_parameter(ctx, service, param, valstr);
}
@@ -265,10 +261,6 @@ WERROR smbconf_get_parameter(struct smbconf_ctx *ctx,
return WERR_INVALID_PARAM;
}
- if (!smbconf_share_exists(ctx, service)) {
- return WERR_NO_SUCH_SERVICE;
- }
-
return ctx->ops->get_parameter(ctx, mem_ctx, service, param, valstr);
}
@@ -299,10 +291,6 @@ WERROR smbconf_get_global_parameter(struct smbconf_ctx *ctx,
WERROR smbconf_delete_parameter(struct smbconf_ctx *ctx,
const char *service, const char *param)
{
- if (!smbconf_share_exists(ctx, service)) {
- return WERR_NO_SUCH_SERVICE;
- }
-
return ctx->ops->delete_parameter(ctx, service, param);
}
@@ -329,10 +317,6 @@ WERROR smbconf_get_includes(struct smbconf_ctx *ctx,
const char *service,
uint32_t *num_includes, char ***includes)
{
- if (!smbconf_share_exists(ctx, service)) {
- return WERR_NO_SUCH_SERVICE;
- }
-
return ctx->ops->get_includes(ctx, mem_ctx, service, num_includes,
includes);
}
@@ -356,10 +340,6 @@ WERROR smbconf_set_includes(struct smbconf_ctx *ctx,
const char *service,
uint32_t num_includes, const char **includes)
{
- if (!smbconf_share_exists(ctx, service)) {
- return WERR_NO_SUCH_SERVICE;
- }
-
return ctx->ops->set_includes(ctx, service, num_includes, includes);
}
@@ -381,10 +361,6 @@ WERROR smbconf_set_global_includes(struct smbconf_ctx *ctx,
WERROR smbconf_delete_includes(struct smbconf_ctx *ctx, const char *service)
{
- if (!smbconf_share_exists(ctx, service)) {
- return WERR_NO_SUCH_SERVICE;
- }
-
return ctx->ops->delete_includes(ctx, service);
}
diff --git a/source3/lib/smbconf/smbconf_reg.c b/source3/lib/smbconf/smbconf_reg.c
index 5a5c0ead65..ae6a41151d 100644
--- a/source3/lib/smbconf/smbconf_reg.c
+++ b/source3/lib/smbconf/smbconf_reg.c
@@ -80,12 +80,20 @@ static WERROR smbconf_reg_open_service_key(TALLOC_CTX *mem_ctx,
uint32 desired_access,
struct registry_key **key)
{
+ WERROR werr;
+
if (servicename == NULL) {
*key = rpd(ctx)->base_key;
return WERR_OK;
}
- return reg_openkey(mem_ctx, rpd(ctx)->base_key, servicename,
+ werr = reg_openkey(mem_ctx, rpd(ctx)->base_key, servicename,
desired_access, key);
+
+ if (W_ERROR_EQUAL(werr, WERR_BADFILE)) {
+ werr = WERR_NO_SUCH_SERVICE;
+ }
+
+ return werr;
}
/**
@@ -828,9 +836,6 @@ static WERROR smbconf_reg_get_share(struct smbconf_ctx *ctx,
werr = smbconf_reg_open_service_key(tmp_ctx, ctx, servicename,
REG_KEY_READ, &key);
if (!W_ERROR_IS_OK(werr)) {
- if (W_ERROR_EQUAL(werr, WERR_BADFILE)) {
- werr = WERR_NO_SUCH_SERVICE;
- }
goto done;
}