#include "reg_backend_db.h"
#include "reg_objects.h"
#include "nt_printing.h"
+#include "util_tdb.h"
#include "dbwrap.h"
#undef DBGC_CLASS
/* preserve existing values across restarts. Only add new ones */
- if (!regval_ctr_key_exists(values,
+ if (!regval_ctr_value_exists(values,
builtin_registry_values[i].valuename))
{
regdb_ctr_add_value(values,
regdb_fetch_values_internal(regdb,
builtin_registry_values[i].path,
values);
- if (!regval_ctr_key_exists(values,
+ if (!regval_ctr_value_exists(values,
builtin_registry_values[i].valuename))
{
TALLOC_FREE(values);
TALLOC_FREE(path);
}
- werr = WERR_OK;
+ /*
+ * Update the seqnum in the container to possibly
+ * prevent next read from going to disk
+ */
+ werr = regsubkey_ctr_set_seqnum(store_ctx->ctr, db->get_seqnum(db));
done:
talloc_free(mem_ctx);
goto fail;
}
+ DEBUG(2, (__location__ " WARNING: recreating the sorted "
+ "subkeys cache for key '%s' from scan_parent_subkeys "
+ "this should not happen (too frequently)...\n",
+ path));
+
status = create_sorted_subkeys_internal(path, key);
if (!NT_STATUS_IS_OK(status)) {
res = db->transaction_cancel(db);
(uint8_t *)data_p, size);
SAFE_FREE(data_p); /* 'B' option to tdb_unpack does a malloc() */
- DEBUG(8,("specific: [%s], len: %d\n", valuename, size));
+ DEBUG(10, ("regdb_unpack_values: value[%d]: name[%s] len[%d]\n",
+ i, valuename, size));
}
return len;
TDB_DATA value;
WERROR werr;
- DEBUG(10,("regdb_fetch_values: Looking for value of key [%s] \n", key));
+ DEBUG(10,("regdb_fetch_values: Looking for values of key [%s]\n", key));
if (!regdb_key_exists(db, key)) {
goto done;
int len;
NTSTATUS status;
bool result = false;
+ WERROR werr;
- DEBUG(10,("regdb_store_values: Looking for value of key [%s] \n", key));
+ DEBUG(10,("regdb_store_values: Looking for values of key [%s]\n", key));
if (!regdb_key_exists(db, key)) {
goto done;
}
status = dbwrap_trans_store_bystring(db, keystr, data, TDB_REPLACE);
+ if (!NT_STATUS_IS_OK(status)) {
+ DEBUG(0, ("regdb_store_values_internal: error storing: %s\n", nt_errstr(status)));
+ goto done;
+ }
- result = NT_STATUS_IS_OK(status);
+ /*
+ * update the seqnum in the cache to prevent the next read
+ * from going to disk
+ */
+ werr = regval_ctr_set_seqnum(values, db->get_seqnum(db));
+ result = W_ERROR_IS_OK(status);
done:
TALLOC_FREE(ctx);