Commit graph

1035 commits

Author SHA1 Message Date
Gianfranco Costamagna
0980d6ac43 fixup allows one to, with suggestions from Dan Christensen 2018-01-03 15:54:52 +01:00
Gianfranco Costamagna
111a19f7fa fix typo: allows to -> allows one to 2018-01-03 11:42:38 +01:00
Gianfranco Costamagna
1a74326b5a borg: fix typo: explicitely -> explicitly 2018-01-03 11:42:30 +01:00
Abogical
7638085b28 Revert copyright year change in shellpattern 2018-01-02 16:59:01 +02:00
Josh Holland
9f400633f2 Correct some confusing error messages from borg init (#3485)
init: more clear exception messages for borg create, fixes #3465

also: refactor
2017-12-29 01:15:07 +01:00
Thomas Waldmann
9b0d0f3127 use patched version of socket.getfqdn(), fixes #3471 2017-12-24 04:46:20 +01:00
Thomas Waldmann
5e4df7782b refactor/move hostname/fqdn related funcs, see #3471
- move stuff to platform.base (should be platform independent according
  to the docs).
- bump platform API version
- parseformat: import fqdn from platform instead of recomputing it

This is not yet fixing #3471, just a preparation for it.
2017-12-24 04:12:02 +01:00
Thomas Waldmann
c5a339384e added BORG_BASE_DIR, s/get_home_dir/get_base_dir/g, docs, fixes #3338
also: sorted env var docs by level
2017-12-23 01:42:18 +01:00
TW
ec8a8c0729
Merge pull request #3475 from ThomasWaldmann/fix-borg-init-quota
borg init: use given --storage-quota for local repo, fixes #3470
2017-12-23 01:18:33 +01:00
Thomas Waldmann
d1cdc1451f borg init: use given --storage-quota for local repo, fixes #3470 2017-12-22 23:50:00 +01:00
Josh Holland
e780660830
Properly quote repo path in borg init output
Instead of printing this invalid command:

    borg upgrade --disable-tam '/path/test'repo'

print this valid one:

    borg upgrade --disable-tam '/path/test'"'"'repo'
2017-12-22 21:26:17 +00:00
Thomas Waldmann
3d32407e9a add zstd to compression help 2017-12-18 23:21:34 +01:00
TW
b627944d90
Merge pull request #3451 from ThomasWaldmann/blake2-ext-building
crypto.low_level ext building (blake2 part)
2017-12-18 04:21:48 +01:00
TW
1e9c90da2a
Merge pull request #3450 from ThomasWaldmann/borg-delete-removing-security-dir
also delete security dir when deleting a repo, fixes #3427
2017-12-18 01:15:29 +01:00
Thomas Waldmann
4a2fec32b6 crypto.low_level extension: build blake2 like zstd, see #3415 2017-12-18 01:06:30 +01:00
Thomas Waldmann
b56f6cdbc0 update blake2 reference impl file (cosmetic)
only whitespace changes.
2017-12-18 01:06:30 +01:00
Thomas Waldmann
8924d78d44 move blake2 files to subdir ref/ (as seen in orig. repo) 2017-12-18 01:06:30 +01:00
TW
55ca8a9815
Merge pull request #3443 from ThomasWaldmann/lz4-ext-building
compress ext building (lz4 part)
2017-12-18 00:55:23 +01:00
Thomas Waldmann
fe48caf853 fix lz4 deprecation warning, require lz4 >= 1.7.0 (r129)
as we bundle lz4 1.8.0 now, platform not having a recent liblz4 can
now just use the bundled code.
2017-12-18 00:53:26 +01:00
Thomas Waldmann
73a70082c2 compress extension: build lz4 like zstd, see #3415 2017-12-18 00:53:26 +01:00
Thomas Waldmann
8f772437f2 also delete security dir when deleting a repo, fixes #3427 2017-12-16 22:59:47 +01:00
Thomas Waldmann
57a2d920cb check --repair: fix malfunctioning validator, fixes #3444
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)
2017-12-16 21:44:35 +01:00
Thomas Waldmann
0abf42f29e modify borg check unit test so it "hangs", see #3444
it doesn't infinitely hang, but slows down considerably.

