core/namespace: honor MountEntry.read_only, .options, and so on in static entries
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 19 Oct 2024 05:38:08 +0000 (14:38 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 23 Oct 2024 17:59:46 +0000 (02:59 +0900)
commit0cc496b2d21f73d0a03414ce40eceb9e3af76e22
tree5338a8bd55b2de56140ee38534ac8b072f9b11d3
parentb6b8527cd184085008585c1a1f9725eb97c342ef
core/namespace: honor MountEntry.read_only, .options, and so on in static entries

Otherwise, ProtectHome=tmpfs makes /home/ and friends not read-only.
Also, mount options for /run/ specified in MountAPIVFS=yes are not
applied.

The function append_static_mounts() was introduced in
5327c910d2fc1ae91bd0b891be92b30379c7467b, but at that time, there were
neither .read_only nor .options in the struct. But, when later the
struct is extended, the function was not updated and they were not
copied from the static table.
The fields has been used in static tables since
e4da7d8c796a1fd11ecfa80fb8a48eac9e823f06, and also in
94293d65cd4125347e21b3e423d0e245226b1be2.

Fixes #34825.
src/core/namespace.c
test/units/TEST-07-PID1.exec-context.sh