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:
parent
9fdcbae5e2
commit
7782e0a0ea
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue