mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
fix(images): Fix symlinked image imports and add regression tests
This commit is contained in:
1 parent
2e12775911
commit
87df09c00c
2 files changed
+34
-2
No files matched your search
@@ -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:
|
||||
|
||||
Reference in new issue
Block a user