Resolves: rhbz#1721636 - sssd-kcm calls sssd-genconf which triggers nscd warning

(cherry picked from commit 7f0d43352a)
(cherry picked from commit 9fb549e162)
This commit is contained in:
Jakub Hrozek 2019-07-05 16:45:48 +02:00
parent 5e6e4461d9
commit 93f4fd4069
2 changed files with 112 additions and 1 deletions

View File

@ -0,0 +1,106 @@
From 0a10d863f4186a18d4622e72065c8aa66b6bfa17 Mon Sep 17 00:00:00 2001
From: Jakub Hrozek <jhrozek@redhat.com>
Date: Tue, 18 Jun 2019 21:21:08 +0200
Subject: [PATCH] MONITOR: Don't check for the nscd socket while regenerating
configuration
https://pagure.io/SSSD/sssd/issue/4028
In setups where only sssd-kcm is used and not the rest of SSSD, seeing
the nscd warning might be irritating.
Reviewed-by: Alexey Tikhonov <atikhono@redhat.com>
---
src/monitor/monitor.c | 69 ++++++++++++++++++++++---------------------
1 file changed, 35 insertions(+), 34 deletions(-)
diff --git a/src/monitor/monitor.c b/src/monitor/monitor.c
index 33a28a09f..d3f8c8878 100644
--- a/src/monitor/monitor.c
+++ b/src/monitor/monitor.c
@@ -2480,40 +2480,8 @@ int main(int argc, const char *argv[])
}
#endif
- /* Warn if nscd seems to be running */
- ret = check_file(NSCD_SOCKET_PATH,
- -1, -1, S_IFSOCK, S_IFMT, NULL, false);
- if (ret == EOK) {
- ret = sss_nscd_parse_conf(NSCD_CONF_PATH);
-
- switch (ret) {
- case ENOENT:
- sss_log(SSS_LOG_NOTICE,
- "NSCD socket was detected. NSCD caching capabilities "
- "may conflict with SSSD for users and groups. It is "
- "recommended not to run NSCD in parallel with SSSD, "
- "unless NSCD is configured not to cache the passwd, "
- "group, netgroup and services nsswitch maps.");
- break;
-
- case EEXIST:
- sss_log(SSS_LOG_NOTICE,
- "NSCD socket was detected and seems to be configured "
- "to cache some of the databases controlled by "
- "SSSD [passwd,group,netgroup,services]. It is "
- "recommended not to run NSCD in parallel with SSSD, "
- "unless NSCD is configured not to cache these.");
- break;
-
- case EOK:
- DEBUG(SSSDBG_TRACE_FUNC, "NSCD socket was detected and it "
- "seems to be configured not to interfere with "
- "SSSD's caching capabilities\n");
- }
- }
-
- /* Check if the SSSD is already running unless we're only interested
- * in re-reading the configuration
+ /* Check if the SSSD is already running and for nscd conflicts unless we're
+ * only interested in re-reading the configuration
*/
if (opt_genconf == 0) {
ret = check_file(SSSD_PIDFILE, 0, 0, S_IFREG|0600, 0, NULL, false);
@@ -2523,6 +2491,39 @@ int main(int argc, const char *argv[])
ERROR("SSSD is already running\n");
return 2;
}
+
+ /* Warn if nscd seems to be running */
+ ret = check_file(NSCD_SOCKET_PATH,
+ -1, -1, S_IFSOCK, S_IFMT, NULL, false);
+ if (ret == EOK) {
+ ret = sss_nscd_parse_conf(NSCD_CONF_PATH);
+
+ switch (ret) {
+ case ENOENT:
+ sss_log(SSS_LOG_NOTICE,
+ "NSCD socket was detected. NSCD caching capabilities "
+ "may conflict with SSSD for users and groups. It is "
+ "recommended not to run NSCD in parallel with SSSD, "
+ "unless NSCD is configured not to cache the passwd, "
+ "group, netgroup and services nsswitch maps.");
+ break;
+
+ case EEXIST:
+ sss_log(SSS_LOG_NOTICE,
+ "NSCD socket was detected and seems to be configured "
+ "to cache some of the databases controlled by "
+ "SSSD [passwd,group,netgroup,services]. It is "
+ "recommended not to run NSCD in parallel with SSSD, "
+ "unless NSCD is configured not to cache these.");
+ break;
+
+ case EOK:
+ DEBUG(SSSDBG_TRACE_FUNC, "NSCD socket was detected and it "
+ "seems to be configured not to interfere with "
+ "SSSD's caching capabilities\n");
+ }
+ }
+
}
/* Parse config file, fail if cannot be done */
--
2.20.1

View File

@ -36,7 +36,7 @@
Name: sssd
Version: 2.2.0
Release: 2%{?dist}
Release: 3%{?dist}
Summary: System Security Services Daemon
License: GPLv3+
URL: https://pagure.io/SSSD/sssd/
@ -44,6 +44,7 @@ Source0: https://releases.pagure.org/SSSD/sssd/%{name}-%{version}.tar.gz
### Patches ###
Patch0001: 0001-PROXY-Return-data-in-output-parameter-if-everything-.patch
Patch0002: 0002-MONITOR-Don-t-check-for-the-nscd-socket-while-regene.patch
### Downstream only patches ###
Patch0502: 0502-SYSTEMD-Use-capabilities.patch
@ -1208,6 +1209,10 @@ fi
%{_libdir}/%{name}/modules/libwbclient.so
%changelog
* Fri Jul 5 2019 Jakub Hrozek <jhrozek@redhat.com> - 2.2.0-3
- Resolves: rhbz#1721636 - sssd-kcm calls sssd-genconf which triggers
nscd warning
* Fri Jul 5 2019 Jakub Hrozek <jhrozek@redhat.com> - 2.2.0-2
- Resolves: rhbz#1724717 - sssd-proxy crashes resolving groups with
no members