static bool tdbsam_upgrade_next_rid(struct db_context *db)
{
- TDB_CONTEXT *tdb;
+ struct db_context *db2;
uint32 rid;
- bool ok = false;
NTSTATUS status;
status = dbwrap_fetch_uint32_bystring(db, NEXT_RID_STRING, &rid);
return true;
}
- tdb = tdb_open_log(state_path("winbindd_idmap.tdb"), 0,
- TDB_DEFAULT, O_RDONLY, 0644);
+ db2 = db_s3open(db, state_path("winbindd_idmap.tdb"), 0,
+ TDB_DEFAULT, O_RDONLY, 0644);
- if (tdb) {
- ok = tdb_fetch_uint32(tdb, "RID_COUNTER", &rid);
- if (!ok) {
+ if (db2) {
+ status = dbwrap_fetch_uint32_bystring(db2, "RID_COUNTER", &rid);
+ if (!NT_STATUS_IS_OK(status)) {
rid = BASE_RID;
}
- tdb_close(tdb);
+ talloc_free(db2);
} else {
rid = BASE_RID;
}