mirror of
https://github.com/borgbackup/borg.git
synced 2025-02-22 14:11:27 +00:00
fix server-side IndexError for 4-arg open() of old clients, fixes #3192
borg 1.1(.0) server didn't support the 4 argument open() calls made by < 1.0.7 clients.
This commit is contained in:
parent
38dd1f11ac
commit
dbcc870489
1 changed files with 9 additions and 1 deletions
|
@ -179,7 +179,15 @@ def __init__(self, restrict_to_paths, restrict_to_repositories, append_only, sto
|
||||||
|
|
||||||
def positional_to_named(self, method, argv):
|
def positional_to_named(self, method, argv):
|
||||||
"""Translate from positional protocol to named protocol."""
|
"""Translate from positional protocol to named protocol."""
|
||||||
|
try:
|
||||||
return {name: argv[pos] for pos, name in enumerate(compatMap[method])}
|
return {name: argv[pos] for pos, name in enumerate(compatMap[method])}
|
||||||
|
except IndexError:
|
||||||
|
if method == 'open' and len(argv) == 4:
|
||||||
|
# borg clients < 1.0.7 use open() with 4 args
|
||||||
|
mapping = compatMap[method][:4]
|
||||||
|
else:
|
||||||
|
raise
|
||||||
|
return {name: argv[pos] for pos, name in enumerate(mapping)}
|
||||||
|
|
||||||
def filter_args(self, f, kwargs):
|
def filter_args(self, f, kwargs):
|
||||||
"""Remove unknown named parameters from call, because client did (implicitly) say it's ok."""
|
"""Remove unknown named parameters from call, because client did (implicitly) say it's ok."""
|
||||||
|
|
Loading…
Reference in a new issue