Commit graph

167 commits

Author SHA1 Message Date
Thomas Waldmann
c021cf466a fuse: add test for hardlinks in versions view 2016-09-16 16:38:08 +02:00
Thomas Waldmann
001500ab99 fuse: refactor file versioning code 2016-09-16 16:38:08 +02:00
Thomas Waldmann
5d22078f35 fuse: add parameter check to ItemCache.get to make potential failures more clear 2016-09-16 16:38:08 +02:00
TW
783d01f621 Merge pull request #1586 from ThomasWaldmann/borg-check-delete-defect-chunks
borg check: delete chunks with integrity errors, fixes #1575
2016-09-14 22:55:50 +02:00
Thomas Waldmann
b4c7cce67d borg check: delete chunks with integrity errors, fixes #1575
so they can be "repaired" immediately and maybe healed later.
2016-09-14 21:07:48 +02:00
Thomas Waldmann
57a3adb6b3 borg recreate: also catch SIGHUP 2016-09-14 02:55:13 +02:00
Thomas Waldmann
1287d1ae92 Merge branch '1.0-maint' into merge-1.0-maint
# Conflicts:
#	docs/development.rst
#	src/borg/archive.py
#	src/borg/archiver.py
#	src/borg/hashindex.pyx
#	src/borg/testsuite/hashindex.py
2016-09-14 02:53:41 +02:00
Thomas Waldmann
dd89181062 fuse: refactor / optimize process_inner 2016-09-01 06:26:33 +02:00
Thomas Waldmann
6f50cc3413 fuse: simplify path segments loop 2016-09-01 05:18:10 +02:00
Thomas Waldmann
d64ccff1c4 fuse: remove unneeded function definition
code only had 1 caller, so just inline it.
2016-09-01 04:57:11 +02:00
Thomas Waldmann
34eb475463 fuse: remove unneeded safe_encode
fsencode will happen in _find_inode()
2016-09-01 04:33:42 +02:00
Thomas Waldmann
8b5372b54c fuse: slightly refactor shadowing detection
if it is not a directory, the old code was a NOP, so we can just check that first.
2016-09-01 04:30:55 +02:00
Thomas Waldmann
1f04820d9d fuse: implement versions view
all archives, all items are read to build a unified view.
files are represented by a same-name directory with the versions of the file.
A filename suffix computed by adler32(chunkids) is used to disambiguate the versions.

also: refactor code a little, create methods for leaves, inner nodes.
2016-08-27 23:17:57 +02:00
enkore
69c51f268d Merge pull request #1374 from textshell/issue/1039-aes-iv
Fix AES-CTR nonce reusage
2016-08-27 15:52:21 +02:00
Martin Hostettler
620f505a14 Reserve nonce space for AES-CTR before using it.
Reusing the nonce totally breaks AES-CTR confidentiality.

This code uses a reservation of nonce space and stores the next nonce available for
a future reservation on the client and in the repository.

Local storage is needed to protect against evil repositories that try to gain access to
encrypted data by not saving nonce reservations and aborting the connection or otherwise
forcing a rollback.

Storage in the repository is needed to protect against another client writing to the
repository after a transaction was aborted and thus not seeing the last used nonce from
the manifest.

With a real counter mode cipher protection for the multiple client case with an actively
evil repository is not possible. But this still protects against cases where the attacker can
not arbitrarily change the repository but can read everything stored and abort connections
or crash the server.

Fixes #22
2016-08-27 15:31:50 +02:00
Marian Beermann
e4e6787906 recreate: fix crash if recompress and deduplication beyond autocommit_threshold
ie. it means that if all the recompressed chunks were already in the repo
no data would be written, so there would be no active txn, so failure
ensues.
2016-08-27 14:31:57 +02:00
enkore
e60ed80433 Merge pull request #1539 from enkore/f/recreate-cp
recreate: fix crash if archive doesn't have chunker_params
2016-08-27 14:06:32 +02:00
Marian Beermann
e289fb3539 recreate: fix crash if archive doesn't have chunker_params 2016-08-27 14:01:28 +02:00
enkore
1d750e802e Merge pull request #1536 from enkore/f/prip2
ProgressIndicatorPercent / extract minor cosmetic enhancement
2016-08-27 00:36:43 +02:00
TW
168ce1dc86 Merge pull request #1535 from ThomasWaldmann/merge-1.0-maint
Merge 1.0 maint
2016-08-27 00:32:40 +02:00
Marian Beermann
f0a32575a5 extract: --progress: no extra line for 'Calculating size' 2016-08-26 22:15:44 +02:00
Marian Beermann
517ccc2d58 ProgressIndicatorPercent: output(message) to override output 2016-08-26 22:15:29 +02:00
Thomas Waldmann
25fa443d2b repo tests: convert some more byte literals to H(x) 2016-08-26 20:59:22 +02:00
Thomas Waldmann
1974824595 Merge branch '1.0-maint' 2016-08-26 20:47:23 +02:00
Marian Beermann
cd39ccb821 fix overeager storing of hardlink masters
n.b. we only need to store them for items that we wouldn't extract.

