char *p;
NTSTATUS status;
struct dom_sid sid;
- uint32 rid;
- fstring keystr;
+ uint32_t rid;
+ struct dom_sid_buf keystr;
fstring dom_name;
TDB_DATA key;
TDB_DATA key2;
sid_compose(&sid, &domain->sid, rid);
- sid_to_fstring(keystr, &sid);
- key2 = string_term_tdb_data(keystr);
+ key2 = string_term_tdb_data(dom_sid_str_buf(&sid, &keystr));
value = dbwrap_record_get_value(rec);
static bool idmap_tdb_upgrade(struct idmap_domain *dom, struct db_context *db)
{
- int32 vers;
+ int32_t vers;
struct convert_fn_state s;
NTSTATUS status;
* big endian machine and will need byte-reversing.
*/
- int32 wm;
+ int32_t wm;
status = dbwrap_fetch_int32_bystring(db, HWM_USER, &wm);
if (!NT_STATUS_IS_OK(status)) {
mem_ctx = talloc_stackframe();
/* use the old database if present */
- tdbfile = state_path("winbindd_idmap.tdb");
+ tdbfile = state_path(talloc_tos(), "winbindd_idmap.tdb");
if (!tdbfile) {
DEBUG(0, ("Out of memory!\n"));
ret = NT_STATUS_NO_MEMORY;
/* Open idmap repository */
db = db_open(mem_ctx, tdbfile, 0, TDB_DEFAULT, O_RDWR | O_CREAT, 0644,
- DBWRAP_LOCK_ORDER_1);
+ DBWRAP_LOCK_ORDER_1, DBWRAP_FLAG_NONE);
if (!db) {
DEBUG(0, ("Unable to open idmap database\n"));
ret = NT_STATUS_UNSUCCESSFUL;
.allocate_id = idmap_tdb_common_get_new_id,
};
-NTSTATUS idmap_tdb_init(void)
+NTSTATUS idmap_tdb_init(TALLOC_CTX *mem_ctx)
{
DEBUG(10, ("calling idmap_tdb_init\n"));