diff options
author | Michael Adam <obnox@samba.org> | 2011-08-30 14:06:22 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2011-09-01 23:18:18 +0200 |
commit | 861f04bec0172b80d20773f9be882ce08f5e3784 (patch) | |
tree | 13f74d936ac00597220914a53dfa658070a99a1f /source3/registry | |
parent | 6832ae4c6de815c326315de5b5e3a5a612d74af7 (diff) | |
download | samba-861f04bec0172b80d20773f9be882ce08f5e3784.tar.gz samba-861f04bec0172b80d20773f9be882ce08f5e3784.tar.bz2 samba-861f04bec0172b80d20773f9be882ce08f5e3784.zip |
s3:registry: implement regdb_store_values() with regdb_trans_do()
This adds the runtime check for changed regdb format version to store_values
Diffstat (limited to 'source3/registry')
-rw-r--r-- | source3/registry/reg_backend_db.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/source3/registry/reg_backend_db.c b/source3/registry/reg_backend_db.c index d6bfc77bde..43fa766d08 100644 --- a/source3/registry/reg_backend_db.c +++ b/source3/registry/reg_backend_db.c @@ -1814,9 +1814,34 @@ done: return status; } +struct regdb_store_values_ctx { + const char *key; + struct regval_ctr *values; +}; + +static NTSTATUS regdb_store_values_action(struct db_context *db, + void *private_data) +{ + NTSTATUS status; + struct regdb_store_values_ctx *ctx = + (struct regdb_store_values_ctx *)private_data; + + status = regdb_store_values_internal(db, ctx->key, ctx->values); + + return status; +} + bool regdb_store_values(const char *key, struct regval_ctr *values) { - return NT_STATUS_IS_OK(regdb_store_values_internal(regdb, key, values)); + WERROR werr; + struct regdb_store_values_ctx ctx; + + ctx.key = key; + ctx.values = values; + + werr = regdb_trans_do(regdb, regdb_store_values_action, &ctx); + + return W_ERROR_IS_OK(werr); } static WERROR regdb_get_secdesc(TALLOC_CTX *mem_ctx, const char *key, |