fix(oci): reject missing managed mount roots

This commit is contained in:
VAIO73
2026-10-19 12:53:34 +00:00
parent 3e9c9eb25d
commit 1511680a95
2 changed files with 16 additions and 6 deletions
+1 -6
View File
@@ -84,10 +84,7 @@ def remove_empty_format_directories(rootfs, deployment, backed_only=True, target
if not paths:
return 0
flags = os.O_RDONLY | os.O_DIRECTORY | os.O_NOFOLLOW
try:
root = os.open(rootfs, flags)
except FileNotFoundError:
return 0
root = os.open(rootfs, flags)
removed = 0
try:
for path in paths:
@@ -98,8 +95,6 @@ def remove_empty_format_directories(rootfs, deployment, backed_only=True, target
os.close(current)
current = following
removed += int(remove_empty_at(current))
except FileNotFoundError:
continue
except OSError as error:
if error.errno in (errno.ELOOP, errno.ENOTDIR):
raise ValueError('Symbolic link or invalid managed volume path') from error