Commit graph

1062 commits

Author SHA1 Message Date
Thomas Waldmann
90fdfd26d8 repository: test FD invalidation 2017-09-06 15:17:05 +02:00
Marian Beermann
aa30be296b keymanager: don't depend on optional readline module
(cherry picked from commit b8793d9577)
2017-08-30 11:29:32 +02:00
TW
faa681ed06 Merge pull request #2971 from ThomasWaldmann/fix-timestamp-option-1.0
borg create --timestamp: set start time, fixes #2957
2017-08-27 20:46:06 +02:00
Marian Beermann
3b53823cbe create: document exclusion through nodump
(cherry picked from commit 495f838d88)
2017-08-27 15:42:45 +02:00
Thomas Waldmann
1d52b592cf borg create --timestamp: set start time, fixes #2957
(cherry picked from commit ac404e3a74)
2017-08-27 15:26:32 +02:00
enkore
1163cb5179 Buffer: fix wrong thread-local storage use (#2951)
Buffer: delete support for multiple threads

Thread-local objects are a fairly complex footgun, so avoid them in
the first place. When a Compressor uses a Buffer (for example),
just create multiple Compressor instances for each thread, owned by
each thread. Minimize multiple ownership of objects across
threads if at all possible!

(cherry picked from commit f7ed5d7220)
2017-08-25 05:12:52 +02:00
Thomas Waldmann
5beaa5bd02 ignore corrupt files cache, fixes #2939
ignore the files cache when corrupt and emit a warning message
so the users notices that there is a problem.
2017-08-19 01:03:38 +02:00
Thomas Waldmann
230e0feac6 migrate locks to child PID when daemonize is used
(cherry picked from commit 09e3a02fbc)
2017-08-14 00:25:51 +02:00
Thomas Waldmann
3a7f0fea69 fix exitcode of borg serve, fixes #2910
(cherry picked from commit 583de3eeb1)
2017-08-06 17:38:04 +02:00
Radu Ciorba
2cdd4353b6 replace modulo with if to check for wraparound in hashmap
Integer division is slow, and this improves the speed of all operations on the hashmap.

Benchmarked this patch on the rciorba/master-bench branch:
9e5d61e03c/results.html

(cherry picked from commit 12e0f55991)
2017-08-01 06:01:03 +02:00
TW
81b1442268 Merge pull request #2843 from ThomasWaldmann/checkpoint-interval
change --checkpoint-interval default from 600s to 1800s, fixes #2841
2017-07-19 15:54:36 +02:00
Thomas Waldmann
f25e3177e9 change --checkpoint-interval default from 600s to 1800s, fixes #2841
a user was (rightfully) complaining that borg does a whole lot of
writing to .cache and was also quite inefficient because that took
rather long and occurred too frequently.

this was caused by big indexes/caches and the relatively high default
checkpoint frequency (every 300s) in 1.0.

we already have increased that value to 1800s in master (which soon will
be 1.1), so this changeset just does the same for 1.0.x.
2017-07-19 01:08:08 +02:00
Marian Beermann
a93f636151 archiver: add test for paperkey import, fix bug
(cherry picked from commit 78f0e5d473)
2017-07-16 12:36:04 -07:00
TW
d0203a237d use limited unpacker for outer key, fixes #2174 (#2790)
* use limited unpacker for outer key, fixes #2174

* fixup: higher inner key data size limit

(cherry picked from commit 9ca666907b)
2017-07-16 12:36:03 -07:00
Marian Beermann
6990beb69e xattr: test split_lstring
(cherry picked from commit 6c67b64ab6)
2017-07-16 12:36:03 -07:00
Marian Beermann
cf0d28a24f BORG_PASSCOMMAND: use same cmd-string splitting as BORG_RSH
(cherry picked from commit 4e6a771ee7)
2017-06-26 04:11:15 +02:00
TuXicc
8c1da1adda Added BORG_PASSCOMMAND environment variable (#2573)
(cherry picked from commit 578b76af3a)
2017-06-26 04:08:42 +02:00
Thomas Waldmann
f7b16112dc move get_limited_unpacker to helpers
also: move some constants to borg.constants
(cherry picked from commit 89f3cab6cd)
2017-06-26 03:12:12 +02:00
Thomas Waldmann
35b0f1f4f9 Manifest: use limited unpacker
(cherry picked from commit 6c2c51939d)
2017-06-26 02:25:20 +02:00
Marian Beermann
10b196d532 document pattern denial of service
(cherry picked from commit 1f5ddb6572)
2017-06-26 01:56:14 +02:00
edgewood
932fb9ec7a Split up parsing and filtering for --keep-within (#2726)
Split up parsing and filtering for --keep-within

Fixes #2610

Parse --keep-within argument early, via new method within_range passed
to argparse type=, so that better error messages can be given.

Also swallows ValueError stacktrace per the comment in the old code that
including it wasn't desirable.
2017-06-25 23:31:04 +02:00
TW
04aa426334 Merge pull request #2722 from ThomasWaldmann/backports5
even more backports
2017-06-23 16:24:33 +02:00
Thomas Waldmann
8deb4dfdda remove skipping the noatime tests on GNU/Hurd, fixes #2710
I recently installed GNU/Hurd 2017 and found the atime test works now.

(cherry picked from commit 49411d1c6c)
2017-06-22 01:03:32 +02:00
Marian Beermann
12b2e1fdd0 chunker: fix invalid use of types
With the argument specified as unsigned char *, Cython emits
code in the Python wrapper to convert string-like objects to
unsigned char* (essentially PyBytes_AS_STRING).

Because the len(data) call is performed on a cdef'd string-ish type,
Cython emits a strlen() call, on the result of PyBytes_AS_STRING.

This is not correct, since embedded null bytes are entirely possible.

Incidentally, the code generated by Cython was also not correct,
since the Clang Static Analyzer found a path of execution where
passing arguments in a weird way from Python resulted in strlen(NULL).

Formulated like this, Cython emits essentially:

c_buzhash(
 PyBytes_AS_STRING(data),
 PyObject_Length(data),
 ...
)

which is correct.

(cherry picked from commit faf2d0b537)
2017-06-21 15:31:33 +02:00
Marian Beermann
3bd71c63f9 chunker: don't do uint32_t >> 32
(cherry picked from commit 944a4abd58)
2017-06-21 15:31:01 +02:00
Thomas Waldmann
10b8cd9218 use stat with follow_symlinks=False
should be equivalent to using os.lstat() before.

(cherry picked from commit efec00b39c)
2017-06-21 15:16:43 +02:00
Thomas Waldmann
2b3932cac6 require and use chown with follow_symlinks=False
should be equivalent to using os.lchown() before.

(cherry picked from commit 094376a8ad)
2017-06-21 14:58:17 +02:00
Thomas Waldmann
8857422035 document follow_symlinks requirements, check libc, fixes #2507
(cherry picked from commit b484c79bc2)
2017-06-21 14:57:22 +02:00
Thomas Waldmann
961a2587dc FUSE: fix negative uid/gid crash, fixes #2674
they could come into archives e.g. when backing up
external drives under cygwin.

(cherry picked from commit ccd066f0af)
2017-06-21 03:15:22 +02:00
Thomas Waldmann
34a821178f don't write to disk with --stdout, fixes #2645
if we always give stdout to extract_item(), it gets into the stdout-
processing branch which only emits data from items that have chunks
and does nothing for items which don't.

(cherry picked from commit 0b00c14c27)
2017-06-21 03:05:03 +02:00
Thomas Waldmann
7846ef2e69 remove attic dependency of the tests, fixes #2505
attic.tar.gz contains a repo + corresponding keyfile - all the
upgrader module tests need.

.tar.gz because the .tar was 20x bigger.

(cherry picked from commit fed5873e29)
2017-06-21 03:00:52 +02:00
Marian Beermann
aafbaaea20 cache sync: check Operation.READ compatibility with manifest
(cherry picked from commit c9c227f2ca)
2017-06-21 00:53:49 +02:00
Thomas Waldmann
0b46c0d192 enable remote tests on cygwin
the cygwin issue that caused these tests to break was fixed in cygwin
at least since cygwin 2.8.0 (maybe even since 2.7.0).

also added a comment to our workaround (os_write wrapper, that is needed
still for people running older cygwin versions) that it can be removed
when cygwin 2.8.0 is considered ancient (and everybody has upgraded to
some fixed version).

(cherry picked from commit 4766d66875)
2017-06-21 00:49:29 +02:00
Marian Beermann
1de042f9e5 key file names: limit to 100 characters (not bytes)
(cherry picked from commit 38ed9a20af)
2017-06-21 00:39:24 +02:00
Marian Beermann
649afe0c17 key file names: remove colons from host name
(cherry picked from commit 4b8a04b5e7)
2017-06-21 00:37:46 +02:00
Martin Hostettler
6ce476a42b Add tests for cache compatibility code. 2017-06-08 21:38:59 +02:00
Martin Hostettler
fb128fbf84 Cache: Wipe cache if compatibility is not sure
Add detection of possibly incompatible combinations
of the borg versions maintaining the cache and the featues used.
2017-06-08 20:36:56 +02:00
Martin Hostettler
7f57086223 permit manifest version 2 as well 1 one. 2017-06-08 20:36:55 +02:00
Martin Hostettler
ca5ea4f53d Add tests for mandatory repository feature flags. 2017-06-08 20:36:55 +02:00
Martin Hostettler
8783460fc3 Add minimal version of in repository mandatory feature flags.
This should allow us to make sure older borg versions can be cleanly
prevented from doing operations that are no longer safe because of
repository format evolution. This allows more fine grained control than
just incrementing the manifest version. So for example a change that
still allows new archives to be created but would corrupt the repository
when an old version tries to delete an archive or check the repository
would add the new feature to the check and delete set but leave it out
of the write set.

This is somewhat inspired by ext{2,3,4} which uses sets for
compat (everything except fsck), ro-compat (may only be accessed
read-only by older versions) and features (refuse all access).
2017-06-08 20:36:54 +02:00
Thomas Waldmann
73dea37432 use _host to store host/ipv4/ipv6
for ipv6, it includes the outer square brackets.

the host property strips any outer square brackets.
2017-05-23 15:31:08 +02:00
Benedikt Neuffer
97c770e318 ipv6 address support
also: Location: more informative exception when parsing fails
2017-05-23 15:31:04 +02:00
Marian Beermann
d9681c6b15 fuse: fix crash if empty (None) xattr is read 2017-05-23 15:27:39 +02:00
Marian Beermann
fa9cef7abf mount: do pre-mount checks before opening repository 2017-05-23 15:26:12 +02:00
Marian Beermann
450146e6ca mount: check llfuse is installed before asking for passphrase 2017-05-23 15:25:41 +02:00
Marian Beermann
8ca7faaf1e note -v/--verbose requirement on affected options
This is fixed in 1.1.
2017-05-21 16:55:19 +02:00
Marian Beermann
1c6cefbee7 Revert "Merge pull request #1971 from leo-b/1.0-maint-patterns"
This reverts commit d188886269, reversing
changes made to c688b1be85.

# Conflicts:
#	borg/archiver.py
2017-05-15 23:41:09 +02:00
Marian Beermann
6335d593ab Revert "Merge pull request #2231 from leo-b/1.0-maint-patterns"
This reverts commit 9a5bc514b3, reversing
changes made to 8b5ad3819c.
2017-05-15 23:38:17 +02:00
Marian Beermann
173ecfddb4 Revert "Merge pull request #2401 from ThomasWaldmann/patterns-style-default-1.0"
This reverts commit 7a4e9e7a6f, reversing
changes made to b007808706.
2017-05-15 23:37:28 +02:00
Thomas Waldmann
6a929c689e embrace y2038 issue to support 32bit platforms
(cherry picked from commit de76a6b821)
2017-04-29 23:56:53 +02:00