summaryrefslogtreecommitdiff
path: root/source4/lib/samba3/registry.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-08-25 19:02:03 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:34:35 -0500
commit69fb6840637e07318914d632571c8481f3573461 (patch)
tree0a1dd4cc4b91ab314ce02ea20c219a67c05aa154 /source4/lib/samba3/registry.c
parent9bf5e494f7ccbb2a9587dce961a99fa07392bf97 (diff)
downloadsamba-69fb6840637e07318914d632571c8481f3573461.tar.gz
samba-69fb6840637e07318914d632571c8481f3573461.tar.bz2
samba-69fb6840637e07318914d632571c8481f3573461.zip
r9621: Bunch of bug fixes. Add 'format' option to samba3dump (text,summary,ldif)
(This used to be commit dc6aab8d4a6d0fe47756c90d3d311b6009d571ff)
Diffstat (limited to 'source4/lib/samba3/registry.c')
-rw-r--r--source4/lib/samba3/registry.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/source4/lib/samba3/registry.c b/source4/lib/samba3/registry.c
index 82a08c9088..5f00a944e6 100644
--- a/source4/lib/samba3/registry.c
+++ b/source4/lib/samba3/registry.c
@@ -88,6 +88,7 @@ NTSTATUS samba3_read_regdb ( const char *fn, TALLOC_CTX *ctx, struct samba3_regd
if ( !(tdb = tdb_open(fn, 0, TDB_DEFAULT, O_RDONLY, 0600)) )
{
+ DEBUG(0, ("Unable to open registry database %s\n", fn));
return NT_STATUS_UNSUCCESSFUL;
}
@@ -96,8 +97,10 @@ NTSTATUS samba3_read_regdb ( const char *fn, TALLOC_CTX *ctx, struct samba3_regd
db->key_count = 0;
db->keys = NULL;
- if (vers_id > REGVER_V1)
+ if (vers_id != -1 && vers_id >= REGVER_V1) {
+ DEBUG(0, ("Registry version mismatch: %d\n", vers_id));
return NT_STATUS_UNSUCCESSFUL;
+ }
for (kbuf = tdb_firstkey(tdb); kbuf.dptr; kbuf = tdb_nextkey(tdb, kbuf))
{
@@ -106,7 +109,7 @@ NTSTATUS samba3_read_regdb ( const char *fn, TALLOC_CTX *ctx, struct samba3_regd
struct samba3_regkey key;
char *skey;
- if (strncmp(kbuf.dptr, VALUE_PREFIX, strlen(VALUE_PREFIX)))
+ if (strncmp(kbuf.dptr, VALUE_PREFIX, strlen(VALUE_PREFIX)) == 0)
continue;
vbuf = tdb_fetch(tdb, kbuf);
@@ -134,7 +137,7 @@ NTSTATUS samba3_read_regdb ( const char *fn, TALLOC_CTX *ctx, struct samba3_regd
}
db->keys = talloc_realloc(ctx, db->keys, struct samba3_regkey, db->key_count+1);
- db->keys[i] = key;
+ db->keys[db->key_count] = key;
db->key_count++;
}