diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2009-11-24 21:16:40 +0100 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2009-12-01 15:59:38 -0500 |
commit | 3fc84f21bd715c4cece722231af933a1981bb6e7 (patch) | |
tree | 8fa09c64af1c47616db575b10def6ad1b62f8b49 | |
parent | 6a1deabbc1918de34de65595142bbb2895d90ed9 (diff) | |
download | sssd-3fc84f21bd715c4cece722231af933a1981bb6e7.tar.gz sssd-3fc84f21bd715c4cece722231af933a1981bb6e7.tar.bz2 sssd-3fc84f21bd715c4cece722231af933a1981bb6e7.zip |
Better error message when there is no local domain configured
Fixes: #235
-rw-r--r-- | server/tools/sss_groupadd.c | 6 | ||||
-rw-r--r-- | server/tools/sss_groupdel.c | 6 | ||||
-rw-r--r-- | server/tools/sss_groupmod.c | 6 | ||||
-rw-r--r-- | server/tools/sss_useradd.c | 6 | ||||
-rw-r--r-- | server/tools/sss_userdel.c | 6 | ||||
-rw-r--r-- | server/tools/sss_usermod.c | 6 | ||||
-rw-r--r-- | server/tools/tools_util.c | 2 |
7 files changed, 31 insertions, 7 deletions
diff --git a/server/tools/sss_groupadd.c b/server/tools/sss_groupadd.c index 82d4573d..15eed100 100644 --- a/server/tools/sss_groupadd.c +++ b/server/tools/sss_groupadd.c @@ -82,7 +82,11 @@ int main(int argc, const char **argv) ret = init_sss_tools(&tctx); if (ret != EOK) { DEBUG(1, ("init_sss_tools failed (%d): %s\n", ret, strerror(ret))); - ERROR("Error initializing the tools\n"); + if (ret == ENOENT) { + ERROR("Error initializing the tools - no local domain\n"); + } else { + ERROR("Error initializing the tools\n"); + } ret = EXIT_FAILURE; goto fini; } diff --git a/server/tools/sss_groupdel.c b/server/tools/sss_groupdel.c index 84ea0be4..e5b043e2 100644 --- a/server/tools/sss_groupdel.c +++ b/server/tools/sss_groupdel.c @@ -77,7 +77,11 @@ int main(int argc, const char **argv) ret = init_sss_tools(&tctx); if (ret != EOK) { DEBUG(1, ("init_sss_tools failed (%d): %s\n", ret, strerror(ret))); - ERROR("Error initializing the tools\n"); + if (ret == ENOENT) { + ERROR("Error initializing the tools - no local domain\n"); + } else { + ERROR("Error initializing the tools\n"); + } ret = EXIT_FAILURE; goto fini; } diff --git a/server/tools/sss_groupmod.c b/server/tools/sss_groupmod.c index d3a35988..b25a018d 100644 --- a/server/tools/sss_groupmod.c +++ b/server/tools/sss_groupmod.c @@ -107,7 +107,11 @@ int main(int argc, const char **argv) ret = init_sss_tools(&tctx); if (ret != EOK) { DEBUG(1, ("init_sss_tools failed (%d): %s\n", ret, strerror(ret))); - ERROR("Error initializing the tools\n"); + if (ret == ENOENT) { + ERROR("Error initializing the tools - no local domain\n"); + } else { + ERROR("Error initializing the tools\n"); + } ret = EXIT_FAILURE; goto fini; } diff --git a/server/tools/sss_useradd.c b/server/tools/sss_useradd.c index 94de68fd..077ac99f 100644 --- a/server/tools/sss_useradd.c +++ b/server/tools/sss_useradd.c @@ -179,7 +179,11 @@ int main(int argc, const char **argv) ret = init_sss_tools(&tctx); if (ret != EOK) { DEBUG(1, ("init_sss_tools failed (%d): %s\n", ret, strerror(ret))); - ERROR("Error initializing the tools\n"); + if (ret == ENOENT) { + ERROR("Error initializing the tools - no local domain\n"); + } else { + ERROR("Error initializing the tools\n"); + } ret = EXIT_FAILURE; goto fini; } diff --git a/server/tools/sss_userdel.c b/server/tools/sss_userdel.c index d34466e7..e84d78b1 100644 --- a/server/tools/sss_userdel.c +++ b/server/tools/sss_userdel.c @@ -98,7 +98,11 @@ int main(int argc, const char **argv) ret = init_sss_tools(&tctx); if (ret != EOK) { DEBUG(1, ("init_sss_tools failed (%d): %s\n", ret, strerror(ret))); - ERROR("Error initializing the tools\n"); + if (ret == ENOENT) { + ERROR("Error initializing the tools - no local domain\n"); + } else { + ERROR("Error initializing the tools\n"); + } ret = EXIT_FAILURE; goto fini; } diff --git a/server/tools/sss_usermod.c b/server/tools/sss_usermod.c index 733f9982..a272bc55 100644 --- a/server/tools/sss_usermod.c +++ b/server/tools/sss_usermod.c @@ -122,7 +122,11 @@ int main(int argc, const char **argv) ret = init_sss_tools(&tctx); if (ret != EOK) { DEBUG(1, ("init_sss_tools failed (%d): %s\n", ret, strerror(ret))); - ERROR("Error initializing the tools\n"); + if (ret == ENOENT) { + ERROR("Error initializing the tools - no local domain\n"); + } else { + ERROR("Error initializing the tools\n"); + } ret = EXIT_FAILURE; goto fini; } diff --git a/server/tools/tools_util.c b/server/tools/tools_util.c index bcb8d5c1..b509ccb2 100644 --- a/server/tools/tools_util.c +++ b/server/tools/tools_util.c @@ -64,7 +64,7 @@ static int setup_db(struct tools_ctx *ctx) ret = confdb_get_domain(ctx->confdb, "local", &ctx->local); if (ret != EOK) { - DEBUG(1, ("Could not get 'local' domain\n")); + DEBUG(1, ("Could not get 'local' domain: [%d] [%s]\n", ret, strerror(ret))); return ret; } |