]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core/namespace: ignore ENOENT for /proc/sys/kernel/domainname and hostname
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 14 Dec 2020 03:37:23 +0000 (12:37 +0900)
committerLuca Boccassi <luca.boccassi@gmail.com>
Mon, 14 Dec 2020 14:15:28 +0000 (14:15 +0000)
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.

src/core/namespace.c

index cdf427a6ea9393939b21167e66c9c990186100e6..4d4cd4985c0618b68f905d93b38a1e1203afa96d 100644 (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,
                         };
                 }