]> git.ipfire.org Git - thirdparty/systemd.git/commit
machine-id-setup: do not read host's machine ID when root directory is specified 27137/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 31 Mar 2023 07:07:23 +0000 (16:07 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 4 Apr 2023 15:52:56 +0000 (00:52 +0900)
commita9f48db5f60188446c18b191ef25cd0a0bd833ee
treed0a2b98a87109044c09e86bc16912cb6ac3ada54
parentc1d74108a0b99e1e4520a69724a52b7100bec348
machine-id-setup: do not read host's machine ID when root directory is specified

If a root directory is specified, and e.g. /var under the root directory
is a symlink to the host's /var, then we wrongly read host's machine ID,
even if O_NOFOLLOW is set.

Let's chase the path with CHASE_NOFOLLOW to refuse such case.

Also, refuse null ID, otherwise we may setup machine ID with NULL.
src/shared/machine-id-setup.c