Merge pull request #11086 from poettering/nscd-cache-flush

flush nscd's caches when we register user/groups/hostnames
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2018-12-17 11:29:58 +01:00
committed by GitHub
12 changed files with 254 additions and 7 deletions
+11
View File
@@ -94,6 +94,17 @@ tests += [
libblkid],
'', 'manual'],
[['src/test/test-nscd-flush.c'],
[libcore,
libshared],
[threads,
librt,
libseccomp,
libselinux,
libmount,
libblkid],
'', 'manual'],
[['src/test/test-loopback.c'],
[libcore,
libshared],
+20
View File
@@ -0,0 +1,20 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#include "main-func.h"
#include "nscd-flush.h"
#include "strv.h"
#include "tests.h"
static int run(int argc, char *argv[]) {
int r;
test_setup_logging(LOG_DEBUG);
r = nscd_flush_cache(STRV_MAKE("group", "passwd", "hosts"));
if (r < 0)
return log_error_errno(r, "Failed to flush NSCD cache");
return 0;
}
DEFINE_MAIN_FUNCTION(run);