Windows: Block alternate data streams

This commit is contained in:
Unrud 2022-03-30 22:26:02 +02:00
parent 0baf1dc908
commit 3c218ecd9c

View File

@ -257,6 +257,7 @@ def is_safe_filesystem_path_component(path: str) -> bool:
""" """
return ( return (
bool(path) and not os.path.splitdrive(path)[0] and bool(path) and not os.path.splitdrive(path)[0] and
(sys.platform != "win32" or ":" not in path) and # Block NTFS-ADS
not os.path.split(path)[0] and path not in (os.curdir, os.pardir) and not os.path.split(path)[0] and path not in (os.curdir, os.pardir) and
not path.startswith(".") and not path.endswith("~") and not path.startswith(".") and not path.endswith("~") and
is_safe_path_component(path)) is_safe_path_component(path))