Skip to content

Commit

Permalink
Merge pull request #7664 from ThomasWaldmann/test-for-backslashes
Browse files Browse the repository at this point in the history
no backslashes
  • Loading branch information
ThomasWaldmann committed Jun 22, 2023
2 parents 44147fe + 4f49f9b commit 67a32ee
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/borg/helpers/fs.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,6 @@ def make_path_safe(path):
`path` contain any '..' elements.
"""
path = path.lstrip("/")
if "\\" in path: # borg always wants slashes, never backslashes.
raise ValueError(f"unexpected backslash(es) in path {path!r}")
if path.startswith("../") or "/../" in path or path.endswith("/..") or path == "..":
raise ValueError(f"unexpected '..' element in path {path!r}")
path = os.path.normpath(path)
Expand Down

0 comments on commit 67a32ee

Please sign in to comment.