dev-setup: rework make_inaccessible_nodes() around openat() and friends
authorLennart Poettering <lennart@poettering.net>
Fri, 5 Jan 2024 15:35:35 +0000 (16:35 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 5 Jan 2024 23:27:51 +0000 (08:27 +0900)
commita6a7983dbf550b5b8bb484cae66554ffcb70df7f
tree68f72643082b337fad38698b6e85a4d149caf646
parent0d1706b5fa02c9360d0f1eb5c8b01a4f83c92b22
dev-setup: rework make_inaccessible_nodes() around openat() and friends

Let's operate on fds rather than paths. Make some tweaks to the logic on
top:

1. Mark the resulting dir as read-only after we are done.
2. Use the new inode_type_to_string() calls to determine the inode
   names.
3. If an inode already exists, try to adjust the access mode, just in
   case.
4. Use FOREACH_ARRAY()
src/shared/dev-setup.c
src/test/test-dev-setup.c