summaryrefslogtreecommitdiffstats
path: root/src/tools
diff options
context:
space:
mode:
authorOndrej Kos <okos@redhat.com>2012-11-08 14:34:36 +0100
committerJakub Hrozek <jhrozek@redhat.com>2012-11-19 13:39:52 +0100
commit3e454b5de596f2e4d1b4d9df4cc33aeec7a5af5f (patch)
treee1344cbc38b25555a616b52e31fc6d784915e423 /src/tools
parent28556a5a26eefb496ab1ffd6fbdacec336f45d20 (diff)
downloadsssd-3e454b5de596f2e4d1b4d9df4cc33aeec7a5af5f.tar.gz
sssd-3e454b5de596f2e4d1b4d9df4cc33aeec7a5af5f.tar.xz
sssd-3e454b5de596f2e4d1b4d9df4cc33aeec7a5af5f.zip
Display more information on DB version crash
https://fedorahosted.org/sssd/ticket/1589 Added check for determining, whether database version is higher or lower than expected. To distinguish it from other errors it uses following retun values (further used for appropriate error message): EMEDIUMTYPE for lower version than expected EUCLEAN for higher version than expected When SSSD or one of it's tools fails on DB version mismatch, new error message is showed suggesting how to proceed.
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/sss_cache.c2
-rw-r--r--src/tools/sss_seed.c1
-rw-r--r--src/tools/tools_util.c1
3 files changed, 4 insertions, 0 deletions
diff --git a/src/tools/sss_cache.c b/src/tools/sss_cache.c
index 267b8ac45..dfc58a7cd 100644
--- a/src/tools/sss_cache.c
+++ b/src/tools/sss_cache.c
@@ -339,6 +339,7 @@ errno_t init_domains(struct cache_tool_ctx *ctx, const char *domain)
ret = sysdb_init_domain_and_sysdb(ctx, ctx->confdb, domain, DB_PATH,
&ctx->domains, &db_ctx);
if (ret != EOK) {
+ SYSDB_VERSION_ERROR(ret);
DEBUG(1, ("Could not initialize connection to the sysdb\n"));
goto fail;
}
@@ -350,6 +351,7 @@ errno_t init_domains(struct cache_tool_ctx *ctx, const char *domain)
}
} else {
ret = sysdb_init(ctx, ctx->confdb, NULL, false, &ctx->sysdb_list);
+ SYSDB_VERSION_ERROR(ret);
if (ret != EOK) {
DEBUG(1, ("Could not initialize connection to the sysdb\n"));
goto fail;
diff --git a/src/tools/sss_seed.c b/src/tools/sss_seed.c
index 18d0b9d08..8eaf95936 100644
--- a/src/tools/sss_seed.c
+++ b/src/tools/sss_seed.c
@@ -631,6 +631,7 @@ static int seed_init_db(TALLOC_CTX *mem_ctx,
ret = sysdb_init_domain_and_sysdb(tmp_ctx, confdb, domain_name,
DB_PATH, &domain, &sysdb);
if (ret != EOK) {
+ SYSDB_VERSION_ERROR(ret);
DEBUG(SSSDBG_CRIT_FAILURE,
("Could not initialize connection to domain '%s' in sysdb.%s\n",
domain_name, ret == ENOENT ? " Domain not found." : ""));
diff --git a/src/tools/tools_util.c b/src/tools/tools_util.c
index 99b79f171..73e94136c 100644
--- a/src/tools/tools_util.c
+++ b/src/tools/tools_util.c
@@ -57,6 +57,7 @@ static int setup_db(struct tools_ctx *ctx)
ret = sysdb_init_domain_and_sysdb(ctx, ctx->confdb, "local", DB_PATH,
&ctx->local, &ctx->sysdb);
if (ret != EOK) {
+ SYSDB_VERSION_ERROR(ret);
DEBUG(1, ("Could not initialize connection to the sysdb\n"));
return ret;
}