Selaa lähdekoodia

Windows: Block alternate data streams

Unrud 3 vuotta sitten
vanhempi
sitoutus
3c218ecd9c
1 muutettua tiedostoa jossa 1 lisäystä ja 0 poistoa
  1. 1 0
      radicale/pathutils.py

+ 1 - 0
radicale/pathutils.py

@@ -257,6 +257,7 @@ def is_safe_filesystem_path_component(path: str) -> bool:
     """
     return (
         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 path.startswith(".") and not path.endswith("~") and
         is_safe_path_component(path))