diff options
author | Stephen Gallagher <sgallagh@redhat.com> | 2016-04-26 11:04:36 -0400 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2016-06-16 13:36:44 +0200 |
commit | 131684b9107a3fc07906013d16b35975531f2864 (patch) | |
tree | 99a7bd6aedf5f55e521ce66cdfe2d645c50cebf4 /src/util/server.c | |
parent | 60787fb44924e84a0c7ddfe9d5e62e64ea1edcd1 (diff) | |
download | sssd-131684b9107a3fc07906013d16b35975531f2864.tar.gz sssd-131684b9107a3fc07906013d16b35975531f2864.tar.xz sssd-131684b9107a3fc07906013d16b35975531f2864.zip |
DEBUG: Add `debug` alias for debug_level
Our users constantly make the mistake of typing `debug = 9` in the
sssd.conf instead of `debug_level = 9` as would be correct. This
happens frequently-enough that we should just alias it rather than
continue to have people make mistakes.
Resolves:
https://fedorahosted.org/sssd/ticket/2999
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
Reviewed-by: Petr Cech <pcech@redhat.com>
Diffstat (limited to 'src/util/server.c')
-rw-r--r-- | src/util/server.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/util/server.c b/src/util/server.c index 67a259557..074dc3484 100644 --- a/src/util/server.c +++ b/src/util/server.c @@ -567,7 +567,7 @@ int server_setup(const char *name, int flags, /* set debug level if any in conf_entry */ ret = confdb_get_int(ctx->confdb_ctx, conf_entry, CONFDB_SERVICE_DEBUG_LEVEL, - SSSDBG_DEFAULT, + SSSDBG_UNRESOLVED, &debug_level); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, "Error reading from confdb (%d) " @@ -575,6 +575,19 @@ int server_setup(const char *name, int flags, return ret; } + if (debug_level == SSSDBG_UNRESOLVED) { + /* Check for the `debug` alias */ + ret = confdb_get_int(ctx->confdb_ctx, conf_entry, + CONFDB_SERVICE_DEBUG_LEVEL_ALIAS, + SSSDBG_DEFAULT, + &debug_level); + if (ret != EOK) { + DEBUG(SSSDBG_FATAL_FAILURE, "Error reading from confdb (%d) " + "[%s]\n", ret, strerror(ret)); + return ret; + } + } + debug_level = debug_convert_old_level(debug_level); } |