Commit Graph
6146 Commits
Author SHA1 Message Date
TW 428c26d755 Merge pull request #9524 from ThomasWaldmann/hashindex-fix-for-bigendian-1.1
hashindex: fix new checks for big endian archs, fixes #9521
2026-03-19 16:21:44 +01:00
Thomas Waldmann 3b9ccaa1ff hashindex: fix new checks for big endian archs, fixes #9521 2026-03-19 16:08:53 +01:00
TW 5e922339c3 Merge pull request #9520 from ThomasWaldmann/fix-ci-1.1
CI: use Ubuntu 22.04 / macOS 15
2026-03-19 14:05:05 +01:00
Thomas Waldmann da77417c0f CI: increase timeout, macOS runners are slooow 2026-03-19 14:04:24 +01:00
Thomas Waldmann c77fb4060d CI/requirements: use pytest < 9.0.0 2026-03-19 11:26:14 +01:00
Thomas Waldmann eda794c844 CI: remove outdated Pythons 2026-03-19 11:19:17 +01:00
Thomas Waldmann cd6e93c4c4 CI: use cache@v4 2026-03-19 11:15:05 +01:00
Thomas Waldmann eb09c5a359 CI: use Ubuntu 22.04 / macOS 15 2026-03-19 11:10:50 +01:00
TW e676c5ff63 Merge pull request #9515 from ThomasWaldmann/hashindex_size-64bit-1.1
hashindex_size: return int64_t, fixes #9423
2026-03-19 10:12:42 +01:00
TW 6bc07f5a1b Merge pull request #9516 from ThomasWaldmann/fix-hashindex-1.1
hashindex: fixed iteritems segfaulting with non-existent marker, fixes #9368
2026-03-19 10:11:34 +01:00
Thomas Waldmann 5c322640e0 hashindex: fixed iteritems segfaulting with non-existent marker, fixes #9368
Never happened in borg, because borg always gives existing markers to iteritems.
2026-03-19 10:01:33 +01:00
Thomas Waldmann c2191237e4 hashindex_size: return int64_t, fixes #9423 2026-03-19 09:47:33 +01:00
TW fe721d6a3c Merge pull request #9509 from ThomasWaldmann/hashindex-fixes-1.1
hashindex: check values in read HashHeader, fixes #9485
2026-03-18 22:08:24 +01:00
Thomas Waldmann 67d79a51ee hashindex: check values in read HashHeader 2026-03-18 19:40:05 +01:00
TW 951e5849f3 Merge pull request #9500 from ThomasWaldmann/hashindex-memleak-1.1
hashindex: fix memory leak, fixes #9497
2026-03-18 18:57:04 +01:00
Thomas Waldmann b9aaf24949 hashindex: fix memory leak, fixes #9497
Thanks to @rolandrc for finding and fixing this!

Also: set index->buckets = NULL to indicate "we are finished with this" and avoid use-after-free.
2026-03-18 17:49:47 +01:00
TW dd7111410f Merge pull request #7942 from ThomasWaldmann/lockroster-remove-fix-1.1
LockRoster.modify: no KeyError if element was already gone, fixes #7937
2023-11-18 18:22:52 +01:00
Thomas Waldmann d4833bfc4c LockRoster.modify: no KeyError if element was already gone, fixes #7937
The intention of LockRoster.modify(key, REMOVE) is to remove self.id.

Using set.discard will just ignore it if self.id is not present there anymore.

Previously, using set.remove triggered a KeyError that has been frequently
seen in tracebacks of teardowns involving Repository.__del__ and Repository.__exit__.

I added a REMOVE2 op to serve one caller that needs to get the KeyError if
self.id was not present.

