summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/dbwrap/dbwrap.h4
-rw-r--r--lib/dbwrap/dbwrap_util.c4
-rw-r--r--source3/passdb/account_pol.c6
-rw-r--r--source3/passdb/pdb_tdb.c2
-rw-r--r--source3/torture/torture.c4
-rw-r--r--source3/utils/dbwrap_tool.c2
-rw-r--r--source3/utils/net_idmap_check.c4
-rw-r--r--source3/utils/net_registry_check.c5
-rw-r--r--source3/winbindd/idmap_autorid.c11
-rw-r--r--source3/winbindd/idmap_tdb.c4
-rw-r--r--source3/winbindd/idmap_tdb_common.c2
11 files changed, 25 insertions, 23 deletions
diff --git a/lib/dbwrap/dbwrap.h b/lib/dbwrap/dbwrap.h
index 7123ca7a61..01425115b7 100644
--- a/lib/dbwrap/dbwrap.h
+++ b/lib/dbwrap/dbwrap.h
@@ -89,8 +89,8 @@ NTSTATUS dbwrap_fetch_int32_bystring(struct db_context *db, const char *keystr,
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,
diff --git a/lib/dbwrap/dbwrap_util.c b/lib/dbwrap/dbwrap_util.c
index a3876064ad..7acc3b5e56 100644
--- a/lib/dbwrap/dbwrap_util.c
+++ b/lib/dbwrap/dbwrap_util.c
@@ -74,8 +74,8 @@ NTSTATUS dbwrap_store_int32_bystring(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;
diff --git a/source3/passdb/account_pol.c b/source3/passdb/account_pol.c
index 4cb185c494..9c6f40107a 100644
--- a/source3/passdb/account_pol.c
+++ b/source3/passdb/account_pol.c
@@ -233,7 +233,7 @@ bool init_account_policy(void)
}
}
- status = dbwrap_fetch_uint32(db, vstring, &version);
+ status = dbwrap_fetch_uint32_bystring(db, vstring, &version);
if (!NT_STATUS_IS_OK(status)) {
version = 0;
}
@@ -250,7 +250,7 @@ bool init_account_policy(void)
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;
}
@@ -340,7 +340,7 @@ bool account_policy_get(enum pdb_policy_type type, uint32_t *value)
return False;
}
- status = dbwrap_fetch_uint32(db, name, &regval);
+ status = dbwrap_fetch_uint32_bystring(db, name, &regval);
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;
diff --git a/source3/passdb/pdb_tdb.c b/source3/passdb/pdb_tdb.c
index 3faa4cf75d..43e561bd93 100644
--- a/source3/passdb/pdb_tdb.c
+++ b/source3/passdb/pdb_tdb.c
@@ -329,7 +329,7 @@ static bool tdbsam_upgrade_next_rid(struct db_context *db)
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;
}
diff --git a/source3/torture/torture.c b/source3/torture/torture.c
index 5fa633060c..a9edd61520 100644
--- a/source3/torture/torture.c
+++ b/source3/torture/torture.c
@@ -8656,7 +8656,7 @@ static bool run_local_dbtrans(int dummy)
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));
@@ -8669,7 +8669,7 @@ static bool run_local_dbtrans(int dummy)
}
}
- 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));
diff --git a/source3/utils/dbwrap_tool.c b/source3/utils/dbwrap_tool.c
index 677a9adeb4..6fb58090e0 100644
--- a/source3/utils/dbwrap_tool.c
+++ b/source3/utils/dbwrap_tool.c
@@ -59,7 +59,7 @@ static int dbwrap_tool_fetch_uint32(struct db_context *db,
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;
diff --git a/source3/utils/net_idmap_check.c b/source3/utils/net_idmap_check.c
index 1269410bee..4174238298 100644
--- a/source3/utils/net_idmap_check.c
+++ b/source3/utils/net_idmap_check.c
@@ -394,7 +394,7 @@ static bool check_version(struct check_ctx* ctx) {
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);
@@ -424,7 +424,7 @@ static void check_hwm(struct check_ctx* ctx, const char* key, uint32_t target) {
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);
diff --git a/source3/utils/net_registry_check.c b/source3/utils/net_registry_check.c
index 58cd9f6054..d6c577b89a 100644
--- a/source3/utils/net_registry_check.c
+++ b/source3/utils/net_registry_check.c
@@ -844,7 +844,8 @@ static bool get_version(struct check_ctx *ctx) {
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); */
@@ -923,7 +924,7 @@ dbwrap_store_uint32_verbose(struct db_context *db, const char *key, uint32_t nva
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;
diff --git a/source3/winbindd/idmap_autorid.c b/source3/winbindd/idmap_autorid.c
index df63fa9920..d02f34e573 100644
--- a/source3/winbindd/idmap_autorid.c
+++ b/source3/winbindd/idmap_autorid.c
@@ -68,7 +68,7 @@ static NTSTATUS idmap_autorid_get_domainrange_action(struct db_context *db,
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*/
@@ -78,7 +78,7 @@ static NTSTATUS idmap_autorid_get_domainrange_action(struct db_context *db,
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)));
@@ -146,7 +146,8 @@ static NTSTATUS idmap_autorid_get_domainrange(struct autorid_domain_config *dom,
* 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) {
@@ -605,7 +606,7 @@ static NTSTATUS idmap_autorid_init_hwm(const char *hwm) {
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)) {
@@ -843,7 +844,7 @@ static NTSTATUS idmap_autorid_initialize(struct idmap_domain *dom)
/* 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)));
diff --git a/source3/winbindd/idmap_tdb.c b/source3/winbindd/idmap_tdb.c
index 3e46cf76b7..4c3b4b190a 100644
--- a/source3/winbindd/idmap_tdb.c
+++ b/source3/winbindd/idmap_tdb.c
@@ -258,12 +258,12 @@ static NTSTATUS idmap_tdb_init_hwm(struct idmap_domain *dom)
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;
}
diff --git a/source3/winbindd/idmap_tdb_common.c b/source3/winbindd/idmap_tdb_common.c
index ca6f6d8e08..1c2e3467b2 100644
--- a/source3/winbindd/idmap_tdb_common.c
+++ b/source3/winbindd/idmap_tdb_common.c
@@ -56,7 +56,7 @@ static NTSTATUS idmap_tdb_common_allocate_id_action(struct db_context *db,
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;