nspawn: set read-only access mode on two /run/host/ files
The diectory is mounted read-only anyway, hence this doesn't do much, but let's lock this down on every level we can.
This commit is contained in:
+2
-2
@@ -3946,11 +3946,11 @@ static int outer_child(
|
||||
|
||||
/* The same stuff as the $container env var, but nicely readable for the entire payload */
|
||||
p = prefix_roota(directory, "/run/host/container-manager");
|
||||
(void) write_string_file(p, arg_container_service_name, WRITE_STRING_FILE_CREATE);
|
||||
(void) write_string_file(p, arg_container_service_name, WRITE_STRING_FILE_CREATE|WRITE_STRING_FILE_MODE_0444);
|
||||
|
||||
/* The same stuff as the $container_uuid env var */
|
||||
p = prefix_roota(directory, "/run/host/container-uuid");
|
||||
(void) write_string_filef(p, WRITE_STRING_FILE_CREATE, SD_ID128_UUID_FORMAT_STR, SD_ID128_FORMAT_VAL(arg_uuid));
|
||||
(void) write_string_filef(p, WRITE_STRING_FILE_CREATE|WRITE_STRING_FILE_MODE_0444, SD_ID128_UUID_FORMAT_STR, SD_ID128_FORMAT_VAL(arg_uuid));
|
||||
|
||||
if (!arg_use_cgns) {
|
||||
r = mount_cgroups(
|
||||
|
||||
Reference in New Issue
Block a user