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.
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
(cherry picked from commit 34b92ffdaa)
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
(cherry picked from commit 11b2311e6e)
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.
(cherry picked from commit a3cecf599f)
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.
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.
Don't use list unpacking for function calls in order to support py3.4
Reword basic borg config help
It doesn't edit the repo config, but any borg-related config.
This command works similarly to "git config" - it parses repo and
cache configs to get, set, and delete values. It only works on local
repos so a malicious client can't e.g. override their storage quota
or reset the append_only flag.
Add tests for borg config
Add documentation for borg config
Change manual config edits -> borg config
There were a couple places in the documentation where it was advised
to edit the repository or cache config file, a process that is stream-
lined by borg config.
previous commit did not yet support hardlinks correctly, if the
hardlink master was excluded somehow.
added some tests for this, also refactored related tests slightly.
(cherry picked from commit e97deafb16)
borg mount [options] repo_or_archive mountpoint path [paths...]
paths: you can just give some "root paths" (like for borg extract) to
only partially populate the FUSE filesystem.
Similar for these exclusion group options:
--exclude
--exclude-from
--pattern
--patterns-from
--strip-components
(cherry picked from commit 77df1cfe8c)
fixing only the (generic) slice-by-8 crc32 implementation,
it is assumed that CPUs supporting CLMUL can also efficiently
and correctly deal with unaligned accesses.
slice-by-8 is used e.g. on ARM cpus and they might not (efficiently)
support unaligned memory access, leading to bus errors or low
performance.
(cherry picked from commit f9cd6f7512)
include item birthtime in archive, fixes#3272
* use `safe_ns` when reading birthtime into attributes
* proper order for `birthtime` in `ITEM_KEYS` list
* use `bigint` wrapper for consistency
* Add tests to verify that birthtime is normally preserved, but not preserved when `--nobirthtime` is passed to `borg create`.
I only realized after the first PR was merged that the code used for
finding which man pages to generate was duplicated in the testsuite
(since setup.py can't import from the installed module and vice versa.)
These are essentially the same changes as made to setup.py in #3290.