From 2622392fe96c7203c50a7735f7653905bb4a1f46 Mon Sep 17 00:00:00 2001 From: Alexey Tikhonov Date: Wed, 30 Oct 2024 10:16:03 +0100 Subject: [PATCH] INI: add verbose error messages --- src/util/sss_ini.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/util/sss_ini.c b/src/util/sss_ini.c index 4ef5feaa002..9958e3af3ec 100644 --- a/src/util/sss_ini.c +++ b/src/util/sss_ini.c @@ -235,8 +235,8 @@ static int sss_ini_add_snippets(struct sss_ini *self, &self->ra_success_list); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - "Failed to augment configuration: Error %d", - ret); + "Failed to augment configuration: %d [%s]\n", + ret, sss_strerror(ret)); } while (ref_array_get(self->ra_error_list, i, &msg) != NULL) { @@ -761,14 +761,14 @@ int sss_ini_open(struct sss_ini *self, strlen(fallback_cfg)); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - "sss_ini_config_file_from_mem failed. Error %d\n", - ret); + "sss_ini_config_file_from_mem() failed: %d [%s]\n", + ret, sss_strerror(ret)); } break; default: DEBUG(SSSDBG_CONF_SETTINGS, - "sss_ini_config_file_open failed: Error %d\n", - ret); + "sss_ini_config_file_open() failed: %d [%s]\n", + ret, sss_strerror(ret)); sss_ini_config_print_errors(self->error_list); break; } @@ -860,9 +860,8 @@ int sss_ini_read_sssd_conf(struct sss_ini *self, ret = sss_ini_open(self, config_file, "[sssd]\n"); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - "sss_ini_open on %s failed: %d\n", - config_file, - ret); + "sss_ini_open() on %s failed: %d [%s]\n", + config_file, ret, sss_strerror(ret)); return ERR_INI_OPEN_FAILED; } @@ -882,8 +881,8 @@ int sss_ini_read_sssd_conf(struct sss_ini *self, ret = sss_ini_add_snippets(self, config_dir); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - "Error while reading configuration directory %s: %d\n", - config_dir, ret); + "Error while reading configuration directory %s: %d [%s]\n", + config_dir, ret, sss_strerror(ret)); return ERR_INI_ADD_SNIPPETS_FAILED; }