Skip to content

Commit

Permalink
confdb: chande debug level when no domain are found in confdb_get_dom…
Browse files Browse the repository at this point in the history
…ains

We print the error as fatal error in the monitor to make sure the
message is correctly visible. However, the error is not fatal for tools
like sss_cache and it should not be printed there by default.

Since the tools have default debug level set to SSSDBG_FATAL_FAILURE, it
is sufficient to just drop the level to critical.

Resolves: #6387

Reviewed-by: Alejandro López <allopez@redhat.com>
Reviewed-by: Sumit Bose <sbose@redhat.com>
  • Loading branch information
pbrezina committed Oct 13, 2022
1 parent 64c22dd commit df55b1f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/confdb/confdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1796,11 +1796,10 @@ int confdb_get_domains(struct confdb_ctx *cdb,

ret = confdb_get_enabled_domain_list(cdb, tmp_ctx, &domlist);
if (ret == ENOENT) {
DEBUG(SSSDBG_FATAL_FAILURE, "No domains configured, fatal error!\n");
DEBUG(SSSDBG_CRIT_FAILURE, "No domains configured, fatal error!\n");
ret = ERR_NO_DOMAIN_ENABLED;
goto done;
}
if (ret != EOK) {
} else if (ret != EOK) {
DEBUG(SSSDBG_FATAL_FAILURE, "Fatal error retrieving domains list!\n");
goto done;
}
Expand Down
5 changes: 3 additions & 2 deletions src/monitor/monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -2564,9 +2564,10 @@ int main(int argc, const char *argv[])
break;
default:
DEBUG(SSSDBG_FATAL_FAILURE,
"SSSD couldn't load the configuration database.\n");
"SSSD couldn't load the configuration database [%d]: %s\n",
ret, sss_strerror(ret));
sss_log(SSS_LOG_CRIT,
"SSSD couldn't load the configuration database [%d]: %s.\n",
"SSSD couldn't load the configuration database [%d]: %s\n",
ret, sss_strerror(ret));
break;
}
Expand Down

0 comments on commit df55b1f

Please sign in to comment.