mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
dbwrap: dbwrap_store_uint32->dbwrap_store_uint32_bystring
Signed-off-by: Michael Adam <obnox@samba.org>
This commit is contained in:
parent
7f19a5ab52
commit
8f94ecbb90
@ -91,8 +91,8 @@ NTSTATUS dbwrap_store_int32_bystring(struct db_context *db, const char *keystr,
|
||||
int32_t v);
|
||||
NTSTATUS dbwrap_fetch_uint32_bystring(struct db_context *db,
|
||||
const char *keystr, uint32_t *val);
|
||||
NTSTATUS dbwrap_store_uint32(struct db_context *db, const char *keystr,
|
||||
uint32_t v);
|
||||
NTSTATUS dbwrap_store_uint32_bystring(struct db_context *db,
|
||||
const char *keystr, uint32_t v);
|
||||
NTSTATUS dbwrap_change_uint32_atomic(struct db_context *db, const char *keystr,
|
||||
uint32_t *oldval, uint32_t change_val);
|
||||
NTSTATUS dbwrap_trans_change_uint32_atomic(struct db_context *db,
|
||||
|
@ -99,8 +99,8 @@ NTSTATUS dbwrap_fetch_uint32_bystring(struct db_context *db,
|
||||
return NT_STATUS_OK;
|
||||
}
|
||||
|
||||
NTSTATUS dbwrap_store_uint32(struct db_context *db, const char *keystr,
|
||||
uint32_t v)
|
||||
NTSTATUS dbwrap_store_uint32_bystring(struct db_context *db,
|
||||
const char *keystr, uint32_t v)
|
||||
{
|
||||
struct db_record *rec;
|
||||
uint32_t v_store;
|
||||
|
@ -266,7 +266,8 @@ bool init_account_policy(void)
|
||||
}
|
||||
|
||||
if (version != DATABASE_VERSION) {
|
||||
status = dbwrap_store_uint32(db, vstring, DATABASE_VERSION);
|
||||
status = dbwrap_store_uint32_bystring(db, vstring,
|
||||
DATABASE_VERSION);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
DEBUG(0, ("dbwrap_store_uint32 failed: %s\n",
|
||||
nt_errstr(status)));
|
||||
|
@ -347,7 +347,7 @@ static bool tdbsam_upgrade_next_rid(struct db_context *db)
|
||||
rid = BASE_RID;
|
||||
}
|
||||
|
||||
status = dbwrap_store_uint32(db, NEXT_RID_STRING, rid);
|
||||
status = dbwrap_store_uint32_bystring(db, NEXT_RID_STRING, rid);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -103,13 +103,15 @@ static bool open_db(struct idmap_tdb_common_context *ctx)
|
||||
return false;
|
||||
}
|
||||
|
||||
status = dbwrap_store_uint32(ctx->db, ctx->hwmkey_uid, LOW_ID);
|
||||
status = dbwrap_store_uint32_bystring(ctx->db, ctx->hwmkey_uid,
|
||||
LOW_ID);
|
||||
if(!NT_STATUS_IS_OK(status)) {
|
||||
dbwrap_transaction_cancel(ctx->db);
|
||||
return false;
|
||||
}
|
||||
|
||||
status = dbwrap_store_uint32(ctx->db, ctx->hwmkey_gid, LOW_ID);
|
||||
status = dbwrap_store_uint32_bystring(ctx->db, ctx->hwmkey_gid,
|
||||
LOW_ID);
|
||||
if(!NT_STATUS_IS_OK(status)) {
|
||||
dbwrap_transaction_cancel(ctx->db);
|
||||
return false;
|
||||
|
@ -940,7 +940,7 @@ dbwrap_store_uint32_verbose(struct db_context *db, const char *key, uint32_t nva
|
||||
goto done;
|
||||
}
|
||||
|
||||
status = dbwrap_store_uint32(db, key, nval);
|
||||
status = dbwrap_store_uint32_bystring(db, key, nval);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf ("store %s failed: %s\n", key, nt_errstr(status));
|
||||
}
|
||||
@ -1259,8 +1259,8 @@ static bool check_ctx_write_new_db(struct check_ctx *ctx) {
|
||||
return false;
|
||||
}
|
||||
|
||||
status = dbwrap_store_uint32(ctx->odb,
|
||||
"INFO/version", ctx->version);
|
||||
status = dbwrap_store_uint32_bystring(ctx->odb, "INFO/version",
|
||||
ctx->version);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
DEBUG(0, ("write version failed: %s\n", nt_errstr(status)));
|
||||
return false;
|
||||
|
@ -102,7 +102,7 @@ static NTSTATUS idmap_autorid_get_domainrange_action(struct db_context *db,
|
||||
}
|
||||
|
||||
/* store away the new mapping in both directions */
|
||||
ret = dbwrap_store_uint32(db, cfg->sid, domainnum);
|
||||
ret = dbwrap_store_uint32_bystring(db, cfg->sid, domainnum);
|
||||
if (!NT_STATUS_IS_OK(ret)) {
|
||||
DEBUG(1, ("Fatal error while storing new "
|
||||
"domain->range assignment!\n"));
|
||||
|
@ -278,7 +278,8 @@ static NTSTATUS idmap_tdb_init_hwm(struct idmap_domain *dom)
|
||||
}
|
||||
|
||||
if (update_uid) {
|
||||
status = dbwrap_store_uint32(ctx->db, HWM_USER, dom->low_id);
|
||||
status = dbwrap_store_uint32_bystring(ctx->db, HWM_USER,
|
||||
dom->low_id);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
dbwrap_transaction_cancel(ctx->db);
|
||||
DEBUG(0, ("Unable to initialise user hwm in idmap "
|
||||
@ -288,7 +289,8 @@ static NTSTATUS idmap_tdb_init_hwm(struct idmap_domain *dom)
|
||||
}
|
||||
|
||||
if (update_gid) {
|
||||
status = dbwrap_store_uint32(ctx->db, HWM_GROUP, dom->low_id);
|
||||
status = dbwrap_store_uint32_bystring(ctx->db, HWM_GROUP,
|
||||
dom->low_id);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
dbwrap_transaction_cancel(ctx->db);
|
||||
DEBUG(0, ("Unable to initialise group hwm in idmap "
|
||||
|
Loading…
Reference in New Issue
Block a user