Blame SOURCES/shadow-4.6-sssd-redirect-warning.patch

186eda
From 87257a49a1821d67870aa9760c71b6791583709c Mon Sep 17 00:00:00 2001
186eda
From: ikerexxe <ipedrosa@redhat.com>
186eda
Date: Fri, 2 Oct 2020 16:09:42 +0200
186eda
Subject: [PATCH] lib/sssd: redirect warning message to file
186eda
186eda
Instead of printing warning in stderr print it to file. This way the
186eda
user is not spammed with unnecessary messages when updating packages.
186eda
186eda
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1749001
186eda
---
186eda
 lib/sssd.c | 14 ++++++--------
186eda
 1 file changed, 6 insertions(+), 8 deletions(-)
186eda
186eda
diff --git a/lib/sssd.c b/lib/sssd.c
186eda
index 80e49e55..f864ce68 100644
186eda
--- a/lib/sssd.c
186eda
+++ b/lib/sssd.c
186eda
@@ -11,7 +11,7 @@
186eda
 #include "prototypes.h"
186eda
 #include "sssd.h"
186eda
 
186eda
-#define MSG_SSSD_FLUSH_CACHE_FAILED "%s: Failed to flush the sssd cache.\n"
186eda
+#define MSG_SSSD_FLUSH_CACHE_FAILED "%s: Failed to flush the sssd cache."
186eda
 
186eda
 int sssd_flush_cache (int dbflags)
186eda
 {
186eda
@@ -46,24 +46,22 @@ int sssd_flush_cache (int dbflags)
186eda
 	free(sss_cache_args);
186eda
 	if (rv != 0) {
186eda
 		/* run_command writes its own more detailed message. */
186eda
-		(void) fprintf (stderr, _(MSG_SSSD_FLUSH_CACHE_FAILED), Prog);
186eda
+		SYSLOG ((LOG_WARN, MSG_SSSD_FLUSH_CACHE_FAILED, Prog));
186eda
 		return -1;
186eda
 	}
186eda
 
186eda
 	code = WEXITSTATUS (status);
186eda
 	if (!WIFEXITED (status)) {
186eda
-		(void) fprintf (stderr,
186eda
-		                _("%s: sss_cache did not terminate normally (signal %d)\n"),
186eda
-		                Prog, WTERMSIG (status));
186eda
+		SYSLOG ((LOG_WARN, "%s: sss_cache did not terminate normally (signal %d)",
186eda
+			Prog, WTERMSIG (status)));
186eda
 		return -1;
186eda
 	} else if (code == E_CMD_NOTFOUND) {
186eda
 		/* sss_cache is not installed, or it is installed but uses an
186eda
 		   interpreter that is missing.  Probably the former. */
186eda
 		return 0;
186eda
 	} else if (code != 0) {
186eda
-		(void) fprintf (stderr, _("%s: sss_cache exited with status %d\n"),
186eda
-		                Prog, code);
186eda
-		(void) fprintf (stderr, _(MSG_SSSD_FLUSH_CACHE_FAILED), Prog);
186eda
+		SYSLOG ((LOG_WARN, "%s: sss_cache exited with status %d", Prog, code));
186eda
+		SYSLOG ((LOG_WARN, MSG_SSSD_FLUSH_CACHE_FAILED, Prog));
186eda
 		return -1;
186eda
 	}
186eda
 
186eda
-- 
186eda
2.26.2
186eda