summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2008-03-30 01:25:45 +0100
committerMichael Adam <obnox@samba.org>2008-03-30 03:05:34 +0200
commitce0bbc82fd2e2f0756e11b93806895605f01b12e (patch)
tree73c193bbca0477d970c399bc6ef0e7dabb2c102c
parent7f71d1e8bdc28b6d9dc2307f0f2486a208ebd25f (diff)
downloadsamba-ce0bbc82fd2e2f0756e11b93806895605f01b12e.tar.gz
samba-ce0bbc82fd2e2f0756e11b93806895605f01b12e.tar.bz2
samba-ce0bbc82fd2e2f0756e11b93806895605f01b12e.zip
Revert "regdb: use dbwrap->fetch() instead of fetch_locked() for readonly access"
This reverts commit 4e2be189e97f653b75bd88135a631ce0f42db267. Metze, this broke the registry (reg_api layer), but I don't yet know exactly how and why. By the way, the locks there had the purpose of fetching the seqnum that really matches the data. This needs some more thought / debugging. But I wanted to have the tree in a working state again. Michael (This used to be commit 5c28c74aa06a82559f498373b3d6e9892d5c2cbe)
-rw-r--r--source3/registry/reg_backend_db.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/source3/registry/reg_backend_db.c b/source3/registry/reg_backend_db.c
index ad17068295..06f3d1acb3 100644
--- a/source3/registry/reg_backend_db.c
+++ b/source3/registry/reg_backend_db.c
@@ -706,7 +706,7 @@ int regdb_fetch_keys(const char *key, REGSUBKEY_CTR *ctr)
fstring subkeyname;
int ret = -1;
TALLOC_CTX *frame = talloc_stackframe();
- TDB_DATA value;
+ struct db_record *rec;
DEBUG(11,("regdb_fetch_keys: Enter key => [%s]\n", key ? key : "NULL"));
@@ -722,16 +722,16 @@ int regdb_fetch_keys(const char *key, REGSUBKEY_CTR *ctr)
}
strupper_m(path);
- ret = regdb->fetch(regdb, frame, string_term_tdb_data(path), &value);
- if (ret != 0) {
+ rec = regdb->fetch_locked(regdb, frame, string_term_tdb_data(path));
+ if (rec == NULL) {
ret = 0;
goto fail;
}
ctr->seqnum = regdb_get_seqnum();
- buf = value.dptr;
- buflen = value.dsize;
+ buf = rec->value.dptr;
+ buflen = rec->value.dsize;
if ( !buf ) {
DEBUG(5,("regdb_fetch_keys: tdb lookup failed to locate key [%s]\n", key));
@@ -841,8 +841,8 @@ int regdb_fetch_values( const char* key, REGVAL_CTR *values )
{
char *keystr = NULL;
TALLOC_CTX *ctx = talloc_stackframe();
+ struct db_record *rec;
int ret = 0;
- TDB_DATA value;
DEBUG(10,("regdb_fetch_values: Looking for value of key [%s] \n", key));
@@ -855,20 +855,19 @@ int regdb_fetch_values( const char* key, REGVAL_CTR *values )
goto done;
}
- ret = regdb->fetch(regdb, ctx, string_term_tdb_data(keystr), &value);
- if (ret != 0) {
- ret = 0;
+ rec = regdb->fetch_locked(regdb, ctx, string_term_tdb_data(keystr));
+ if (rec == NULL) {
goto done;
}
values->seqnum = regdb_get_seqnum();
- if (!value.dptr) {
+ if (!rec->value.dptr) {
/* all keys have zero values by default */
goto done;
}
- regdb_unpack_values(values, value.dptr, value.dsize);
+ regdb_unpack_values(values, rec->value.dptr, rec->value.dsize);
ret = regval_ctr_numvals(values);
done: