Commit Graph

6130 Commits

Author SHA1 Message Date
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
TW 8011832b28
Merge pull request #6897 from ThomasWaldmann/ci-macos-1.1
CI: test on macOS 11 without fuse / fuse tests
2022-07-28 00:10:14 +02:00
Thomas Waldmann c08da0407f CI: test on macOS 11 without fuse / fuse tests
too troublesome on github CI due to kernel extensions needed by macFUSE.
2022-07-27 23:33:38 +02:00
TW c03f2418cf
Merge pull request #6891 from ThomasWaldmann/archive-progress-json-docs-1.1
docs: update archive_progress json description about "finished"
2022-07-27 12:46:48 +02:00
Thomas Waldmann 6655d7c736 docs: update archive_progress json description about "finished", see #6570 2022-07-25 13:06:48 +02:00
TW 85f8acdb7b
Merge pull request #6826 from ThomasWaldmann/fix-progress-percent-docs-1.1
docs: json progress_percent: some values are optional, fixes #4074
2022-07-02 20:21:14 +02:00
Thomas Waldmann 7b908b5473 docs: json progress_percent: some values are optional, fixes #4074
in the finished == true message, these are missing:
- message
- current / total
- info

This is to be somewhat consistent with #6683 by only providing a
minimal set of values for the finished case.

The finished messages is primarily intended for cleanup purposes,
e.g. clearing the progress display.
2022-07-01 14:36:25 +02:00
TW 7a29c11aa2
Merge pull request #6817 from ThomasWaldmann/fix-hashindex-compact-1.1
hashindex_compact: fix eval order (check idx before use), fixes #5899
2022-06-30 20:57:26 +02:00
Thomas Waldmann 0cfb355e1f hashindex_compact: fix eval order (check idx before use), fixes #5899
also: fix "off by one" comment
2022-06-29 20:09:36 +02:00
TW 53b6d14cb4
Merge pull request #6771 from ThomasWaldmann/safe-secure-erase-1.1
secure_erase: avoid collateral damage, fixes #6768
2022-06-13 19:41:13 +02:00
Thomas Waldmann b359536807 secure_erase: avoid collateral damage, fixes #6768
if a hardlink copy of a repo was made and a new repo config
shall be saved, do NOT fill in random garbage before deleting
the previous repo config, because that would damage the hardlink
copy.
2022-06-13 16:01:47 +02:00
TW 910a50c369
Merge pull request #6746 from ThomasWaldmann/rel1118
release 1.1.18
2022-06-05 16:42:39 +02:00
Thomas Waldmann c2a33e6d9e update CHANGES 2022-06-05 14:21:54 +02:00
Thomas Waldmann 71e9bd22bf xxhash: do no longer depend on <assert.h> for XXH_STATIC_ASSERT
https://github.com/Cyan4973/xxHash/pull/670

this fixes building borgbackup on FreeBSD 12.x (when using the
bundled xxhash code). otherwise i got "undefined symbol static_assert".
2022-06-05 14:17:17 +02:00
Thomas Waldmann f70cf3d591 requirements.lock.txt: use the latest cython release 2022-06-05 10:21:17 +02:00
Thomas Waldmann 01318a55df vagrant: use the generic/openbsd6 box 2022-06-05 10:21:17 +02:00
Thomas Waldmann dc1eed3544 vagrant: use python 3.7.12 for the binary builds
3.7.13 did not build on freebsd, patches rejected.
2022-06-05 10:21:17 +02:00