From 69fb6840637e07318914d632571c8481f3573461 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 25 Aug 2005 19:02:03 +0000 Subject: r9621: Bunch of bug fixes. Add 'format' option to samba3dump (text,summary,ldif) (This used to be commit dc6aab8d4a6d0fe47756c90d3d311b6009d571ff) --- source4/lib/samba3/registry.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'source4/lib/samba3/registry.c') 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++; } -- cgit