Janek Bevendorff
cdb9e36adb
Change TempFile saving method to use atomic renames
...
Fixes #13970
The previous TempFile saving method failed under Qt6 on certain remote file systems that don't support hard-linking or O_TMPFILE renames, such as remote SMB shares. Here, QFile::rename() created an unamed Q_TMPFILE, and tried to rename it with linkat(), which failed. Since QFile::rename() does not do file replacements, KeePassXC had to remove the target before moving the new file in place, which could cause to data loss when the rename failed.
This patch changes TempFile to a hybrid approach: The database is first written to a temporary file. The temporary file is committed to disk, and then streamed to a named sibling of the target file. Streaming avoids using QFile::copy() or QFile::rename(), which can trigger the failure. After straming the file back, the target file is replaced atomically (if possible) with the sibling.
2026-11-12 20:47:39 +01:00
..
2026-09-20 23:59:34 +02:00
2026-03-15 06:06:19 -04:00
2026-11-02 18:00:31 +01:00
2025-03-30 08:14:12 -04:00
2025-03-30 08:14:12 -04:00
2026-11-04 15:58:29 +01:00
2026-08-02 13:29:36 -04:00
2018-03-31 16:01:30 -04:00
2015-09-12 13:55:50 +02:00
2024-06-22 07:22:44 -04:00
2017-03-10 16:12:02 +01:00
2026-06-29 07:10:43 +03:00
2026-06-29 07:10:43 +03:00
2026-09-01 11:12:39 -04:00
2026-05-04 15:16:51 +03:00
2026-09-22 21:46:36 +02:00
2026-09-22 21:46:36 +02:00
2026-09-14 19:44:49 -04:00
2026-05-04 15:16:51 +03:00
2026-05-04 15:16:51 +03:00
2026-05-04 15:16:51 +03:00
2026-05-04 15:16:51 +03:00
2017-03-10 16:12:02 +01:00
2026-05-04 15:16:51 +03:00
2025-11-23 13:09:23 +01:00
2026-05-04 15:16:51 +03:00
2026-05-04 15:16:51 +03:00
2026-11-12 20:47:39 +01:00
2026-11-12 20:47:39 +01:00
2026-05-04 15:16:51 +03:00
2021-11-22 12:58:04 +01:00
2026-09-19 19:26:29 -04:00
2026-08-12 15:03:33 -04:00
2026-05-04 15:16:51 +03:00
2017-03-10 16:12:02 +01:00
2026-09-14 19:46:56 -04:00
2026-05-04 15:16:51 +03:00
2026-05-04 15:16:51 +03:00
2026-05-04 15:16:51 +03:00
2026-05-04 15:16:51 +03:00
2023-07-30 09:56:09 -04:00
2026-05-04 15:16:51 +03:00
2017-03-10 16:12:02 +01:00
2026-05-04 15:16:51 +03:00
2017-03-10 16:12:02 +01:00
2026-05-04 15:16:51 +03:00
2019-06-25 15:37:40 -04:00
2026-07-05 23:55:59 -04:00
2026-07-05 23:55:59 -04:00
2026-05-04 15:16:51 +03:00
2026-05-04 15:16:51 +03:00
2026-11-05 08:15:26 +01:00
2026-11-05 08:15:26 +01:00
2026-05-04 15:16:51 +03:00
2018-11-22 11:47:31 +01:00
2024-03-09 12:39:00 -05:00
2024-03-09 12:39:00 -05:00
2026-05-04 15:16:51 +03:00
2026-05-04 15:16:51 +03:00
2026-11-05 08:15:26 +01:00
2026-11-05 08:15:26 +01:00
2026-05-04 15:16:51 +03:00
2021-11-22 12:58:04 +01:00
2026-05-04 15:16:51 +03:00
2017-03-10 16:12:02 +01:00
2026-05-04 15:16:51 +03:00
2018-03-01 19:26:18 -05:00
2026-06-28 23:54:42 -04:00
2024-04-29 08:50:46 -04:00
2026-05-04 15:16:51 +03:00
2021-05-27 21:50:15 -04:00
2026-05-04 15:16:51 +03:00
2021-10-01 16:25:14 -04:00
2026-11-04 18:03:57 -05:00
2024-03-08 08:43:06 -05:00
2026-05-04 15:16:51 +03:00
2024-08-22 00:21:38 -04:00
2026-07-23 06:42:48 -04:00
2026-07-23 06:42:48 -04:00
2026-05-04 15:16:51 +03:00
2020-02-01 09:30:12 -05:00
2026-05-04 15:16:51 +03:00
2026-05-04 15:16:51 +03:00
2026-11-04 15:58:29 +01:00
2026-11-04 15:58:29 +01:00
2026-05-04 15:16:51 +03:00
2025-03-30 08:14:12 -04:00
2026-05-04 15:16:51 +03:00
2021-04-05 22:56:03 -04:00
2026-05-04 15:16:51 +03:00
2026-03-08 22:26:10 +01:00
2026-05-04 15:16:51 +03:00
2024-09-04 06:42:31 -04:00
2026-11-01 18:25:56 +01:00
2026-11-01 18:25:56 +01:00
2026-06-29 08:55:10 -04:00
2026-06-29 08:55:10 -04:00
2026-05-04 15:16:51 +03:00
2020-05-14 20:19:56 -04:00