registry: honour the WERROR that regsubkey_ctr_addkey gives in regdb_fetch_keys.
authorMichael Adam <obnox@samba.org>
Sun, 13 Apr 2008 13:41:07 +0000 (15:41 +0200)
committerMichael Adam <obnox@samba.org>
Sun, 13 Apr 2008 13:41:07 +0000 (15:41 +0200)
Michael
(This used to be commit 7dd7471da7eca2671b4aa62e8790973e3ff14177)

source3/registry/reg_backend_db.c

index 31a8f776149019dc8481e93101fb4f8c2e1f9ced..bd28eb32413d698c50535aa9f99d426eb15c30f3 100644 (file)
@@ -720,6 +720,7 @@ fail:
 
 int regdb_fetch_keys(const char *key, REGSUBKEY_CTR *ctr)
 {
+       WERROR werr;
        char *path = NULL;
        uint32 num_items;
        uint8 *buf;
@@ -764,7 +765,12 @@ int regdb_fetch_keys(const char *key, REGSUBKEY_CTR *ctr)
 
        for (i=0; i<num_items; i++) {
                len += tdb_unpack(buf+len, buflen-len, "f", subkeyname);
-               regsubkey_ctr_addkey(ctr, subkeyname);
+               werr = regsubkey_ctr_addkey(ctr, subkeyname);
+               if (!W_ERROR_IS_OK(werr)) {
+                       DEBUG(5, ("regdb_fetch_keys: regsubkey_ctr_addkey "
+                                 "failed: %s\n", dos_errstr(werr)));
+                       goto fail;
+               }
        }
 
        DEBUG(11,("regdb_fetch_keys: Exit [%d] items\n", num_items));