Merge pull request #6858 from ThomasWaldmann/remove-scp-tilde-expansion-borg2

we remove scp style, also remove it for tilde expansion, fixes #6856
This commit is contained in:
TW 2022-07-13 18:16:57 +02:00 committed by GitHub
commit b37f660d8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 5 deletions

View File

@ -332,15 +332,10 @@ class RepositoryServer: # pragma: no cover
def _resolve_path(self, path):
if isinstance(path, bytes):
path = os.fsdecode(path)
# Leading slash is always present with URI (ssh://), but not with short-form (who@host:path).
if path.startswith("/~/"): # /~/x = path x relative to home dir
path = os.path.join(get_base_dir(), path[3:])
elif path.startswith("~/"):
path = os.path.join(get_base_dir(), path[2:])
elif path.startswith("/~"): # /~username/x = relative to "user" home dir
path = os.path.expanduser(path[1:])
elif path.startswith("~"):
path = os.path.expanduser(path)
elif path.startswith("/./"): # /./x = path x relative to cwd
path = path[3:]
return os.path.realpath(path)