diff options
author | Matthias Dieter Wallnöfer <mdw@samba.org> | 2010-06-29 16:10:32 +0200 |
---|---|---|
committer | Matthias Dieter Wallnöfer <mdw@samba.org> | 2010-07-01 15:48:06 +0200 |
commit | de8a339cdf95f6737a8b1d34aa2aa9287bae0e46 (patch) | |
tree | 78fd03abe88ce462c17b242396d3bfa42b6fb71d /source4/lib/registry/local.c | |
parent | d81e2af69de4401335681d859c44b2c30fb4456c (diff) | |
download | samba-de8a339cdf95f6737a8b1d34aa2aa9287bae0e46.tar.gz samba-de8a339cdf95f6737a8b1d34aa2aa9287bae0e46.tar.bz2 samba-de8a339cdf95f6737a8b1d34aa2aa9287bae0e46.zip |
s4:registry - move some common constraint checks to the "local" backend
They should also be enforced when we don't use "ldb".
Diffstat (limited to 'source4/lib/registry/local.c')
-rw-r--r-- | source4/lib/registry/local.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/source4/lib/registry/local.c b/source4/lib/registry/local.c index 3078518539..98791743ae 100644 --- a/source4/lib/registry/local.c +++ b/source4/lib/registry/local.c @@ -80,6 +80,10 @@ static WERROR local_open_key(TALLOC_CTX *mem_ctx, const char **elements = NULL; int el; + if (path == NULL) { + return WERR_INVALID_PARAM; + } + orig = talloc_strdup(mem_ctx, path); W_ERROR_HAVE_NO_MEMORY(orig); curbegin = orig; @@ -180,6 +184,10 @@ static WERROR local_create_key(TALLOC_CTX *mem_ctx, const char **elements = NULL; int el; + if (path == NULL) { + return WERR_INVALID_PARAM; + } + orig = talloc_strdup(mem_ctx, path); W_ERROR_HAVE_NO_MEMORY(orig); curbegin = orig; @@ -240,6 +248,10 @@ static WERROR local_set_value(struct registry_key *key, const char *name, { struct local_key *local = (struct local_key *)key; + if (name == NULL) { + return WERR_INVALID_PARAM; + } + return hive_key_set_value(local->hive_key, name, type, data); } @@ -249,6 +261,10 @@ static WERROR local_get_value(TALLOC_CTX *mem_ctx, { const struct local_key *local = (const struct local_key *)key; + if (name == NULL) { + return WERR_INVALID_PARAM; + } + return hive_get_value(mem_ctx, local->hive_key, name, type, data); } @@ -269,6 +285,10 @@ static WERROR local_delete_key(TALLOC_CTX *mem_ctx, struct registry_key *key, { const struct local_key *local = (const struct local_key *)key; + if (name == NULL) { + return WERR_INVALID_PARAM; + } + return hive_key_del(mem_ctx, local->hive_key, name); } @@ -277,6 +297,10 @@ static WERROR local_delete_value(TALLOC_CTX *mem_ctx, struct registry_key *key, { const struct local_key *local = (const struct local_key *)key; + if (name == NULL) { + return WERR_INVALID_PARAM; + } + return hive_key_del_value(mem_ctx, local->hive_key, name); } |