New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
picked cherries for 1.0-maint #2284
Conversation
# Conflicts: # docs/development.rst
# Conflicts: # borg/archiver.py
we do not trust the remote, so we are careful unpacking its responses. the remote could return manipulated msgpack data that announces e.g. a huge array or map or string. the local would then need to allocate huge amounts of RAM in expectation of that data (no matter whether really that much is coming or not). by using limits in the Unpacker, a ValueError will be raised if unexpected amounts of data shall get unpacked. memory DoS will be avoided. # Conflicts: # borg/archiver.py # src/borg/archive.py # src/borg/remote.py # src/borg/repository.py
borgbackup#2180 # Conflicts: # borg/archive.py
also: add some missing assertion messages severity: - no issue on little-endian platforms (== most, including x86/x64) - harmless even on big-endian as long as refcount is below 0xfffbffff, which is very likely always the case in practice anyway.
* trigger bug in --verify-data, see borgbackup#2221 * raise decompression errors as DecompressionError, fixes borgbackup#2221 this is a subclass of IntegrityError, so borg check --verify-data works correctly if the decompressor stumbles over corrupted data before the plaintext gets verified (in a unencrypted repository, otherwise the MAC check would fail first). * fixup: fix exception docstring, add placeholder, change wording
Codecov Report
@@ Coverage Diff @@
## 1.0-maint #2284 +/- ##
============================================
- Coverage 81.96% 81.8% -0.16%
============================================
Files 15 15
Lines 5172 5210 +38
Branches 880 887 +7
============================================
+ Hits 4239 4262 +23
- Misses 676 687 +11
- Partials 257 261 +4
Continue to review full report at Codecov.
|
borg/archive.py
Outdated
if e.errno == errno.E2BIG: | ||
logger.warning('%s: Value or key of extended attribute %s is too big for this filesystem' % | ||
(path, k.decode())) | ||
elif e.errno not in (errno.ENOTSUP, errno.EACCES): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a bit strange now: warns if we could not extract xattrs (because they were too big), but says nothing if we could not extract at all (because not supported or not permitted). this was fixed in master.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to cherrypick #2258 for this.
if hashindex.API_VERSION != '1.0_01': | ||
raise ExtensionModuleError | ||
if chunker.API_VERSION != '1.0_01': | ||
raise ExtensionModuleError | ||
if compress.API_VERSION != '1.0_01': | ||
raise ExtensionModuleError |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh? was this missing still in 1.0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems so
elif kind == 'client': | ||
args.update(dict(max_array_len=LIST_SCAN_LIMIT, # result list from repo.list() / .scan() | ||
max_map_len=100, # misc. result dicts | ||
)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these might be not the tightest limits as 1.0 does not use the dict-based rpc protocol, but should work I guess.
@@ -245,7 +245,7 @@ def cmd(self, *args, **kw): | |||
return output | |||
|
|||
def create_src_archive(self, name): | |||
self.cmd('create', self.repository_location + '::' + name, src_dir) | |||
self.cmd('create', '--compression=lz4', self.repository_location + '::' + name, src_dir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, do we want that in 1.0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't make much of a difference, but might be good to have when backporting new tests that expect it.
(cherry picked from commit 4b33c3f)
…borgbackup#2258) * Set warning exit code when xattr is too big * Warnings for more extended attributes errors (ENOTSUP, EACCES) * Add tests for all xattr warnings (cherry picked from commit 63b5cbf)
@enkore yup. let's test the fixed async processing in master / 1.1b first for a while, then we can think whether we want it in 1.0 also. |
borgbackup#1975 (cherry picked from commit 4d81b18)
Done |
# note: might crash in compact() after committing the repo | ||
repository.commit() | ||
logger.info('Done. Run "borg check --repair" to clean up the mess.') | ||
return self.exit_code |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed the error reporting here to match the the singular-behaviour that borg delete
normally has in 1.0.x (RC=2 if archive not found, no plural messages etc.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm.
for easier review, let's merge this and start a new PR for further stuff.
Changes from
#2156
#2159
#2171
#2181
#2187
#2198
#2206
#2224
#2254
#2199
#2258
#2184