this also fixes an intersting edge case in extracting hard links
with --strip-components
2016-08-25 21:16:20 +02:00
Marian Beermann
b5d7f1df26 extract: fix incorrect progress output for hard links
this produces correct output if any (non proper) subset of hardlinks are
extracted.
2016-08-25 01:12:30 +02:00
Martin Hostettler
b845a074cb tests: TestBuildFilter: Adjust from item_is_hardlink_master to peek_and_store_hardlink_masters. 2016-08-22 23:36:43 +02:00
Martin Hostettler
a026febdb0 Archiver.build_filter: strip_components is no longer a optional parameter. 2016-08-22 23:07:38 +02:00
Martin Hostettler
972392e290 extract: When doing a partial restore don't leak prefetched chunks.
The filter function passed to iter_items (with preload=True) may never return True for items that
are not really extracted later because that would leak prefetched items.

For restoring hard linked files the item containing the actual chunks might not be matched
or implicitly removed from the restore by strip_components. For this reason the chunk list or all
items that can potentially be used as hardlink target needs to be stored.

To achive both requirements at the same time the filter function needs to store the needed information
for the hardlinks while not returning True just because it could be a hardlink target.

Known problems: When using progress indication the calculated extracted_size now can be smaller
than the actual extracted size in presence of hard links (master is not restored) instead of
bigger (potential master not used in restore).
2016-08-22 22:58:58 +02:00
Thomas Waldmann
d1d2738381 re-enable fuse tests for RemoteArchiver
at some time they had deadlock issues, but it worked for me now.
2016-08-22 00:14:10 +02:00
Marian Beermann
53d0140bd5 Repository: add compact_segments progress 2016-08-21 21:55:53 +02:00
TW
2f65f7bdec Merge pull request #1449 from enkore/f/extractprogress
extract --progress
2016-08-21 20:24:44 +02:00
Marian Beermann
ab31ffaa85 ProgressIndicatorPercent: remove same_line 2016-08-21 19:57:36 +02:00
Marian Beermann
e7d44cec39 extract: --progress: Calculating size 2016-08-21 19:57:36 +02:00
TW
ab96c6496c Merge pull request #1513 from ThomasWaldmann/improve-error-logging
improve error logging, fixes #1440
2016-08-21 18:29:18 +02:00
Marian Beermann
4d214e2503 Simplify and test Item.file_size 2016-08-21 01:09:21 +02:00
Marian Beermann
5924915d35 Flip ProgressIndicatorPercent same_line default to True
Every production use of this uses same_line=True
2016-08-21 01:09:20 +02:00
Marian Beermann
8709cec57c borg-extract --progress 2016-08-21 01:07:55 +02:00
enkore
81dd381701 Merge pull request #1507 from ThomasWaldmann/use-modified-pyinstaller
use patched LDLP-preserving pyinstaller
2016-08-21 00:16:24 +02:00
enkore
9baa024f4a Merge pull request #1508 from ThomasWaldmann/merge-1.0-maint
Merge 1.0 maint
2016-08-21 00:12:00 +02:00
Thomas Waldmann
41e4707d6a fixup: meant "tb", not "traceback" 2016-08-20 23:09:42 +02:00
TW
357f4ef72e Merge pull request #1511 from c4rlo/lru-cache
helpers.py: replace memoize with functools.lru_cache
2016-08-20 21:19:17 +02:00
Thomas Waldmann
a0c8c40f27 improve error logging, fixes #1440
archiver: split traceback and msg, have separate log level for traceback, log LockTimeout at debug level,
for "Error" exceptions: always log the traceback, either at ERROR or DEBUG level.

remote: if we have an "Error" typed exception instance, we can use its traceback flag and .get_message()
as we do locally.
2016-08-20 17:23:02 +02:00
Carlo Teubner
61af307ad4 helpers.py: replace memoize usages with lru_cache 2016-08-20 13:06:16 +01:00
Thomas Waldmann
e7fccaccb2 restore original LDLP, if possible, fixes #1498
see https://github.com/pyinstaller/pyinstaller/pull/2148
2016-08-20 12:31:23 +02:00
Carlo Teubner
28076ee588 helpers.py: replace memoize with functools.lru_cache 2016-08-20 10:01:59 +01:00
Carlo Teubner
13761c4ec2 daemonize(): use os.devnull instead of hardcoded /dev/null 2016-08-20 10:00:03 +01:00
Thomas Waldmann
c355f3617a Merge branch '1.0-maint' 2016-08-20 00:04:55 +02:00
Thomas Waldmann
53d14e96de borg list: test for --list-format deprecation 2016-08-19 14:55:49 +02:00
TW
32e84f33e9 Merge pull request #1484 from enkore/issue/1396
Track shadowing of log entries
2016-08-19 14:09:34 +02:00