(cherry picked from commit a68d28bfa4)
2017-12-16 21:44:10 +01:00
Thomas Waldmann
c8b2820225 bundle lz4 1.8.0 src code, license 2017-12-15 06:33:04 +01:00
TW
e203b8739b
Merge pull request #3411 from ThomasWaldmann/zstd
add zstd compression
2017-12-15 01:55:20 +01:00
Thomas Waldmann
34b92ffdaa support code to build bundled zstd code into the compress extension
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
2017-12-15 00:29:26 +01:00
Thomas Waldmann
dc883f62ae bundle zstd 1.3.2 source code
only .c and .h files + license
2017-12-15 00:29:26 +01:00
Thomas Waldmann
aec36f64a2 zstd: use own Cython-based binding, remove python-zstandard dep
currently requires an externally available libzstd >= 1.3.0,
no bundled zstd yet.
2017-12-15 00:29:26 +01:00
Thomas Waldmann
11b2311e6e add zstd compression
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
2017-12-15 00:29:26 +01:00
Thomas Waldmann
a3cecf599f add parens for C preprocessor macro argument usages
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.
2017-12-13 04:01:59 +01:00
TW
f99785a00d
Merge pull request #3088 from n-st/list-help-topics
List help topics when invalid topic is requested
2017-12-13 02:54:45 +01:00
Gregor Kleen
294f06b565 Refactor: call getfqdn() once per call of replace_placeholders() 2017-12-12 12:44:17 +01:00
Gregor Kleen
85fb38e2f3 Add placeholder for fqdn in reverse notation 2017-12-11 23:00:38 +01:00
Thomas Waldmann
5cf48eeb16 borg mount: fix hardlink processing, fixes #3388
when the result list after stripping was empty,
os.path.join(*emptylist) fails as it want 1+ args.

(cherry picked from commit dc8de36109)
2017-12-02 18:13:11 +01:00
Thomas Waldmann
4fcb413802 crc32-slice-by-8.c: fix for C90 compilers
crc32_slice_by_8.c:344:3: error: ISO C90 forbids mixed declarations
and code [-Werror=declaration-after-statement]

(cherry picked from commit 23a1d62b25)
2017-12-02 18:13:11 +01:00
Thomas Waldmann
209bf2dc24 move 3rd party docs/license file from package dir to docs/3rd_party
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)
2017-12-02 18:13:11 +01:00
Thomas Waldmann
75854c1243 security: fix enforcement of --restrict-to-path in args processing
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)
2017-12-02 18:13:11 +01:00
TW
c312a9a95b
Merge pull request #3377 from milkey-mouse/fix-build-man
Fix build_man issues
2017-11-26 04:09:03 +01:00
Milkey Mouse
2a83098fac
Fix build_man issues (fixes #3364) 2017-11-25 19:03:00 -08:00
TW
c848141f06
Merge pull request #3375 from ThomasWaldmann/docs-fixes
misc. docs fixes / updates
2017-11-26 03:58:01 +01:00
TW
6b5b4e476b
Merge pull request #3376 from milkey-mouse/borg-config-cmd
Reword borg config help
2017-11-26 02:07:33 +01:00
Milkey Mouse
f44335f91d
Reword basic borg config help
It doesn't edit the repo config, but any borg-related config.
2017-11-25 16:02:38 -08:00
Thomas Waldmann
91ff2f81a6 docs: move bsdflags tuning comments to notes docs section
the atime comments are already there.
2017-11-25 20:08:33 +01:00
Thomas Waldmann
520a6a2ef1 docs: point out tuning options for borg create, fixes #3239 2017-11-25 15:21:43 +01:00
TW
c5dc75ae23
Merge pull request #3312 from milkey-mouse/borg-config-cmd
Add borg config command
2017-11-24 16:56:15 +01:00
Milkey Mouse
1e520203cb
Fix borg config flake8 failures
Suppressed E731 so lambdas can be assigned to vars
2017-11-23 14:54:53 -08:00
Milkey Mouse
5b47cf6fa5
Add borg config command (fixes #3304)
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.
2017-11-23 14:51:54 -08:00
TW
afc84cafd4
Merge pull request #3300 from ThomasWaldmann/mount-options
borg mount: support exclusion group options and paths, fixes #2138
2017-11-23 22:43:39 +01:00
Milkey Mouse
d1e327914b Clarify key aliases for borg list --format (#3346)
clarify key aliases for borg list --format, fixes #3111
2017-11-22 17:25:49 +01:00
Thomas Waldmann
caece370b8 borg mount: support --consider-part-files correctly, fixes #3347 2017-11-22 15:08:08 +01:00