hostnamed: always flush nscd cache when changing hostname

This way we know that nss-myhostname always serves the correct answer.
This commit is contained in:
Lennart Poettering 2018-12-07 16:51:39 +01:00
parent 9fdcbae5e2
commit 7782e0a0ea

View file

@ -18,6 +18,7 @@
#include "id128-util.h"
#include "main-func.h"
#include "missing_capability.h"
#include "nscd-flush.h"
#include "os-util.h"
#include "parse-util.h"
#include "path-util.h"
@ -286,6 +287,8 @@ static int context_update_kernel_hostname(Context *c) {
if (sethostname_idempotent(hn) < 0)
return -errno;
(void) nscd_flush_cache(STRV_MAKE("hosts"));
return 0;
}