summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Zidek <mzidek@redhat.com>2012-11-19 13:10:39 +0100
committerJakub Hrozek <jhrozek@redhat.com>2012-11-27 11:21:38 +0100
commit962333af01aff50cb2cbe536dc263d942d394a20 (patch)
treea0631b14f39510ee0cfc55a2fccf70dbb95db3bd
parentf3d76a84c5cb9fe872114824018d9fbee52f691a (diff)
downloadsssd-962333af01aff50cb2cbe536dc263d942d394a20.tar.gz
sssd-962333af01aff50cb2cbe536dc263d942d394a20.tar.xz
sssd-962333af01aff50cb2cbe536dc263d942d394a20.zip
debug: print fatal and critical errors if debug level is unresolved
If global variable debug_level has value SSSDBG_UNRESOLVED, we should print at least fatal and critical errors. https://fedorahosted.org/sssd/ticket/1345
-rw-r--r--src/monitor/monitor.c6
-rw-r--r--src/util/util.h5
2 files changed, 4 insertions, 7 deletions
diff --git a/src/monitor/monitor.c b/src/monitor/monitor.c
index 8e73ff66d..afec0b95f 100644
--- a/src/monitor/monitor.c
+++ b/src/monitor/monitor.c
@@ -2752,12 +2752,6 @@ int main(int argc, const char *argv[])
/* Parse config file, fail if cannot be done */
ret = load_configuration(tmp_ctx, config_file, &monitor);
if (ret != EOK) {
- /* if debug level has not been set, set it manually to make these
- * critical failures visible */
- if (debug_level == SSSDBG_UNRESOLVED) {
- debug_level = SSSDBG_MASK_ALL;
- }
-
if (ret == EPERM) {
DEBUG(1, ("Cannot read configuration file %s\n", config_file));
sss_log(SSS_LOG_ALERT,
diff --git a/src/util/util.h b/src/util/util.h
index 9e55e5065..1f7c6c344 100644
--- a/src/util/util.h
+++ b/src/util/util.h
@@ -193,7 +193,10 @@ errno_t set_debug_file_from_fd(const int fd);
\param level the debug level, please use one of the SSSDBG*_ macros
*/
-#define DEBUG_IS_SET(level) (debug_level & (level))
+#define DEBUG_IS_SET(level) (debug_level & (level) || \
+ (debug_level == SSSDBG_UNRESOLVED && \
+ (level & (SSSDBG_FATAL_FAILURE | \
+ SSSDBG_CRIT_FAILURE))))
#define CONVERT_AND_SET_DEBUG_LEVEL(new_value) debug_level = ( \
((new_value) != SSSDBG_INVALID) \