From: Lennart Poettering Date: Mon, 9 Dec 2024 11:48:54 +0000 (+0100) Subject: discover-image: extend r/o check on images via path X-Git-Tag: v258-rc1~1929 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=641714cb30e4834c4bfeb59c3def5161f16fddc9;p=thirdparty%2Fsystemd.git discover-image: extend r/o check on images via path If we have no path, let's check the parent's path. --- diff --git a/src/shared/discover-image.c b/src/shared/discover-image.c index 82e0ad4c027..82be0b73d8a 100644 --- a/src/shared/discover-image.c +++ b/src/shared/discover-image.c @@ -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)) {