Commit Graph

6793 Commits

Author SHA1 Message Date
James Buren 596e33b68d properly suppress -Wimplicit-fallthrough
It turns out that explaining the comment actually breaks its
intended usage.
2022-03-09 05:00:56 -06:00
Manu dd1023df44 Add discussion and note on file attrs. 2022-03-09 14:06:40 +04:00
TW 9a8fb9c902
Merge pull request #6422 from ThomasWaldmann/fix-cython-warnings-master
fix "useless trailing comma" cython warnings
2022-03-08 21:58:02 +01:00
Thomas Waldmann f0bf5915c5 fix "useless trailing comma" cython warnings 2022-03-08 21:15:24 +01:00
TW a82673e708
Merge pull request #6416 from hexagonrecursion/unicode
Fix compilation warnings: ‘PyUnicode_AsUnicode’ is deprecated
2022-03-07 19:36:22 +01:00
Andrey Bienkowski f75a6152ab ‘PyUnicode_AsUnicode’ is deprecated
Fix compilation warnings:
```
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/opt/hostedtoolcache/Python/3.9.10/x64/include/python3.9 -c src/borg/platform/posix.c -o build/temp.linux-x86_64-3.9/src/borg/platform/posix.o
src/borg/platform/posix.c: In function ‘__pyx_pf_4borg_8platform_5posix_2swidth’:
src/borg/platform/posix.c:1572:3: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]
 1572 |   __pyx_t_2 = __Pyx_PyUnicode_AsUnicode(__pyx_v_s); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 19, __pyx_L1_error)
      |   ^~~~~~~~~
In file included from /opt/hostedtoolcache/Python/3.9.10/x64/include/python3.9/unicodeobject.h:1026,
                 from /opt/hostedtoolcache/Python/3.9.10/x64/include/python3.9/Python.h:93,
                 from src/borg/platform/posix.c:19:
/opt/hostedtoolcache/Python/3.9.10/x64/include/python3.9/cpython/unicodeobject.h:580:45: note: declared here
  580 | Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
      |                                             ^~~~~~~~~~~~~~~~~~~
```

Ref: https://docs.python.org/3/c-api/unicode.html#c.PyUnicode_AsUnicode
2022-03-07 10:36:22 +03:00
TW 0714339d3f
Merge pull request #6412 from ThomasWaldmann/remove-passphrasekey
remove PassphraseKey code and borg key migrate-to-repokey command
2022-03-06 15:51:06 +01:00
Thomas Waldmann 37f237d3e0 remove PassphraseKey code and borg key migrate-to-repokey command
"passphrase" encryption mode repos can not be created since borg 1.0.
back then, users were advised to switch existing repos of that type
to repokey mode using the "borg key migrate-to-repokey" command.
that command is still available in borg 1.0, 1.1 and 1.2, but not
any more in borg >= 1.3.

while we still might see the PassphraseKey.TYPE byte in old repos,
it is handled by the RepoKey code since borg 1.0.
2022-03-06 15:26:18 +01:00
TW e4e243be0b
Merge pull request #6408 from ThomasWaldmann/hmac-digest-master
hmac and blake2b minor optimizations and cleanups
2022-03-06 01:32:30 +01:00
TW b3c4cee8f9
Merge pull request #6409 from ThomasWaldmann/fix-codeql-master
fix codeql complaining about missing headers needed by borg
2022-03-06 00:20:26 +01:00
TW a457e90a95
Merge pull request #6411 from aspargas2/master
Forward port: import-tar fixes
2022-03-06 00:18:43 +01:00
Thomas Waldmann 862eefb96d fixup: fix SELFTEST_COUNT 2022-03-05 22:26:04 +01:00
Thomas Waldmann 83deedb13a kill filter process in case of borg exceptions, fixes #6401
in the finally-block, we wait for the filter process to die. but it only dies
voluntarily if all data was processed by the filter and it terminates due to EOF.

