Commit graph

935 commits

Author SHA1 Message Date
Nils Steinger
00865ae89e List help topics when invalid topic is requested
(cherry picked from commit 9e81a76172)
2017-12-15 00:58:29 +01:00
Gregor Kleen
96675e06c8 Refactor: call getfqdn() once per call of replace_placeholders()
(cherry picked from commit 294f06b565)
2017-12-15 00:56:43 +01:00
Gregor Kleen
dbf8d582f9 Add placeholder for fqdn in reverse notation
(cherry picked from commit 85fb38e2f3)
2017-12-15 00:56:31 +01:00
Thomas Waldmann
981a936f47 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.

(cherry picked from commit a3cecf599f)
2017-12-15 00:50:06 +01:00
Thomas Waldmann
dc8de36109 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.
2017-11-27 04:10:17 +01:00
Thomas Waldmann
23a1d62b25 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]
2017-11-27 01:01:34 +01:00
Thomas Waldmann
831a06a07d 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.
2017-11-27 00:02:37 +01:00
Thomas Waldmann
ea0203bb0d 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.
2017-11-27 00:02:36 +01:00
Milkey Mouse
248c408b5b
Fix build_man issues (fixes #3364) 2017-11-25 19:38:23 -08:00
Thomas Waldmann
ef39dc6554 docs: move bsdflags tuning comments to notes docs section
the atime comments are already there.

(cherry picked from commit 91ff2f81a6)
2017-11-26 04:04:20 +01:00
TW
26cfaf3681
Merge pull request #3359 from milkey-mouse/borg-config-cmd-bp1.1
Add borg config command (1.1 backport)
2017-11-26 03:56:01 +01:00
Milkey Mouse
5331b378f7
fixup! Add borg config command (fixes #3304)
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.
2017-11-25 15:58:08 -08:00
Thomas Waldmann
3bdf1193ad docs: point out tuning options for borg create, fixes #3239
(cherry picked from commit 520a6a2ef1)
2017-11-25 15:25:15 +01:00
Milkey Mouse
15d9c94981
Fix borg config flake8 failures
Suppressed E731 so lambdas can be assigned to vars
2017-11-24 16:39:27 -08:00
Milkey Mouse
2ac0bf4980
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-24 16:38:56 -08:00
Thomas Waldmann
47d16e0f62 borg mount: support --consider-part-files correctly, fixes #3347
(cherry picked from commit caece370b8)
2017-11-24 01:45:42 +01:00
Thomas Waldmann
0e07647576 borg mount: support hardlinks correctly, add tests
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)
2017-11-24 00:30:28 +01:00
Thomas Waldmann
52410b6976 borg mount: support exclusion group options and paths, fixes #2138
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)
2017-11-24 00:09:08 +01:00
Milkey Mouse
4dab6d29d8
Clarify key aliases for borg list --format (fixes #3111) 2017-11-22 21:18:21 -08:00
Aidan Woods
7fa5561cbc
Highlight that information is obtained from security dir
(deleting the cache will not bypass this error in the
event the user knows this is a legitimate repo).
2017-11-20 13:10:59 -08:00
Thomas Waldmann
3d3f3500f9 crc32: deal with unaligned buffer, tests, fixes #3317
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)
2017-11-14 15:33:28 +01:00
TW
9f9cb88a01
Merge pull request #3311 from milkey-mouse/borgfs-man-bp1.1
Generate usage & man page for borgfs (1.1-maint)
2017-11-14 00:28:59 +01:00
Sam H
e51cf43142 include item birthtime in archive (where available) (#3313)
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`.
2017-11-13 14:18:59 -05:00
Milkey Mouse
0ec703ff40
Check borgfs man formatting in tests
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.
2017-11-12 18:38:51 -08:00
Milkey Mouse
18b934496c
Don't show sub-command in borgfs help (fixes #3287) 2017-11-12 15:06:07 -08:00
TW
1201b62e2b
Merge pull request #3308 from milkey-mouse/no-dry-stats-bp1.1
Show an error when --dry-run & --stats are both used (1.1-maint)
2017-11-12 12:40:46 +01:00
TW
089b38b8e0
Merge pull request #3309 from milkey-mouse/key-export-docs-bp1.1
Clarify encryption of key for borg key export (1.1-maint)
2017-11-12 12:39:53 +01:00
Milkey Mouse
68bb3792fb
Clarify encrypted key format for borg key export (fixes #3296) 2017-11-10 11:48:17 -08:00
Milkey Mouse
31031e9578
Show an error when --dry-run & --stats are both used (fixes #3298) 2017-11-10 11:44:48 -08:00
Thomas Waldmann
304c9a1dc6 docs: borg does not respect nodump flag by default any more
(cherry picked from commit 7ddf7c451f)
2017-11-05 22:38:39 +01:00
Thomas Waldmann
e7ae63f1f6 clarify same-filesystem requirement for borg upgrade, fixes #2083
(cherry picked from commit fe746fa594)
2017-11-05 22:38:25 +01:00
Thomas Waldmann
ae09b1a5bc improve docs about --stats, fixes #3260
(cherry picked from commit dc68e8d1f0)
2017-11-05 22:37:39 +01:00
TW
baf9c65250
Merge pull request #3283 from ThomasWaldmann/fix-checkpoint-stats-1.1
stats: do not count data volume twice when checkpointing, fixes #3224
2017-11-05 02:40:00 +01:00
TW
5d4210ee7c
Merge pull request #3280 from ThomasWaldmann/fix-broken-pipe-handling-1.1
borg list: fix broken pipe handling, fixes #3245
2017-11-05 00:58:06 +01:00
Thomas Waldmann
49c4cbb93c stats: do not count data volume twice when checkpointing, fixes #3224
(cherry picked from commit 66cd1cd240)
2017-11-05 00:52:20 +01:00
TW
d50f5433ef
Merge pull request #3279 from ThomasWaldmann/fix-diff-options-1.1
borg diff: remove tag-file options, fixes #3226
2017-11-04 23:28:32 +01:00
Thomas Waldmann
936498065c borg list: fix broken pipe handling, fixes #3245
always use sys.stdout.write as in main() we have replaced that with a
handler that deals with BrokenPipe exceptions.

all the encode / decode dance was just to remove surrogates,
but that is not needed as format_item already does remove surrogates.

(cherry picked from commit 726ef118bc)
2017-11-04 23:21:12 +01:00
Thomas Waldmann
bdb3c0a38a borg diff: remove tag-file options, fixes #3226
they are not used for borg diff.

(cherry picked from commit 67f6aaa52b)
2017-11-04 22:48:29 +01:00
Thomas Waldmann
095a0b61da borg list: remove tag-file options, fixes #3226
they are not used for borg list.

(cherry picked from commit 702afa9e48)
2017-11-04 21:46:14 +01:00
TW
5680de537c
Merge pull request #3273 from ThomasWaldmann/set-bsdflags-last-1.1
set bsdflags last (include immutable flag), fixes #3263
2017-11-04 21:40:42 +01:00
Thomas Waldmann
28a25b354b recreate: move chunks_healthy when excluding hardlink master, fixes #3228
(cherry picked from commit 7aafcc517a)
2017-11-04 18:52:29 +01:00
Thomas Waldmann
b078991157 get rid of already existing invalid chunks_healthy metadata, see #3218
(cherry picked from commit 90186ad12b)
2017-11-04 18:52:13 +01:00
Thomas Waldmann
fe74b54890 get rid of chunks_healthy when rechunking, fixes #3218
(cherry picked from commit 7211bb2211)
2017-11-04 18:51:46 +01:00
Thomas Waldmann
5d71ae2f66 set bsdflags last (include immutable flag), fixes #3263
(cherry picked from commit 2c6f9634bc)
2017-11-04 18:30:16 +01:00
TW
b4267ba4a7
Merge pull request #3261 from ThomasWaldmann/stat-after-match-1.1
Stat after match (1.1-maint)
2017-11-04 14:58:10 +01:00
TW
299b9df057
Merge pull request #3247 from ThomasWaldmann/fix-old-server-hack-1.1
remove evil trailing comma, fixes #3244 (1.1)
2017-11-04 13:44:26 +01:00
Narendra Vardi
67e0fbb273 added unittest for get_config_dir function
(cherry picked from commit a3f1e6e250)
2017-11-03 18:38:21 +01:00
Narendra Vardi
60d2b9c193 add BORG_CONFIG_DIR env (#3083)
(cherry picked from commit 56fed4f964)
2017-11-03 18:37:56 +01:00
Thomas Waldmann
0943f2235e mention "!" (exclude-norecurse) type in patterns help
(cherry picked from commit 36f2a4e1dc)
2017-11-03 18:29:56 +01:00
Thomas Waldmann
338f56b97d don't do stat() when not recursing into excluded dir, fixes #3209
also: fix exception handling for the stat() calls

just moving all these lines into the "try"-block below (like it was in 1.0).

(cherry picked from commit 0c410e84fe)
2017-11-03 18:29:21 +01:00