core/namespace: ignore ENOENT for /proc/sys/kernel/domainname and hostname

If they do not exist, hostname or domainname cannot be modified. So, it is ok.

Fixes #17866, especially https://github.com/systemd/systemd/issues/17866#issuecomment-744118614.
This commit is contained in:
Yu Watanabe 2020-12-14 12:37:23 +09:00 committed by Luca Boccassi
parent 38abd1bfc5
commit 0ebc9f23fa
1 changed files with 2 additions and 0 deletions

View File

@ -1684,10 +1684,12 @@ int setup_namespace(
*(m++) = (MountEntry) {
.path_const = "/proc/sys/kernel/hostname",
.mode = READONLY,
.ignore = true,
};
*(m++) = (MountEntry) {
.path_const = "/proc/sys/kernel/domainname",
.mode = READONLY,
.ignore = true,
};
}