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
This commit is contained in:
Sergey Platonov 2021-12-13 10:22:28 +01:00 committed by Christian Helmuth
parent 2e1a1c199e
commit 81acd46518

View File

@ -193,8 +193,11 @@ namespace Libc {
char const *config_nameserver_file() __attribute__((weak));
char const *config_nameserver_file()
{
static Genode::String<Vfs::MAX_PATH_LEN> default_value {
config_socket(), "/nameserver" };
static Config_attr ns_file("nameserver_file",
"/socket/nameserver");
default_value.string());
return ns_file.string();
}