discover-image: extend r/o check on images via path

If we have no path, let's check the parent's path.
This commit is contained in:
Lennart Poettering
2024-12-10 20:53:56 +01:00
committed by Mike Yuan
parent 77b40b4f60
commit 641714cb30
+1
View File
@@ -356,6 +356,7 @@ static int image_make(
read_only =
(path && path_startswith(path, "/usr")) ||
(parent && path_startswith(parent, "/usr")) ||
(faccessat(dfd, filename, W_OK, AT_EACCESS) < 0 && errno == EROFS);
if (S_ISDIR(st->st_mode)) {