Thanks to @herrmanntom for the workaround!
2023-11-18 17:41:57 +01:00
TW e6d40f63d4 Merge pull request #7814 from ThomasWaldmann/tam-fixes-1.1
TAM / security fixes (1.1-maint backport)
2023-09-12 14:15:56 +02:00
Thomas Waldmann 73f7e67093 add CVE-2023-36811 related upgrade notes 2023-09-08 17:59:53 +02:00
Thomas Waldmann e0542077b0 check: improve logging for TAM issues, fixes #7797 2023-09-08 17:59:51 +02:00
Thomas Waldmann 5b2d47113b implement BORG_WORKAROUNDS=ignore_invalid_archive_tam, see #7791 2023-09-08 17:59:50 +02:00
Thomas Waldmann 44c17e3fc2 add tests for archive TAMs, upgrade 2023-09-08 17:59:48 +02:00
Thomas Waldmann ead49d4a24 rebuild_refcounts: keep archive ID, if possible
rebuild_refcounts verifies and recreates the TAM.
Now it re-uses the salt, so that the archive ID does not change
just because of a new salt if the archive has still the same data.
2023-09-08 17:59:47 +02:00
Thomas Waldmann 2095225a3c TAM msgs: be more specific: archives vs. manifest 2023-09-08 17:59:45 +02:00
Thomas Waldmann 35e34597f4 upgrade: allow enable/disable manifest TAM for unencrypted repos
Recent borg wrote TAM authenticated **archives**
even for unencrypted repos (encryption "none"),
so we also do that for the manifest.

It's kind of fake as there is no secret key involved then,
but it simplifies the code.
2023-09-08 17:59:44 +02:00
Thomas Waldmann 005662a8fe upgrade --archives-tam: make sure all archives are TAM authenticated
borg check (rebuild_manifest and rebuild_refcounts) drops archives without TAM,
so let's just always add the TAM.

for unencrypted repos (encryption=none) the TAM is insecure,
but without encryption and authentication, there is no expectation
of security anyway.
2023-09-08 17:59:42 +02:00
Thomas Waldmann c58228c2c7 list: support {tam} placeholder. check archive TAM.
list: shows either "verified" or "none", depending on
whether a TAM auth tag could be verified or was
missing (old archives from borg < 1.0.9).

when loading an archive, we now try to verify the archive
TAM, but we do not require it. people might still have
old archives in their repos and we want to be able to
list such repos without fatal exceptions.
2023-09-08 17:48:06 +02:00
Thomas Waldmann 73eae8cc8b cache sync: check archive TAM 2023-09-08 17:48:05 +02:00
Thomas Waldmann 52483b26d0 check: rebuild_refcounts verify and recreate TAM
This part of the archive checker recreates the Archive
items (always, just in case some missing chunks needed
repairing).

When loading the Archive item, we now verify the TAM.
When saving the (potentially modified) Archive item,
we now (re-)generate the TAM.

Archives without a valid TAM are dropped rather than TAM-authenticated
when saving them. There shouldn't be any archives without a valid TAM:

- borg writes an archive TAM since long (1.0.9)
- users are expected to TAM-authenticate archives created
  by older borg when upgrading.

Also:

Archive.set_meta: TAM-authenticate new archive

This is also used by Archive.rename and .recreate.
2023-09-08 17:48:03 +02:00
Thomas Waldmann d2f653e816 check: rebuild_manifest must verify archive TAM 2023-09-08 17:48:01 +02:00
Thomas Waldmann df753c0312 BORG_WORKAROUNDS=authenticated_no_key to extract from authenticated repos without key, fixes #7700 2023-09-08 15:33:32 +02:00
TW b63fdac2f8 Merge pull request #7372 from ThomasWaldmann/fix-compression-tests2-1.1
"auto" compressor tests: do not assume zlib is better than lz4, fixes #7363
2023-02-23 02:47:44 +01:00
Thomas Waldmann a6cd0fd2bf "auto" compressor tests: do not assume zlib is better than lz4, fixes #7363
while that might be true for many cases, we can not assume it is
always true, as proven by the failing test on S390.
2023-02-23 02:30:52 +01:00
TW 10208d880d Merge pull request #7364 from ThomasWaldmann/fix-compression-tests-1.1
"auto" compressor tests: don't assume a specific size, fixes #7363
2023-02-18 14:36:50 +01:00
Thomas Waldmann 8916b5a7da use requirements.d/development.lock.txt
something is not working correctly any more when using the latest stuff.

