mirror of
https://github.com/borgbackup/borg.git
synced 2026-06-11 01:41:57 -04:00
drop unused permissions param from legacy RepositoryServer
RepositoryServer stored self.permissions but never read it: open() builds a LegacyRepository without any permissions, and legacy (borg 1.x / v1) repositories have no permission system at all. Remove the dead __init__ parameter and stop forwarding args.permissions from do_serve. The --permissions CLI option stays - it applies to the non-legacy "borg serve --rest" path. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
83b0dd66c7
commit
a1e8e538c0
2 changed files with 7 additions and 5 deletions
|
|
@ -16,10 +16,10 @@ class ServeMixIn:
|
|||
if args.rest:
|
||||
self.do_serve_rest(args)
|
||||
else:
|
||||
# note: legacy (borg 1.x) repositories have no permission system, so args.permissions
|
||||
# is intentionally not forwarded here (it only applies to "borg serve --rest").
|
||||
RepositoryServer(
|
||||
restrict_to_paths=args.restrict_to_paths,
|
||||
restrict_to_repositories=args.restrict_to_repositories,
|
||||
permissions=args.permissions,
|
||||
restrict_to_paths=args.restrict_to_paths, restrict_to_repositories=args.restrict_to_repositories
|
||||
).serve()
|
||||
|
||||
def do_serve_rest(self, args):
|
||||
|
|
|
|||
|
|
@ -752,13 +752,15 @@ class RepositoryServer: # pragma: no cover
|
|||
"get_manifest", # borg2 LegacyRepository has this
|
||||
)
|
||||
|
||||
def __init__(self, restrict_to_paths, restrict_to_repositories, permissions=None):
|
||||
def __init__(self, restrict_to_paths, restrict_to_repositories):
|
||||
self.repository = None
|
||||
self.RepoCls = None
|
||||
self.rpc_methods = ("open", "close", "negotiate")
|
||||
self.restrict_to_paths = restrict_to_paths
|
||||
self.restrict_to_repositories = restrict_to_repositories
|
||||
self.permissions = permissions
|
||||
# note: legacy (borg 1.x / v1) repositories have no permission system, so borg serve
|
||||
# does not accept/forward permissions here (the --permissions option only applies to
|
||||
# the non-legacy "borg serve --rest" path).
|
||||
self.client_version = None # we update this after client sends version information
|
||||
|
||||
def filter_args(self, f, kwargs):
|
||||
|
|
|
|||
Loading…
Reference in a new issue