From 81acd46518de175764b14d0b3cc95cb18f5700a7 Mon Sep 17 00:00:00 2001 From: Sergey Platonov Date: Mon, 13 Dec 2021 10:22:28 +0100 Subject: [PATCH] libc: nameserver file in configured socket directory The path for the `nameserver` file was fixed to `/socket/nameserver`. So, if the socket directory was configured differing from `/socket`, DNS did not work. Now the default path for the `nameserver` takes into account the path configured in the `socket` libc config attribute. Fixes #4318 Fixes #4343 --- repos/libports/src/lib/libc/vfs_plugin.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/repos/libports/src/lib/libc/vfs_plugin.cc b/repos/libports/src/lib/libc/vfs_plugin.cc index c93b6d2920..aeb961005b 100644 --- a/repos/libports/src/lib/libc/vfs_plugin.cc +++ b/repos/libports/src/lib/libc/vfs_plugin.cc @@ -193,8 +193,11 @@ namespace Libc { char const *config_nameserver_file() __attribute__((weak)); char const *config_nameserver_file() { + static Genode::String default_value { + config_socket(), "/nameserver" }; + static Config_attr ns_file("nameserver_file", - "/socket/nameserver"); + default_value.string()); return ns_file.string(); }