diff --git a/src/tools/common/sss_tools.c b/src/tools/common/sss_tools.c index f8a7d280517..d4b3cb1d0d2 100644 --- a/src/tools/common/sss_tools.c +++ b/src/tools/common/sss_tools.c @@ -26,7 +26,6 @@ #include "config.h" #include "util/util.h" #include "confdb/confdb.h" -#include "confdb/confdb_setup.h" #include "db/sysdb.h" #include "tools/common/sss_tools.h" @@ -94,18 +93,25 @@ static errno_t sss_tool_confdb_init(TALLOC_CTX *mem_ctx, struct confdb_ctx *confdb; char *path; errno_t ret; + struct stat statbuf; path = talloc_asprintf(mem_ctx, "%s/%s", DB_PATH, CONFDB_FILE); if (path == NULL) { return ENOMEM; } - ret = confdb_setup(mem_ctx, path, - SSSD_CONFIG_FILE, CONFDB_DEFAULT_CONFIG_DIR, - NULL, false, &confdb); + ret = stat(path, &statbuf); + if (ret != 0) { + ret = errno; + DEBUG(SSSDBG_FATAL_FAILURE, + "Can't access '%s', probably SSSD isn't running\n", path); + return ret; + } + + ret = confdb_init(mem_ctx, &confdb, path); talloc_zfree(path); if (ret != EOK) { - DEBUG(SSSDBG_FATAL_FAILURE, "Unable to setup ConfDB [%d]: %s\n", + DEBUG(SSSDBG_FATAL_FAILURE, "Unable to connect to configDB [%d]: %s\n", ret, sss_strerror(ret)); return ret; }