mirror of
https://github.com/samba-team/samba.git
synced 2025-03-07 00:58:40 +03:00
s3:registry: add regdb_store_values_internal() that takes a db_context argument
Michael
This commit is contained in:
parent
302265aae1
commit
e6340963cf
@ -35,6 +35,8 @@ static bool regdb_store_keys_internal(struct db_context *db, const char *key,
|
|||||||
struct regsubkey_ctr *ctr);
|
struct regsubkey_ctr *ctr);
|
||||||
static int regdb_fetch_values_internal(struct db_context *db, const char* key,
|
static int regdb_fetch_values_internal(struct db_context *db, const char* key,
|
||||||
struct regval_ctr *values);
|
struct regval_ctr *values);
|
||||||
|
static bool regdb_store_values_internal(struct db_context *db, const char *key,
|
||||||
|
struct regval_ctr *values);
|
||||||
|
|
||||||
/* List the deepest path into the registry. All part components will be created.*/
|
/* List the deepest path into the registry. All part components will be created.*/
|
||||||
|
|
||||||
@ -354,8 +356,9 @@ do_init:
|
|||||||
"[%d]\n",
|
"[%d]\n",
|
||||||
builtin_registry_values[i].type));
|
builtin_registry_values[i].type));
|
||||||
}
|
}
|
||||||
regdb_store_values(builtin_registry_values[i].path,
|
regdb_store_values_internal(regdb,
|
||||||
values);
|
builtin_registry_values[i].path,
|
||||||
|
values);
|
||||||
}
|
}
|
||||||
TALLOC_FREE(values);
|
TALLOC_FREE(values);
|
||||||
}
|
}
|
||||||
@ -1542,7 +1545,8 @@ int regdb_fetch_values(const char* key, struct regval_ctr *values)
|
|||||||
return regdb_fetch_values_internal(regdb, key, values);
|
return regdb_fetch_values_internal(regdb, key, values);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool regdb_store_values(const char *key, struct regval_ctr *values)
|
static bool regdb_store_values_internal(struct db_context *db, const char *key,
|
||||||
|
struct regval_ctr *values)
|
||||||
{
|
{
|
||||||
TDB_DATA old_data, data;
|
TDB_DATA old_data, data;
|
||||||
char *keystr = NULL;
|
char *keystr = NULL;
|
||||||
@ -1553,7 +1557,7 @@ bool regdb_store_values(const char *key, struct regval_ctr *values)
|
|||||||
|
|
||||||
DEBUG(10,("regdb_store_values: Looking for value of key [%s] \n", key));
|
DEBUG(10,("regdb_store_values: Looking for value of key [%s] \n", key));
|
||||||
|
|
||||||
if (!regdb_key_exists(regdb, key)) {
|
if (!regdb_key_exists(db, key)) {
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1581,7 +1585,7 @@ bool regdb_store_values(const char *key, struct regval_ctr *values)
|
|||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
old_data = dbwrap_fetch_bystring(regdb, ctx, keystr);
|
old_data = dbwrap_fetch_bystring(db, ctx, keystr);
|
||||||
|
|
||||||
if ((old_data.dptr != NULL)
|
if ((old_data.dptr != NULL)
|
||||||
&& (old_data.dsize == data.dsize)
|
&& (old_data.dsize == data.dsize)
|
||||||
@ -1591,7 +1595,7 @@ bool regdb_store_values(const char *key, struct regval_ctr *values)
|
|||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
status = dbwrap_trans_store_bystring(regdb, keystr, data, TDB_REPLACE);
|
status = dbwrap_trans_store_bystring(db, keystr, data, TDB_REPLACE);
|
||||||
|
|
||||||
result = NT_STATUS_IS_OK(status);
|
result = NT_STATUS_IS_OK(status);
|
||||||
|
|
||||||
@ -1600,6 +1604,11 @@ done:
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool regdb_store_values(const char *key, struct regval_ctr *values)
|
||||||
|
{
|
||||||
|
return regdb_store_values_internal(regdb, key, values);
|
||||||
|
}
|
||||||
|
|
||||||
static WERROR regdb_get_secdesc(TALLOC_CTX *mem_ctx, const char *key,
|
static WERROR regdb_get_secdesc(TALLOC_CTX *mem_ctx, const char *key,
|
||||||
struct security_descriptor **psecdesc)
|
struct security_descriptor **psecdesc)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user