considering this branch is EOL anyway, this is the easy fix.
2023-02-18 14:24:01 +01:00
Thomas Waldmann 793104ff13 "auto" compressor tests: don't assume a specific size, fixes #7363
The tests assumed a specific compressed results size, which
is bad, because it might vary depending on the zlib implementation.

Now the "auto" compressor tests just check if it is the same size
as when unconditionally using the zlib compressor.
2023-02-18 13:57:57 +01:00
TW 9ad9d4b96a Merge pull request #7181 from klemensn/1.1-maint
Fix msgpack runtime on big-endian OpenBSD/sparc64
2022-12-04 14:22:27 +01:00
Klemens Nanni 9d5631f834 Bump msgpack to +borg2 after build fix backports 2022-12-04 03:46:40 +04:00
Inada Naoki 04d2f7ed85 Fix build error caused by ntohs, ntohl 2022-12-04 03:41:27 +04:00
Jakub Kulík 63beb57b9f additional cleanup 2022-12-03 01:25:22 +04:00
Jakub Kulík deb7fa067c simplify the endianity handling 2022-12-03 01:25:22 +04:00
Jakub Kulík 6448b656c7 Fallback to compiler defines when __BYTE_ORDER is not available 2022-12-03 01:25:22 +04:00
TW 9e22b27dad Merge pull request #6940 from ThomasWaldmann/mkstemp_mode-1.1
use a custom mkstemp with mode support, fixes #6933, fixes #6400
2022-08-05 14:20:02 +02:00
Thomas Waldmann 324a1f852b mkstemp_mode: adapt for python 3.5 (no sys.audit) 2022-08-05 14:05:59 +02:00
Thomas Waldmann bf0edc5e8a use a custom mkstemp with mode support, fixes #6933, fixes #6400
hopefully this is the final fix.

after first fixing of #6400 (by using os.umask after mkstemp), there
was a new problem that chmod was not supported on some fs.

even after fixing that, there were other issues, see the ACLs issue
documented in #6933.

the root cause of all this is tempfile.mkstemp internally using a
very secure, but hardcoded and for our use case problematic mode
of 0o600.

mkstemp_mode (mosty copy&paste from python stdlib tempfile module +
"black" formatting applied) supports giving the mode via the api,
that is the only change needed.

slightly dirty due to the _xxx imports from tempfile, but hopefully
this will be supported in some future python version.
2022-08-05 13:11:29 +02:00
TW 6e53502cd8 Merge pull request #6906 from ThomasWaldmann/fix-flags-formatting-1.1
list: fix {flags:<WIDTH>} formatting, fixes #6081
2022-07-30 15:32:57 +02:00
TW 151b245863 Merge pull request #6902 from ThomasWaldmann/fix-5719-1.1
check: try harder to create the key, fixes #5719
2022-07-30 15:30:02 +02:00
Thomas Waldmann d3c22a7b86 list: fix {flags:<WIDTH>} formatting, fixes #6081
item.bsdflags is either not present or an int, thus we default to 0 (== no flags) if not present.
2022-07-29 10:41:05 +02:00
Thomas Waldmann 2bbed67007 check: try harder to create the key, fixes #5719
the old code did just 1 attempt to detect the repo decryption key.
if the first chunkid we got from the chunks hashtable iterator was accidentally
the id of the chunk we intentionally corrupted in test_delete_double_force,
setup of the key failed and that made the test crash.

in practice, this could of course also happen if chunks are corrupted, thus
we now do many retries with other chunks before giving up.

error handling was improved: do not return None (instead of a key), it just
leads to weird crashes elsewhere, but fail early with IntegrityError and a
reasonable error msg.

rename method to make_key to avoid confusion with borg.crypto.key.identify_key.
2022-07-29 09:28:57 +02:00