1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-09 01:18:19 +03:00

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-09 12:48:54 +01:00 committed by Mike Yuan
parent 77b40b4f60
commit 641714cb30

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)) {