From a004873f367b026fd033d4aa0bfa4225555c346e Mon Sep 17 00:00:00 2001 From: Michal Zidek Date: Tue, 2 Oct 2012 13:10:55 +0200 Subject: 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/-?. --- src/tools/sss_seed.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/tools/sss_seed.c') 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); -- cgit