int32_t *result);
NTSTATUS dbwrap_store_int32_bystring(struct db_context *db, const char *keystr,
int32_t v);
-NTSTATUS dbwrap_fetch_uint32(struct db_context *db, const char *keystr,
- uint32_t *val);
+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_change_uint32_atomic(struct db_context *db, const char *keystr,
return status;
}
-NTSTATUS dbwrap_fetch_uint32(struct db_context *db, const char *keystr,
- uint32_t *val)
+NTSTATUS dbwrap_fetch_uint32_bystring(struct db_context *db,
+ const char *keystr, uint32_t *val)
{
TDB_DATA dbuf;
NTSTATUS status;
}
}
- status = dbwrap_fetch_uint32(db, vstring, &version);
+ status = dbwrap_fetch_uint32_bystring(db, vstring, &version);
if (!NT_STATUS_IS_OK(status)) {
version = 0;
}
return false;
}
- status = dbwrap_fetch_uint32(db, vstring, &version);
+ status = dbwrap_fetch_uint32_bystring(db, vstring, &version);
if (!NT_STATUS_IS_OK(status)) {
version = 0;
}
return False;
}
- status = dbwrap_fetch_uint32(db, name, ®val);
+ status = dbwrap_fetch_uint32_bystring(db, name, ®val);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(1, ("account_policy_get: tdb_fetch_uint32 failed for type %d (%s), returning 0\n", type, name));
return False;
bool ok = false;
NTSTATUS status;
- status = dbwrap_fetch_uint32(db, NEXT_RID_STRING, &rid);
+ status = dbwrap_fetch_uint32_bystring(db, NEXT_RID_STRING, &rid);
if (NT_STATUS_IS_OK(status)) {
return true;
}
break;
}
- status = dbwrap_fetch_uint32(db, "transtest", &val);
+ status = dbwrap_fetch_uint32_bystring(db, "transtest", &val);
if (!NT_STATUS_IS_OK(status)) {
printf(__location__ "dbwrap_fetch_uint32 failed: %s\n",
nt_errstr(status));
}
}
- status = dbwrap_fetch_uint32(db, "transtest", &val2);
+ status = dbwrap_fetch_uint32_bystring(db, "transtest", &val2);
if (!NT_STATUS_IS_OK(status)) {
printf(__location__ "dbwrap_fetch_uint32 failed: %s\n",
nt_errstr(status));
uint32_t value;
NTSTATUS ret;
- ret = dbwrap_fetch_uint32(db, keyname, &value);
+ ret = dbwrap_fetch_uint32_bystring(db, keyname, &value);
if (NT_STATUS_IS_OK(ret)) {
d_printf("%u\n", value);
return 0;
char action = 's';
struct check_actions* act = &ctx->action;
- status = dbwrap_fetch_uint32(ctx->db, key, &version);
+ status = dbwrap_fetch_uint32_bystring(ctx->db, key, &version);
if (!NT_STATUS_IS_OK(status)) {
d_printf("No version number, assume 2\n");
action = get_action(&act->no_version, NULL, NULL);
NTSTATUS status;
struct check_actions* act = &ctx->action;
- status = dbwrap_fetch_uint32(ctx->db, key, &hwm);
+ status = dbwrap_fetch_uint32_bystring(ctx->db, key, &hwm);
if (!NT_STATUS_IS_OK(status)) {
d_printf("No %s should be %d\n", key, target);
action = get_action(&act->invalid_hwm, NULL, NULL);
uint32_t info_version = 0;
NTSTATUS status;
- status = dbwrap_fetch_uint32(ctx->idb, "INFO/version", &info_version);
+ status = dbwrap_fetch_uint32_bystring(ctx->idb, "INFO/version",
+ &info_version);
if (!NT_STATUS_IS_OK(status)) {
printf("Warning: no INFO/version found!\n");
/* info_version = guess_version(ctx); */
uint32_t oval;
NTSTATUS status;
- status = dbwrap_fetch_uint32(db, key, &oval);
+ status = dbwrap_fetch_uint32_bystring(db, key, &oval);
if (NT_STATUS_IS_OK(status)) {
if (nval == oval) {
goto done;
cfg = (struct autorid_domain_config *)private_data;
- ret = dbwrap_fetch_uint32(db, cfg->sid, &(cfg->domainnum));
+ ret = dbwrap_fetch_uint32_bystring(db, cfg->sid, &(cfg->domainnum));
if (NT_STATUS_IS_OK(ret)) {
/* entry is already present*/
DEBUG(10, ("Acquiring new range for domain %s\n", cfg->sid));
/* fetch the current HWM */
- ret = dbwrap_fetch_uint32(db, HWM, &hwm);
+ ret = dbwrap_fetch_uint32_bystring(db, HWM, &hwm);
if (!NT_STATUS_IS_OK(ret)) {
DEBUG(1, ("Fatal error while fetching current "
"HWM value: %s\n", nt_errstr(ret)));
* if it is not found create a mapping in a transaction unless
* read-only mode has been set
*/
- ret = dbwrap_fetch_uint32(autorid_db, dom->sid, &(dom->domainnum));
+ ret = dbwrap_fetch_uint32_bystring(autorid_db, dom->sid,
+ &(dom->domainnum));
if (!NT_STATUS_IS_OK(ret)) {
if (read_only) {
NTSTATUS status;
uint32_t hwmval;
- status = dbwrap_fetch_uint32(autorid_db, hwm, &hwmval);
+ status = dbwrap_fetch_uint32_bystring(autorid_db, hwm, &hwmval);
if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_FOUND)) {
status = dbwrap_trans_store_int32(autorid_db, hwm, 0);
if (!NT_STATUS_IS_OK(status)) {
/* read previously stored config and current HWM */
storedconfig = idmap_autorid_loadconfig(talloc_tos());
- status = dbwrap_fetch_uint32(autorid_db, HWM, &hwm);
+ status = dbwrap_fetch_uint32_bystring(autorid_db, HWM, &hwm);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(1, ("Fatal error while fetching current "
"HWM value: %s\n", nt_errstr(status)));
ctx = talloc_get_type(dom->private_data,
struct idmap_tdb_common_context);
- status = dbwrap_fetch_uint32(ctx->db, HWM_USER, &low_uid);
+ status = dbwrap_fetch_uint32_bystring(ctx->db, HWM_USER, &low_uid);
if (!NT_STATUS_IS_OK(status) || low_uid < dom->low_id) {
update_uid = true;
}
- status = dbwrap_fetch_uint32(ctx->db, HWM_GROUP, &low_gid);
+ status = dbwrap_fetch_uint32_bystring(ctx->db, HWM_GROUP, &low_gid);
if (!NT_STATUS_IS_OK(status) || low_gid < dom->low_id) {
update_gid = true;
}
state = (struct idmap_tdb_common_allocate_id_context *)private_data;
- ret = dbwrap_fetch_uint32(db, state->hwmkey, &hwm);
+ ret = dbwrap_fetch_uint32_bystring(db, state->hwmkey, &hwm);
if (!NT_STATUS_IS_OK(ret)) {
ret = NT_STATUS_INTERNAL_DB_ERROR;
goto done;