otoh, if borg has thrown an early exception, e.g. "archive already exists",
we need to kill the filter process to bring it to an early end. in that
case, we also do not need to check the filter rc, because we know we killed it.
2022-03-05 16:25:10 -05:00
Thomas Waldmann 2bcee08b88 import-tar: fix mtime type bug
looks like with a .tar file created by the tar tool,
tarinfo.mtime is a float [s]. So, after converting to
nanoseconds, we need to cast to int because that's what
Item.mtime wants.

also added a safe_ns() there to clip values to the safe range.
2022-03-05 16:24:59 -05:00
TW d18d1370ac
Merge pull request #6410 from ThomasWaldmann/remove-stretch64-vm
vagrant: remove debian stretch VM, not supported any more
2022-03-05 22:19:16 +01:00
Thomas Waldmann 2cad8c925d fix codeql complaining about missing headers needed by borg
thus:
- install requirements first
- codeql init
- build borg
- codeql analyzse
2022-03-05 22:17:44 +01:00
Thomas Waldmann fc67453bf3 vagrant: remove debian stretch VM, not supported any more 2022-03-05 22:09:41 +01:00
Thomas Waldmann 41536f9f79 fixup: remove now unused import 2022-03-05 21:55:23 +01:00
Thomas Waldmann c5540229c4 remove the blake2b compat checker script
this was used to compare compatibility of our vendored
blake2b code (which we do not have any more) against the
python stdlib blake2b code (which we always use now anyway).
2022-03-05 21:51:50 +01:00
Thomas Waldmann 07159342ba remove our blake2b_128/256 tests
as we're just calling python stdlib there,
we can assume that they have tests for it.
2022-03-05 21:47:40 +01:00
Thomas Waldmann 2566671d85 remove our hmac_sha256 tests
as we're just calling python stdlib there,
we can assume that they have tests for it.
2022-03-05 21:37:31 +01:00
Thomas Waldmann c63bd36a6c hmac.digest: some more minor optimizations
also some cosmetic changes:
- import hmac module
- use hmac.compare_digest
2022-03-05 21:29:42 +01:00
Thomas Waldmann 8317698f9b hmac_sha256: replace own cython wrapper code by hmac.digest python stdlib (since py38)
i measured performance of both: pretty much the same.
2022-03-05 21:22:24 +01:00
TW 34261aac0e
Merge pull request #6378 from braewoods/warnings
suppress -Wimplicit-fallthrough warning
2022-03-05 14:20:24 +01:00
TW 47a9e4686b
Merge pull request #6377 from ThomasWaldmann/fix-6374-master
create: skip with warning if opening the parent dir of recursion root fails, fixes #6374
2022-03-05 14:18:57 +01:00
TW e37a55c5eb
Merge pull request #6355 from hexagonrecursion/pyproject
Add pyproject.toml
2022-03-01 14:02:34 +01:00
Andrey Bienkowski aba16ba0d4 CodeQL: Use venv
A bug in pip or possibly setuptools broke editable
installs into the per-user directory
for packages that have pyproject.toml

