remove not working and disabled optimization, see https://github.com/Kozea/Radicale/pull/2087
This commit is contained in:
@@ -289,22 +289,14 @@ def path_to_filesystem(root: str, sane_path: str, path_is_collision_free: bool =
|
|||||||
raise UnsafePathError(part)
|
raise UnsafePathError(part)
|
||||||
safe_path_parent = safe_path
|
safe_path_parent = safe_path
|
||||||
safe_path = os.path.join(safe_path, part)
|
safe_path = os.path.join(safe_path, part)
|
||||||
# Check for conflicting files (e.g. case-insensitive file systems
|
|
||||||
# or short names on Windows file systems)
|
|
||||||
if not path_is_collision_free:
|
if not path_is_collision_free:
|
||||||
if sys.platform == "win32" and False: # temporary for testing
|
# Check for conflicting files (e.g. case-insensitive file systems
|
||||||
# logger.trace("path_to_filesystem check (win32): %r", part)
|
# or short names on Windows file systems)
|
||||||
# if (os.path.lexists(safe_path) and not os.path.realpath(safe_path).endswith(part)) and not os.path.islink(safe_path):
|
if os.path.lexists(safe_path):
|
||||||
if (os.path.lexists(safe_path) and not os.path.realpath(safe_path).endswith(part)):
|
with os.scandir(safe_path_parent) as entries:
|
||||||
raise CollidingPathError(part)
|
if part not in (e.name for e in entries):
|
||||||
else:
|
raise CollidingPathError(part)
|
||||||
# logger.trace("path_to_filesystem check (!win32): %r", part)
|
|
||||||
if os.path.lexists(safe_path):
|
|
||||||
with os.scandir(safe_path_parent) as entries:
|
|
||||||
if part not in (e.name for e in entries):
|
|
||||||
raise CollidingPathError(part)
|
|
||||||
else:
|
else:
|
||||||
# logger.trace("path_to_filesystem check (skipped): %r", part)
|
|
||||||
pass
|
pass
|
||||||
return safe_path
|
return safe_path
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user