mirror of
https://github.com/systemd/systemd
synced 2024-10-06 16:21:34 +00:00
Make support for nscd flushing optional
Fedora will deprecate support for nscd in the upcoming release [1] and plans to drop it in the next one [2]. At that point we might as well build systemd without that support too, since there'll be nothing to talk too. [1] https://fedoraproject.org/wiki/Changes/DeprecateNSCD [2] https://fedoraproject.org/wiki/Changes/RemoveNSCD
This commit is contained in:
parent
e0f90ad988
commit
7e0079f95f
|
@ -1460,6 +1460,7 @@ foreach term : ['analyze',
|
||||||
'ima',
|
'ima',
|
||||||
'initrd',
|
'initrd',
|
||||||
'compat-mutable-uid-boundaries',
|
'compat-mutable-uid-boundaries',
|
||||||
|
'nscd',
|
||||||
'ldconfig',
|
'ldconfig',
|
||||||
'localed',
|
'localed',
|
||||||
'logind',
|
'logind',
|
||||||
|
@ -3763,6 +3764,7 @@ foreach tuple : [
|
||||||
['idn'],
|
['idn'],
|
||||||
['initrd'],
|
['initrd'],
|
||||||
['compat-mutable-uid-boundaries'],
|
['compat-mutable-uid-boundaries'],
|
||||||
|
['nscd'],
|
||||||
['libidn2'],
|
['libidn2'],
|
||||||
['libidn'],
|
['libidn'],
|
||||||
['libiptc'],
|
['libiptc'],
|
||||||
|
|
|
@ -44,6 +44,8 @@ option('initrd', type : 'boolean',
|
||||||
description : 'install services for use when running systemd in initrd')
|
description : 'install services for use when running systemd in initrd')
|
||||||
option('compat-mutable-uid-boundaries', type : 'boolean', value : 'false',
|
option('compat-mutable-uid-boundaries', type : 'boolean', value : 'false',
|
||||||
description : 'look at uid boundaries in /etc/login.defs for compatibility')
|
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('quotaon-path', type : 'string', description : 'path to quotaon')
|
||||||
option('quotacheck-path', type : 'string', description : 'path to quotacheck')
|
option('quotacheck-path', type : 'string', description : 'path to quotacheck')
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
#include "strv.h"
|
#include "strv.h"
|
||||||
#include "user-util.h"
|
#include "user-util.h"
|
||||||
|
|
||||||
|
#if ENABLE_NSCD
|
||||||
static int on_nscd_cache_flush_event(sd_event_source *s, void *userdata) {
|
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
|
/* 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
|
* up in: the hosts database (for resolvable machine names) and the user and group databases (for the user ns
|
||||||
|
@ -35,6 +36,7 @@ int manager_enqueue_nscd_cache_flush(Manager *m) {
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
int manager_find_machine_for_uid(Manager *m, uid_t uid, Machine **ret_machine, uid_t *ret_internal_uid) {
|
int manager_find_machine_for_uid(Manager *m, uid_t uid, Machine **ret_machine, uid_t *ret_internal_uid) {
|
||||||
Machine *machine;
|
Machine *machine;
|
||||||
|
|
|
@ -83,7 +83,9 @@ static Manager* manager_unref(Manager *m) {
|
||||||
hashmap_free(m->image_cache);
|
hashmap_free(m->image_cache);
|
||||||
|
|
||||||
sd_event_source_unref(m->image_cache_defer_event);
|
sd_event_source_unref(m->image_cache_defer_event);
|
||||||
|
#if ENABLE_NSCD
|
||||||
sd_event_source_unref(m->nscd_cache_flush_event);
|
sd_event_source_unref(m->nscd_cache_flush_event);
|
||||||
|
#endif
|
||||||
|
|
||||||
bus_verify_polkit_async_registry_free(m->polkit_registry);
|
bus_verify_polkit_async_registry_free(m->polkit_registry);
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,9 @@ struct Manager {
|
||||||
LIST_HEAD(Operation, operations);
|
LIST_HEAD(Operation, operations);
|
||||||
unsigned n_operations;
|
unsigned n_operations;
|
||||||
|
|
||||||
|
#if ENABLE_NSCD
|
||||||
sd_event_source *nscd_cache_flush_event;
|
sd_event_source *nscd_cache_flush_event;
|
||||||
|
#endif
|
||||||
|
|
||||||
VarlinkServer *varlink_server;
|
VarlinkServer *varlink_server;
|
||||||
};
|
};
|
||||||
|
@ -57,7 +59,11 @@ int manager_unref_unit(Manager *m, const char *unit, sd_bus_error *error);
|
||||||
int manager_unit_is_active(Manager *manager, const char *unit);
|
int manager_unit_is_active(Manager *manager, const char *unit);
|
||||||
int manager_job_is_active(Manager *manager, const char *path);
|
int manager_job_is_active(Manager *manager, const char *path);
|
||||||
|
|
||||||
|
#if ENABLE_NSCD
|
||||||
int manager_enqueue_nscd_cache_flush(Manager *m);
|
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_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);
|
int manager_find_machine_for_gid(Manager *m, gid_t host_gid, Machine **ret_machine, gid_t *ret_internal_gid);
|
||||||
|
|
|
@ -173,7 +173,6 @@ shared_sources = files('''
|
||||||
net-condition.h
|
net-condition.h
|
||||||
netif-naming-scheme.c
|
netif-naming-scheme.c
|
||||||
netif-naming-scheme.h
|
netif-naming-scheme.h
|
||||||
nscd-flush.c
|
|
||||||
nscd-flush.h
|
nscd-flush.h
|
||||||
nsflags.c
|
nsflags.c
|
||||||
nsflags.h
|
nsflags.h
|
||||||
|
@ -308,6 +307,10 @@ if conf.get('HAVE_PAM') == 1
|
||||||
'''.split())
|
'''.split())
|
||||||
endif
|
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')
|
generate_ip_protocol_list = find_program('generate-ip-protocol-list.sh')
|
||||||
ip_protocol_list_txt = custom_target(
|
ip_protocol_list_txt = custom_target(
|
||||||
'ip-protocol-list.txt',
|
'ip-protocol-list.txt',
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#if ENABLE_NSCD
|
||||||
int nscd_flush_cache(char **databases);
|
int nscd_flush_cache(char **databases);
|
||||||
|
#else
|
||||||
|
static inline void nscd_flush_cache(char **databases) {}
|
||||||
|
#endif
|
||||||
|
|
|
@ -92,17 +92,6 @@ tests += [
|
||||||
libblkid],
|
libblkid],
|
||||||
'', 'manual'],
|
'', 'manual'],
|
||||||
|
|
||||||
[['src/test/test-nscd-flush.c'],
|
|
||||||
[libcore,
|
|
||||||
libshared],
|
|
||||||
[threads,
|
|
||||||
librt,
|
|
||||||
libseccomp,
|
|
||||||
libselinux,
|
|
||||||
libmount,
|
|
||||||
libblkid],
|
|
||||||
'', 'manual'],
|
|
||||||
|
|
||||||
[['src/test/test-loopback.c'],
|
[['src/test/test-loopback.c'],
|
||||||
[libcore,
|
[libcore,
|
||||||
libshared],
|
libshared],
|
||||||
|
@ -827,6 +816,20 @@ tests += [
|
||||||
[libdl]],
|
[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
|
# define some tests here, because the link_with deps were not defined earlier
|
||||||
|
|
Loading…
Reference in a new issue