See https://github.com/pypa/setuptools/issues/3019
2022-03-01 08:44:40 +03:00
Andrey Bienkowski a929b2db0a Merge remote-tracking branch 'origin/master' into pyproject 2022-03-01 08:43:36 +03:00
James Buren 4a55d9de3c suppress -Wimplicit-fallthrough warning
These instances of implicit switch case fallthrough appear to be
intentional. Add comments that the compiler understands to suppress
the false positive warning.
2022-02-27 14:29:53 -06:00
TW 49de070799
Merge pull request #6382 from ThomasWaldmann/pyupgrade-38-master
run pyupgrade (py38+)
2022-02-27 21:07:41 +01:00
Thomas Waldmann fade3c4799 manual formatting fixes (cosmetic / pep8) 2022-02-27 20:12:04 +01:00
Thomas Waldmann cbeef56454 pyupgrade --py38-plus ./**/*.py 2022-02-27 20:11:56 +01:00
TW d1bcea9e61
Merge pull request #6363 from ThomasWaldmann/require-py39
require python >= 3.9, fixes #6315
2022-02-27 19:13:05 +01:00
Thomas Waldmann 64e7ccd3fc require python >= 3.9, fixes #6315 2022-02-27 18:46:30 +01:00
TW e8b2ca8b20
Merge pull request #6372 from ThomasWaldmann/unbundle-3rd-party
Unbundle most 3rd party code
2022-02-27 18:41:22 +01:00
Thomas Waldmann 8375d44328 create: skip with warning if opening the parent dir of recursion root fails, fixes #6374 2022-02-27 02:52:03 +01:00
Thomas Waldmann b755f47775 vagrant: add required system libs (esp. xxhash) 2022-02-26 23:26:17 +01:00
Thomas Waldmann 9b872104da setup_crypto: remove unused function 2022-02-26 23:10:27 +01:00
TW 52f9bc926d
Merge pull request #6368 from braewoods/warnings
fix multiple warnings related to _hashindex.c
2022-02-26 23:03:38 +01:00
TW 1dca742494
Merge pull request #6370 from bket/fix_build_libressl
Fix build with LibreSSL
2022-02-26 23:02:59 +01:00
Thomas Waldmann 606ba08587 fix ci: we need xxhash system lib on macOS
also: we do not need libb2 (directly) any more, this is provided indirectly via python3 now
2022-02-26 22:40:16 +01:00
Thomas Waldmann 64e02887c0 fix codeql: borg needs required libs/headers now
nothing bundled any more.
2022-02-26 22:35:47 +01:00
Thomas Waldmann 80c21b2e23 remove docs of previously bundled blake2 code 2022-02-26 22:22:02 +01:00
Thomas Waldmann 96d93dcf0e do not support bundled 3rd party code any more, fixes #6316 2022-02-26 22:18:12 +01:00
Björn Ketelaars 73c426497f Fix build with LibreSSL
#6338 introduces regression when building with LibreSSL (3.5.0).

```
cc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -O2 -pipe -g -fPIC -O2 -pipe -g -O2 -pipe -g -O2 -pipe -fPIC -Isrc/borg/crypto -I/usr/local/include/python3.9 -c src/borg/crypto/low_level.c -o /tmp/ports/pobj/borgbackup-1.2.1/borg-eec359cf228caf00d9c72bde07bf939872e9d3fa/temp.openbsd-7.1-amd64-3.9/src/borg/crypto/low_level.o
src/borg/crypto/low_level.c:12439:48: error: use of undeclared identifier 'EVP_chacha20_poly1305'; did you mean 'EVP_aead_chacha20_poly1305'?
  __pyx_v_self->__pyx_base.__pyx_base.cipher = EVP_chacha20_poly1305;
                                               ^~~~~~~~~~~~~~~~~~~~~
                                               EVP_aead_chacha20_poly1305
/usr/include/openssl/evp.h:1161:17: note: 'EVP_aead_chacha20_poly1305' declared here
const EVP_AEAD *EVP_aead_chacha20_poly1305(void);
                ^
1 error generated.
```

Unfortunately `EVP_aead_chacha20_poly1305`, offered by LibreSSL, is not
a drop in replacement for `EVP_chacha20_poly1305`. More info on the
first can be found at https://man.openbsd.org/EVP_AEAD_CTX_init.3.
2022-02-26 22:03:00 +01:00
Thomas Waldmann 159bd06412 unbundle xxh64 3rd party code, see #6316 2022-02-26 21:37:34 +01:00
Thomas Waldmann ecd0865d9c unbundle zstd 3rd party code, see #6316 2022-02-26 21:36:30 +01:00
Thomas Waldmann 7c8f288a18 unbundle lz4 3rd party code, see #6316 2022-02-26 21:35:17 +01:00
James Buren 5c94c932bb src/borg/cache_sync/unpack.h: fix compiler warnings
The key argument being sent to hashindex_get and hashindex_set by
multiple functions is a different signedness from what the functions
expect. This resolves the issue by changing the key type in the
unpack_user struct to unsigned char.
2022-02-26 14:02:29 -06:00
James Buren 5f3d61e2f0 src/borg/_hashindex.c: fix compiler warnings
The value argument of hashindex_set is causing harmless pointer type
mismatches. This resolves the issue by changing the type to void*
which silences these types of warnings.
2022-02-26 14:02:29 -06:00