summaryrefslogtreecommitdiff
path: root/source4/lib/registry
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-10-28 13:19:39 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:04:55 -0500
commita6ae640313a47ac2950c0948e4385fa934a5ef09 (patch)
tree3cc3cb8ec8c8cec020e85cd28e91c7dba128addf /source4/lib/registry
parente481385391a25c19d82ce93fbec11a973cf82e9f (diff)
downloadsamba-a6ae640313a47ac2950c0948e4385fa934a5ef09.tar.gz
samba-a6ae640313a47ac2950c0948e4385fa934a5ef09.tar.bz2
samba-a6ae640313a47ac2950c0948e4385fa934a5ef09.zip
r3323: more warning reductions
(This used to be commit 5921587ec26e4892efc678421277e4969417d7f5)
Diffstat (limited to 'source4/lib/registry')
-rw-r--r--source4/lib/registry/reg_backend_ldb/reg_backend_ldb.c6
-rw-r--r--source4/lib/registry/reg_backend_nt4/reg_backend_nt4.c12
-rw-r--r--source4/lib/registry/reg_backend_rpc/reg_backend_rpc.c28
-rw-r--r--source4/lib/registry/reg_backend_w95/reg_backend_w95.c9
4 files changed, 13 insertions, 42 deletions
diff --git a/source4/lib/registry/reg_backend_ldb/reg_backend_ldb.c b/source4/lib/registry/reg_backend_ldb/reg_backend_ldb.c
index d76b7715da..faa8a5e62c 100644
--- a/source4/lib/registry/reg_backend_ldb/reg_backend_ldb.c
+++ b/source4/lib/registry/reg_backend_ldb/reg_backend_ldb.c
@@ -57,12 +57,6 @@ static char *reg_path_to_ldb(TALLOC_CTX *mem_ctx, const char *path, const char *
}
-static int ldb_close_registry(void *data)
-{
- ldb_close((struct ldb_context *)data);
- return 0;
-}
-
static WERROR ldb_get_subkey_by_id(TALLOC_CTX *mem_ctx, struct registry_key *k, int idx, struct registry_key **subkey)
{
struct ldb_context *c = k->hive->backend_data;
diff --git a/source4/lib/registry/reg_backend_nt4/reg_backend_nt4.c b/source4/lib/registry/reg_backend_nt4/reg_backend_nt4.c
index 14fff5b60d..805f95fca1 100644
--- a/source4/lib/registry/reg_backend_nt4/reg_backend_nt4.c
+++ b/source4/lib/registry/reg_backend_nt4/reg_backend_nt4.c
@@ -934,7 +934,7 @@ static WERROR vk_to_val(TALLOC_CTX *mem_ctx, struct registry_key *parent, VK_HDR
if(tmp->data_type == REG_SZ) {
char *ret;
- dat_len = convert_string_talloc(mem_ctx, CH_UTF16, CH_UNIX, dtmp, dat_len, (const void **)&ret);
+ dat_len = convert_string_talloc(mem_ctx, CH_UTF16, CH_UNIX, dtmp, dat_len, (void **)&ret);
dtmp = ret;
}
@@ -1571,16 +1571,6 @@ error:
#endif
-static WERROR nt_close_registry (struct registry_hive *h)
-{
- REGF *regf = h->backend_data;
- if (regf->base) munmap(regf->base, regf->sbuf.st_size);
- regf->base = NULL;
- close(regf->fd); /* Ignore the error :-) */
-
- return WERR_OK;
-}
-
static WERROR nt_open_hive (TALLOC_CTX *mem_ctx, struct registry_hive *h, struct registry_key **key)
{
REGF *regf;
diff --git a/source4/lib/registry/reg_backend_rpc/reg_backend_rpc.c b/source4/lib/registry/reg_backend_rpc/reg_backend_rpc.c
index c819eb4254..76c19d01ad 100644
--- a/source4/lib/registry/reg_backend_rpc/reg_backend_rpc.c
+++ b/source4/lib/registry/reg_backend_rpc/reg_backend_rpc.c
@@ -100,7 +100,8 @@ WERROR rpc_list_hives (TALLOC_CTX *mem_ctx, const char *location, const char *cr
static WERROR rpc_open_hive(TALLOC_CTX *mem_ctx, struct registry_hive *h, struct registry_key **k)
{
NTSTATUS status;
- char *user, *pass;
+ char *user;
+ char *pass;
struct rpc_key_data *mykeydata;
struct dcerpc_pipe *p;
int n;
@@ -114,18 +115,18 @@ static WERROR rpc_open_hive(TALLOC_CTX *mem_ctx, struct registry_hive *h, struct
user = talloc_strdup(mem_ctx, h->credentials);
pass = strchr(user, '%');
- if(pass)
- {
- *pass = '\0'; pass++;
+ if (pass) {
+ pass = strdup(pass+1);
} else {
- pass = "";
+ pass = strdup("");
}
status = dcerpc_pipe_connect(&p, h->location,
- DCERPC_WINREG_UUID,
- DCERPC_WINREG_VERSION,
- lp_workgroup(),
- user, pass);
+ DCERPC_WINREG_UUID,
+ DCERPC_WINREG_VERSION,
+ lp_workgroup(),
+ user, pass);
+ free(pass);
h->backend_data = p;
@@ -145,12 +146,7 @@ static WERROR rpc_open_hive(TALLOC_CTX *mem_ctx, struct registry_hive *h, struct
return known_hives[n].open((struct dcerpc_pipe *)h->backend_data, *k, &(mykeydata->pol));
}
-static WERROR rpc_close_registry(struct registry_hive *h)
-{
- dcerpc_pipe_close((struct dcerpc_pipe *)h->backend_data);
- return WERR_OK;
-}
-
+#if 0
static WERROR rpc_key_put_rpc_data(TALLOC_CTX *mem_ctx, struct registry_key *k)
{
struct winreg_OpenKey r;
@@ -173,7 +169,7 @@ static WERROR rpc_key_put_rpc_data(TALLOC_CTX *mem_ctx, struct registry_key *k)
return r.out.result;
}
-
+#endif
static WERROR rpc_open_rel_key(TALLOC_CTX *mem_ctx, struct registry_key *h, const char *name, struct registry_key **key)
{
diff --git a/source4/lib/registry/reg_backend_w95/reg_backend_w95.c b/source4/lib/registry/reg_backend_w95/reg_backend_w95.c
index 2184a8855d..c285dac7c9 100644
--- a/source4/lib/registry/reg_backend_w95/reg_backend_w95.c
+++ b/source4/lib/registry/reg_backend_w95/reg_backend_w95.c
@@ -300,15 +300,6 @@ static WERROR w95_get_subkey_by_index (TALLOC_CTX *mem_ctx, struct registry_key
return WERR_NO_MORE_ITEMS;
}
-static WERROR w95_close_reg(struct registry_hive *h)
-{
- CREG *creg = h->backend_data;
- if (creg->base) munmap(creg->base, creg->sbuf.st_size);
- creg->base = NULL;
- close(creg->fd);
- return WERR_OK;
-}
-
static WERROR w95_num_values(struct registry_key *k, int *count)
{
RGKN_KEY *rgkn_key = k->backend_data;