mirror of
https://github.com/samba-team/samba.git
synced 2025-01-12 09:18:10 +03:00
s3:registry: add db_context argument to regdb_store_keys_internal()
Michael
This commit is contained in:
parent
528bf38875
commit
a18a10c07a
@ -601,7 +601,9 @@ done:
|
||||
fstrings
|
||||
***********************************************************************/
|
||||
|
||||
static bool regdb_store_keys_internal(const char *key, struct regsubkey_ctr *ctr)
|
||||
static bool regdb_store_keys_internal(struct db_context *db,
|
||||
const char *key,
|
||||
struct regsubkey_ctr *ctr)
|
||||
{
|
||||
TDB_DATA dbuf;
|
||||
uint8 *buffer = NULL;
|
||||
@ -675,7 +677,7 @@ static bool regdb_store_keys_internal(const char *key, struct regsubkey_ctr *ctr
|
||||
|
||||
dbuf.dptr = buffer;
|
||||
dbuf.dsize = len;
|
||||
status = dbwrap_store_bystring(regdb, keyname, dbuf, TDB_REPLACE);
|
||||
status = dbwrap_store_bystring(db, keyname, dbuf, TDB_REPLACE);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
ret = false;
|
||||
goto done;
|
||||
@ -688,7 +690,7 @@ static bool regdb_store_keys_internal(const char *key, struct regsubkey_ctr *ctr
|
||||
keyname = talloc_asprintf(ctx, "%s/%s", REG_SORTED_SUBKEYS_PREFIX,
|
||||
keyname);
|
||||
if (keyname != NULL) {
|
||||
dbwrap_delete_bystring(regdb, keyname);
|
||||
dbwrap_delete_bystring(db, keyname);
|
||||
}
|
||||
|
||||
done:
|
||||
@ -820,7 +822,7 @@ bool regdb_store_keys(const char *key, struct regsubkey_ctr *ctr)
|
||||
|
||||
/* (2) store the subkey list for the parent */
|
||||
|
||||
if (!regdb_store_keys_internal(key, ctr) ) {
|
||||
if (!regdb_store_keys_internal(regdb, key, ctr)) {
|
||||
DEBUG(0,("regdb_store_keys: Failed to store new subkey list "
|
||||
"for parent [%s]\n", key));
|
||||
goto cancel;
|
||||
@ -837,7 +839,7 @@ bool regdb_store_keys(const char *key, struct regsubkey_ctr *ctr)
|
||||
goto cancel;
|
||||
}
|
||||
|
||||
if (!regdb_store_keys_internal(key, subkeys)) {
|
||||
if (!regdb_store_keys_internal(regdb, key, subkeys)) {
|
||||
DEBUG(0,("regdb_store_keys: Failed to store "
|
||||
"new record for key [%s]\n", key));
|
||||
goto cancel;
|
||||
@ -861,7 +863,7 @@ bool regdb_store_keys(const char *key, struct regsubkey_ctr *ctr)
|
||||
|
||||
if (regdb_fetch_keys( path, subkeys ) == -1) {
|
||||
/* create a record with 0 subkeys */
|
||||
if (!regdb_store_keys_internal(path, subkeys)) {
|
||||
if (!regdb_store_keys_internal(regdb, path, subkeys)) {
|
||||
DEBUG(0,("regdb_store_keys: Failed to store "
|
||||
"new record for key [%s]\n", path));
|
||||
goto cancel;
|
||||
@ -931,7 +933,7 @@ static WERROR regdb_create_subkey(const char *key, const char *subkey)
|
||||
werr = regsubkey_ctr_addkey(subkeys, subkey);
|
||||
W_ERROR_NOT_OK_GOTO(werr, cancel);
|
||||
|
||||
if (!regdb_store_keys_internal(key, subkeys)) {
|
||||
if (!regdb_store_keys_internal(regdb, key, subkeys)) {
|
||||
DEBUG(0, (__location__ " failed to store new subkey list for "
|
||||
"parent key %s\n", key));
|
||||
werr = WERR_REG_IO_FAILURE;
|
||||
@ -998,7 +1000,7 @@ static WERROR regdb_delete_subkey(const char *key, const char *subkey)
|
||||
werr = regsubkey_ctr_delkey(subkeys, subkey);
|
||||
W_ERROR_NOT_OK_GOTO(werr, cancel);
|
||||
|
||||
if (!regdb_store_keys_internal(key, subkeys)) {
|
||||
if (!regdb_store_keys_internal(regdb, key, subkeys)) {
|
||||
DEBUG(0, (__location__ " failed to store new subkey_list for "
|
||||
"parent key %s\n", key));
|
||||
werr = WERR_REG_IO_FAILURE;
|
||||
|
Loading…
Reference in New Issue
Block a user