pgreco / rpms / ipa

Forked from forks/areguera/rpms/ipa 4 years ago
Clone

Blame SOURCES/0018-Log-INFO-message-when-LDAP-connection-fails-on-start.patch

6ec482
From 349014688322df67509f44d51f232237e2a7ca7d Mon Sep 17 00:00:00 2001
6ec482
From: Robbie Harwood <rharwood@redhat.com>
6ec482
Date: Fri, 2 Aug 2019 15:55:20 -0400
6ec482
Subject: [PATCH] Log INFO message when LDAP connection fails on startup
6ec482
6ec482
Since krb5_klog_syslog() always needs parameters from syslog.h, move the
6ec482
include into ipa_krb5.h.
6ec482
6ec482
Signed-off-by: Robbie Harwood <rharwood@redhat.com>
6ec482
Reviewed-By: Christian Heimes <cheimes@redhat.com>
6ec482
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
6ec482
---
6ec482
 daemons/ipa-kdb/ipa_kdb.c          | 6 ++++--
6ec482
 daemons/ipa-kdb/ipa_kdb_audit_as.c | 1 -
6ec482
 daemons/ipa-kdb/ipa_kdb_certauth.c | 1 -
6ec482
 daemons/ipa-kdb/ipa_kdb_mspac.c    | 1 -
6ec482
 util/ipa_krb5.h                    | 1 +
6ec482
 5 files changed, 5 insertions(+), 5 deletions(-)
6ec482
6ec482
diff --git a/daemons/ipa-kdb/ipa_kdb.c b/daemons/ipa-kdb/ipa_kdb.c
6ec482
index c90f8d9caf247874c6bda58eb33c7733c4709b02..0dcc74263263423da6b1f4d8441ee149bce24c58 100644
6ec482
--- a/daemons/ipa-kdb/ipa_kdb.c
6ec482
+++ b/daemons/ipa-kdb/ipa_kdb.c
6ec482
@@ -24,6 +24,7 @@
6ec482
 #include <sys/utsname.h>
6ec482
 
6ec482
 #include "ipa_kdb.h"
6ec482
+#include "ipa_krb5.h"
6ec482
 
6ec482
 #define IPADB_GLOBAL_CONFIG_CACHE_TIME 60
6ec482
 
6ec482
@@ -586,8 +587,9 @@ static krb5_error_code ipadb_init_module(krb5_context kcontext,
6ec482
 
6ec482
     ret = ipadb_get_connection(ipactx);
6ec482
     if (ret != 0) {
6ec482
-        /* not a fatal failure, as the LDAP server may be temporarily down */
6ec482
-        /* TODO: spam syslog with this error */
6ec482
+        /* Not a fatal failure, as the LDAP server may be temporarily down. */
6ec482
+        krb5_klog_syslog(LOG_INFO,
6ec482
+                         "Didn't connect to LDAP on startup: %d", ret);
6ec482
     }
6ec482
 
6ec482
     kerr = krb5_db_set_context(kcontext, ipactx);
6ec482
diff --git a/daemons/ipa-kdb/ipa_kdb_audit_as.c b/daemons/ipa-kdb/ipa_kdb_audit_as.c
6ec482
index c68a67aa2a0ca9a2dc9e7a2d39c60d8b105fcc06..77748a75d6b16ee4d080a5f53213cc58c81660dc 100644
6ec482
--- a/daemons/ipa-kdb/ipa_kdb_audit_as.c
6ec482
+++ b/daemons/ipa-kdb/ipa_kdb_audit_as.c
6ec482
@@ -20,7 +20,6 @@
6ec482
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
6ec482
  */
6ec482
 
6ec482
-#include <syslog.h>
6ec482
 #include "ipa_kdb.h"
6ec482
 #include "ipa_pwd.h"
6ec482
 
6ec482
diff --git a/daemons/ipa-kdb/ipa_kdb_certauth.c b/daemons/ipa-kdb/ipa_kdb_certauth.c
6ec482
index 82589f2f92096400b2f586a65eec962229c3daf7..47911aa3ded56efe4d47acb78d94ccdbcdca7339 100644
6ec482
--- a/daemons/ipa-kdb/ipa_kdb_certauth.c
6ec482
+++ b/daemons/ipa-kdb/ipa_kdb_certauth.c
6ec482
@@ -39,7 +39,6 @@
6ec482
 
6ec482
 #include <errno.h>
6ec482
 //#include <krb5/certauth_plugin.h>
6ec482
-#include <syslog.h>
6ec482
 #include <sss_certmap.h>
6ec482
 
6ec482
 #include "ipa_krb5.h"
6ec482
diff --git a/daemons/ipa-kdb/ipa_kdb_mspac.c b/daemons/ipa-kdb/ipa_kdb_mspac.c
6ec482
index 329a5c11586ccd7004dd17e503133f9fda7e8395..74cbb77cccb45188f7bd8a1a33085f8ef964930f 100644
6ec482
--- a/daemons/ipa-kdb/ipa_kdb_mspac.c
6ec482
+++ b/daemons/ipa-kdb/ipa_kdb_mspac.c
6ec482
@@ -25,7 +25,6 @@
6ec482
 #include "ipa_kdb.h"
6ec482
 #include "ipa_mspac.h"
6ec482
 #include <talloc.h>
6ec482
-#include <syslog.h>
6ec482
 #include <unicase.h>
6ec482
 #include "util/time.h"
6ec482
 #include "gen_ndr/ndr_krb5pac.h"
6ec482
diff --git a/util/ipa_krb5.h b/util/ipa_krb5.h
6ec482
index 60a8ced5d8a63532254b3703801d2aeb9ff45892..b039c1a7f3d0bc215376f8f1dd2ac93e75a0c626 100644
6ec482
--- a/util/ipa_krb5.h
6ec482
+++ b/util/ipa_krb5.h
6ec482
@@ -3,6 +3,7 @@
6ec482
 #include <lber.h>
6ec482
 #include <krb5/krb5.h>
6ec482
 #include <kdb.h>
6ec482
+#include <syslog.h>
6ec482
 
6ec482
 struct krb_key_salt {
6ec482
     krb5_enctype enctype;
6ec482
-- 
6ec482
2.20.1
6ec482