s3:dbwrap: change dbwrap_store_uint32() to NTSTATUS return type
[amitay/samba.git] / source3 / winbindd / idmap_tdb.c
index 339655f04455670a248d817eac4564f1a4c9d213..1d1ba64c21e869b7d25c7d82500e4b470f0f31ba 100644 (file)
@@ -251,7 +251,6 @@ static bool idmap_tdb_upgrade(struct idmap_domain *dom, struct db_context *db)
 
 static NTSTATUS idmap_tdb_init_hwm(struct idmap_domain *dom)
 {
-       int ret;
        uint32_t low_uid;
        uint32_t low_gid;
        bool update_uid = false;
@@ -281,21 +280,21 @@ static NTSTATUS idmap_tdb_init_hwm(struct idmap_domain *dom)
        }
 
        if (update_uid) {
-               ret = dbwrap_store_uint32(ctx->db, HWM_USER, dom->low_id);
-               if (ret == -1) {
+               status = dbwrap_store_uint32(ctx->db, HWM_USER, dom->low_id);
+               if (!NT_STATUS_IS_OK(status)) {
                        dbwrap_transaction_cancel(ctx->db);
                        DEBUG(0, ("Unable to initialise user hwm in idmap "
-                                 "database\n"));
+                                 "database: %s\n", nt_errstr(status)));
                        return NT_STATUS_INTERNAL_DB_ERROR;
                }
        }
 
        if (update_gid) {
-               ret = dbwrap_store_uint32(ctx->db, HWM_GROUP, dom->low_id);
-               if (ret == -1) {
+               status = dbwrap_store_uint32(ctx->db, HWM_GROUP, dom->low_id);
+               if (!NT_STATUS_IS_OK(status)) {
                        dbwrap_transaction_cancel(ctx->db);
                        DEBUG(0, ("Unable to initialise group hwm in idmap "
-                                 "database\n"));
+                                 "database: %s\n", nt_errstr(status)));
                        return NT_STATUS_INTERNAL_DB_ERROR;
                }
        }