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