discover-image: imply that hidden images are read-only
Marking a whole directory tree OS image as read-only is difficult privilege-wise, because so far we rely on the FS_IMMUTABLE_FL which is not accessible to unpriv clients. One fundamental place where we currently rely on marking images read-only is for keeping pristine copies of the originally downloaded image around, which we place in "hidden" image directories. This is probably the most relevant usecase for the read-only flag. And moreover, the only usecase for the hidden images are these read-only pristine copies. Hence, let's make this work reasonably in the unpriv case, and simply imply the read-only flag for hidden images. This is strictly speaking a change in behaviour, but effectively it shouldn't be, because for nspawn containers that are executed we insist on names that are hostname compatible, and hidden names aren't (because they start with a dot).
This commit is contained in:
+1
-1
@@ -3077,7 +3077,7 @@ static int determine_names(void) {
|
||||
return log_oom();
|
||||
|
||||
if (!arg_ephemeral)
|
||||
arg_read_only = arg_read_only || i->read_only;
|
||||
arg_read_only = arg_read_only || image_is_read_only(i);
|
||||
} else {
|
||||
r = safe_getcwd(&arg_directory);
|
||||
if (r < 0)
|
||||
|
||||
Reference in New Issue
Block a user