'ima',
'initrd',
'compat-mutable-uid-boundaries',
+ 'nscd',
'ldconfig',
'localed',
'logind',
['idn'],
['initrd'],
['compat-mutable-uid-boundaries'],
+ ['nscd'],
['libidn2'],
['libidn'],
['libiptc'],
description : 'install services for use when running systemd in initrd')
option('compat-mutable-uid-boundaries', type : 'boolean', value : 'false',
description : 'look at uid boundaries in /etc/login.defs for compatibility')
+option('nscd', type : 'boolean',
+ description : 'build support for flushing of the nscd caches')
option('quotaon-path', type : 'string', description : 'path to quotaon')
option('quotacheck-path', type : 'string', description : 'path to quotacheck')
#include "strv.h"
#include "user-util.h"
+#if ENABLE_NSCD
static int on_nscd_cache_flush_event(sd_event_source *s, void *userdata) {
/* Let's ask glibc's nscd daemon to flush its caches. We request this for the three database machines may show
* up in: the hosts database (for resolvable machine names) and the user and group databases (for the user ns
return 0;
}
+#endif
int manager_find_machine_for_uid(Manager *m, uid_t uid, Machine **ret_machine, uid_t *ret_internal_uid) {
Machine *machine;
hashmap_free(m->image_cache);
sd_event_source_unref(m->image_cache_defer_event);
+#if ENABLE_NSCD
sd_event_source_unref(m->nscd_cache_flush_event);
+#endif
bus_verify_polkit_async_registry_free(m->polkit_registry);
LIST_HEAD(Operation, operations);
unsigned n_operations;
+#if ENABLE_NSCD
sd_event_source *nscd_cache_flush_event;
+#endif
VarlinkServer *varlink_server;
};
int manager_unit_is_active(Manager *manager, const char *unit);
int manager_job_is_active(Manager *manager, const char *path);
+#if ENABLE_NSCD
int manager_enqueue_nscd_cache_flush(Manager *m);
+#else
+static inline void manager_enqueue_nscd_cache_flush(Manager *m) {}
+#endif
int manager_find_machine_for_uid(Manager *m, uid_t host_uid, Machine **ret_machine, uid_t *ret_internal_uid);
int manager_find_machine_for_gid(Manager *m, gid_t host_gid, Machine **ret_machine, gid_t *ret_internal_gid);
net-condition.h
netif-naming-scheme.c
netif-naming-scheme.h
- nscd-flush.c
nscd-flush.h
nsflags.c
nsflags.h
'''.split())
endif
+if conf.get('ENABLE_NSCD') == 1
+ shared_sources += files('nscd-flush.c')
+endif
+
generate_ip_protocol_list = find_program('generate-ip-protocol-list.sh')
ip_protocol_list_txt = custom_target(
'ip-protocol-list.txt',
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
+#if ENABLE_NSCD
int nscd_flush_cache(char **databases);
+#else
+static inline void nscd_flush_cache(char **databases) {}
+#endif
libblkid],
'', 'manual'],
- [['src/test/test-nscd-flush.c'],
- [libcore,
- libshared],
- [threads,
- librt,
- libseccomp,
- libselinux,
- libmount,
- libblkid],
- '', 'manual'],
-
[['src/test/test-loopback.c'],
[libcore,
libshared],
[libdl]],
]
+if conf.get('ENABLE_NSCD') == 1
+ tests += [
+ [['src/test/test-nscd-flush.c'],
+ [libcore,
+ libshared],
+ [threads,
+ librt,
+ libseccomp,
+ libselinux,
+ libmount,
+ libblkid],
+ '', 'manual']]
+endif
+
############################################################
# define some tests here, because the link_with deps were not defined earlier