Instead of printing this invalid command:
borg upgrade --disable-tam '/path/test'repo'
print this valid one:
borg upgrade --disable-tam '/path/test'"'"'repo'
the major problem was the ('path' in item) expression.
the dict has bytes-typed keys there, so it never succeeded as it
looked for a str key. this is a 1.1 regression, 1.0 was fine.
the dict -> StableDict change is just for being more specific,
the check triggered correctly as StableDict subclasses dict,
it was just a bit too general.
(cherry picked from commit e09892caec)
setup_zstd.py modified so it is just amending the Extension() kwargs,
but the Extension is initialized by the caller.
this way, amending can happend multiple times (e.g. for multiple
compression algorithms).
also:
- move include/library dirs processing for system-library case
- move system zstd prefix detection to setup_zstd module
- cosmetic: setup.py whitespace fixes
- prefer system zstd option, document zstd min. requirement
based on willyvmm's work in PR #3116, but some changes:
- removed any mulithreading changes
- add zstandard in setup.py install_requires
- tests
- fix: minimum compression level is 1 (not 0)
- use 3 for the default compression level
- use ID 03 00 for zstd
- only convert to bytes if we don't have bytes yet
- move zstd code so that code blocks are ordered by ID
- other cosmetic fixes
this is needed for correctness because the preprocessor is just
doing text replacement.
This is the correct way:
#define MUL(x, y) ((x) * (y))
MUL(1+2, 3-4) -> ((1+2) * (3-4)) # not: (1+2 * 3-4)
I didn't put parens around all arg usages for readability.
Some stuff (like index) is not expected to be an expression.
Also, when a arg is only used in another macro or function call,
no parens are needed either.
I reviewed the code: no harm was done (yet) due to this fault.
Thanks to @rciorba who found this.
crc32_slice_by_8.c:344:3: error: ISO C90 forbids mixed declarations
and code [-Werror=declaration-after-statement]
(cherry picked from commit 23a1d62b25)
setup.py excludes all .c .h .pyx files from installation, but such
docs / license files would still be copied to the target directory
if they are inside the python "borg" package dir.
(cherry picked from commit 831a06a07d)
Fixes CVE-2017-15914 (affects releases 1.1.0, 1.1.1, 1.1.2,
but not 1.0.x).
Thanks to Florian Apolloner for discovering/reporting this!
Also: added tests for this.
(cherry picked from commit ea0203bb0d)