diff options
author | Michal Zidek <mzidek@redhat.com> | 2012-10-02 13:10:55 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2012-10-03 20:25:09 +0200 |
commit | a004873f367b026fd033d4aa0bfa4225555c346e (patch) | |
tree | 2901d327eb8aafbb4614e854f0b8adf31f0a917b /src/tools/sss_seed.c | |
parent | 813086b16adabc6c1a0f37d7518c6a709ae1c57a (diff) | |
download | sssd-a004873f367b026fd033d4aa0bfa4225555c346e.tar.gz sssd-a004873f367b026fd033d4aa0bfa4225555c346e.tar.xz sssd-a004873f367b026fd033d4aa0bfa4225555c346e.zip |
sss_seed: Option --debug did not work in sss_seed tool.
debug_level was set before the parameters were parsed, so the
default debug_level value was always used. Also CHECK_ROOT
macro was used on bad place, so only root was able to
run sss_seed --help/-?.
Diffstat (limited to 'src/tools/sss_seed.c')
-rw-r--r-- | src/tools/sss_seed.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/tools/sss_seed.c b/src/tools/sss_seed.c index 372678963..9f0dafe45 100644 --- a/src/tools/sss_seed.c +++ b/src/tools/sss_seed.c @@ -446,8 +446,6 @@ static int seed_init(TALLOC_CTX *mem_ctx, } debug_prg_name = argv[0]; - debug_level = debug_convert_old_level(pc_debug); - ret = set_locale(); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, ("set_locale failed (%d): %s\n", @@ -457,8 +455,6 @@ static int seed_init(TALLOC_CTX *mem_ctx, goto fini; } - CHECK_ROOT(ret, argv[0]); - /* parse arguments */ pc = poptGetContext(NULL, argc, argv, options, 0); if (argc < 2) { @@ -481,6 +477,10 @@ static int seed_init(TALLOC_CTX *mem_ctx, BAD_POPT_PARAMS(pc, poptStrerror(ret), ret, fini); } + debug_level = debug_convert_old_level(pc_debug); + + CHECK_ROOT(ret, argv[0]); + /* check username provided */ if (pc_name == NULL) { BAD_POPT_PARAMS(pc, _("Username must be specified\n"), ret, fini); |