fix(images): Fix symlinked image imports and add regression tests

This commit is contained in:
Cristi committed 2026-09-29 20:16:22 +03:00
1 parent 2e12775911
commit 87df09c00c
2 files changed
+34 -2

No files matched your search

+1 -1
View File
@@ -132,7 +132,7 @@ def get_builtin_disks() -> List[str]:
def inspect_image_file(path, expected_image_type=None, allow_raw_image=False, stopped_event=None):
"""Read a stable regular file once, never trusting checksum sidecars."""
before = fingerprint(path)
flags = os.O_RDONLY | getattr(os, "O_BINARY", 0) | getattr(os, "O_NOFOLLOW", 0)
flags = os.O_RDONLY | getattr(os, "O_BINARY", 0)
with os.fdopen(os.open(path, flags), "rb") as f:
info = os.fstat(f.fileno())
if not stat.S_ISREG(info.st_mode) or stat_fingerprint(info) != before: