s3-registry: Check return code of push_reg_sz().
[kai/samba.git] / source3 / winbindd / idmap_autorid.c
index 26811a863c9362013a717dae5047ce7baf8def91..621cae98ef729305326c83537f0229894b7ef4ad 100644 (file)
@@ -309,6 +309,8 @@ static NTSTATUS idmap_autorid_id_to_sid(struct autorid_global_config *cfg,
           that is a deficiency in the idmap_rid design. */
 
        map->status = ID_MAPPED;
+       map->xid.type = ID_TYPE_BOTH;
+
        return NT_STATUS_OK;
 }
 
@@ -333,6 +335,7 @@ static NTSTATUS idmap_autorid_sid_to_id(struct autorid_global_config *global,
        }
        map->xid.id = global->minvalue +
            (global->rangesize * domain->domainnum)+rid;
+       map->xid.type = ID_TYPE_BOTH;
 
        /* We **really** should have some way of validating
           the SID exists and is the correct type here.  But
@@ -608,7 +611,7 @@ static NTSTATUS idmap_autorid_init_hwm(const char *hwm) {
 
        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);
+               status = dbwrap_trans_store_int32_bystring(autorid_db, hwm, 0);
                if (!NT_STATUS_IS_OK(status)) {
                        DEBUG(0,
                              ("Unable to initialise HWM (%s) in autorid "