NTSTATUS dbwrap_fetch_bystring(struct db_context *db, TALLOC_CTX *mem_ctx,
const char *key, TDB_DATA *value);
-NTSTATUS dbwrap_fetch_int32(struct db_context *db, const char *keystr,
- int32_t *result);
+NTSTATUS dbwrap_fetch_int32_bystring(struct db_context *db, const char *keystr,
+ int32_t *result);
NTSTATUS dbwrap_store_int32(struct db_context *db, const char *keystr,
int32_t v);
NTSTATUS dbwrap_fetch_uint32(struct db_context *db, const char *keystr,
#include "dbwrap.h"
#include "lib/util/util_tdb.h"
-NTSTATUS dbwrap_fetch_int32(struct db_context *db, const char *keystr,
- int32_t *result)
+NTSTATUS dbwrap_fetch_int32_bystring(struct db_context *db, const char *keystr,
+ int32_t *result)
{
TDB_DATA dbuf;
NTSTATUS status;
return False;
}
- status = dbwrap_fetch_int32(share_db, vstring, &vers_id);
+ status = dbwrap_fetch_int32_bystring(share_db, vstring, &vers_id);
if (!NT_STATUS_IS_OK(status)) {
vers_id = 0;
}
return false;
}
- status = dbwrap_fetch_int32(share_db, vstring, &vers_id);
+ status = dbwrap_fetch_int32_bystring(share_db, vstring, &vers_id);
if (!NT_STATUS_IS_OK(status)) {
vers_id = 0;
}
}
/* Check the version */
- status = dbwrap_fetch_int32(db_sam, TDBSAM_VERSION_STRING, &version);
+ status = dbwrap_fetch_int32_bystring(db_sam, TDBSAM_VERSION_STRING,
+ &version);
if (!NT_STATUS_IS_OK(status)) {
version = 0; /* Version not found, assume version 0 */
}
/* Get the minor version */
- status = dbwrap_fetch_int32(db_sam, TDBSAM_MINOR_VERSION_STRING,
- &minor_version);
+ status = dbwrap_fetch_int32_bystring(
+ db_sam, TDBSAM_MINOR_VERSION_STRING, &minor_version);
if (!NT_STATUS_IS_OK(status)) {
minor_version = 0; /* Minor version not found, assume 0 */
}
}
/* Re-check the version */
- status = dbwrap_fetch_int32(db_sam, TDBSAM_VERSION_STRING,
- &version);
+ status = dbwrap_fetch_int32_bystring(
+ db_sam, TDBSAM_VERSION_STRING, &version);
if (!NT_STATUS_IS_OK(status)) {
version = 0; /* Version not found, assume version 0 */
}
/* Re-check the minor version */
- status = dbwrap_fetch_int32(db_sam, TDBSAM_MINOR_VERSION_STRING,
- &minor_version);
+ status = dbwrap_fetch_int32_bystring(
+ db_sam, TDBSAM_MINOR_VERSION_STRING, &minor_version);
if (!NT_STATUS_IS_OK(status)) {
minor_version = 0; /* Minor version not found, assume 0 */
}
int32_t version_id;
struct regdb_trans_ctx *ctx = (struct regdb_trans_ctx *)private_data;
- status = dbwrap_fetch_int32(db, REGDB_VERSION_KEYNAME, &version_id);
+ status = dbwrap_fetch_int32_bystring(db, REGDB_VERSION_KEYNAME,
+ &version_id);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0, ("ERROR: could not fetch registry db version: %s. "
DEBUG(10, ("regdb_init: registry db openend. refcount reset (%d)\n",
regdb_refcount));
- status = dbwrap_fetch_int32(regdb, REGDB_VERSION_KEYNAME, &vers_id);
+ status = dbwrap_fetch_int32_bystring(regdb, REGDB_VERSION_KEYNAME,
+ &vers_id);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(10, ("regdb_init: registry version uninitialized "
"(got %d), initializing to version %d\n",
int32_t value;
NTSTATUS status;
- status = dbwrap_fetch_int32(db, keyname, &value);
+ status = dbwrap_fetch_int32_bystring(db, keyname, &value);
if (!NT_STATUS_IS_OK(status)) {
d_printf("Error fetching int32 from key '%s': %s\n",
keyname, nt_errstr(status));
#endif
DEBUG(0, ("Upgrading winbindd_idmap.tdb from an old version\n"));
- status = dbwrap_fetch_int32(db, "IDMAP_VERSION", &vers);
+ status = dbwrap_fetch_int32_bystring(db, "IDMAP_VERSION", &vers);
if (!NT_STATUS_IS_OK(status)) {
vers = -1;
}
int32 wm;
- status = dbwrap_fetch_int32(db, HWM_USER, &wm);
+ status = dbwrap_fetch_int32_bystring(db, HWM_USER, &wm);
if (!NT_STATUS_IS_OK(status)) {
wm = -1;
}
return False;
}
- status = dbwrap_fetch_int32(db, HWM_GROUP, &wm);
+ status = dbwrap_fetch_int32_bystring(db, HWM_GROUP, &wm);
if (!NT_STATUS_IS_OK(status)) {
wm = -1;
}
}
/* check against earlier versions */
- ret = dbwrap_fetch_int32(db, "IDMAP_VERSION", &version);
+ ret = dbwrap_fetch_int32_bystring(db, "IDMAP_VERSION", &version);
if (!NT_STATUS_IS_OK(ret)) {
version = -1;
}