summaryrefslogtreecommitdiffstats
path: root/src/util
diff options
context:
space:
mode:
authorPavel Březina <pbrezina@redhat.com>2011-08-08 11:00:48 +0200
committerStephen Gallagher <sgallagh@redhat.com>2011-08-08 10:23:43 -0400
commit96ea25cbd9b94d48c57b6173eeda2b3fbe670a70 (patch)
tree44ef8d94a0bfb793af2a4f4ef289d6b265ab8b3b /src/util
parent8a07521b413a3b5879f824e1872c5770c92ee5c0 (diff)
downloadsssd-96ea25cbd9b94d48c57b6173eeda2b3fbe670a70.tar.gz
sssd-96ea25cbd9b94d48c57b6173eeda2b3fbe670a70.tar.xz
sssd-96ea25cbd9b94d48c57b6173eeda2b3fbe670a70.zip
debug_timestamps fixes
Fixed: could not overwrite debug_timestamps when set in sssd.conf Fixed: invalid description of debug_timestamps in sssd man page
Diffstat (limited to 'src/util')
-rw-r--r--src/util/debug.c2
-rw-r--r--src/util/server.c22
-rw-r--r--src/util/util.h3
3 files changed, 16 insertions, 11 deletions
diff --git a/src/util/debug.c b/src/util/debug.c
index 18bfda428..e9ed8ae15 100644
--- a/src/util/debug.c
+++ b/src/util/debug.c
@@ -34,7 +34,7 @@
const char *debug_prg_name = "sssd";
int debug_level = SSS_UNRESOLVED_DEBUG_LEVEL;
-int debug_timestamps = 1;
+int debug_timestamps = SSSDBG_TIMESTAMP_UNRESOLVED;
int debug_to_file = 0;
const char *debug_log_file = "sssd";
diff --git a/src/util/server.c b/src/util/server.c
index d33c5cb15..7d16d0484 100644
--- a/src/util/server.c
+++ b/src/util/server.c
@@ -473,17 +473,19 @@ int server_setup(const char *name, int flags,
}
/* same for debug timestamps */
- dt = (debug_timestamps != 0);
- ret = confdb_get_bool(ctx->confdb_ctx, ctx, conf_entry,
- CONFDB_SERVICE_DEBUG_TIMESTAMPS,
- dt, &dt);
- if (ret != EOK) {
- DEBUG(0, ("Error reading from confdb (%d) [%s]\n",
- ret, strerror(ret)));
- return ret;
+ if (debug_timestamps == SSSDBG_TIMESTAMP_UNRESOLVED) {
+ ret = confdb_get_bool(ctx->confdb_ctx, ctx, conf_entry,
+ CONFDB_SERVICE_DEBUG_TIMESTAMPS,
+ SSSDBG_TIMESTAMP_DEFAULT,
+ &dt);
+ if (ret != EOK) {
+ DEBUG(0, ("Error reading from confdb (%d) [%s]\n",
+ ret, strerror(ret)));
+ return ret;
+ }
+ if (dt) debug_timestamps = 1;
+ else debug_timestamps = 0;
}
- if (dt) debug_timestamps = 1;
- else debug_timestamps = 0;
/* same for debug to file */
dl = (debug_to_file != 0);
diff --git a/src/util/util.h b/src/util/util.h
index a59603d04..3ff5f6292 100644
--- a/src/util/util.h
+++ b/src/util/util.h
@@ -62,6 +62,9 @@ errno_t set_debug_file_from_fd(const int fd);
#define SSS_DEFAULT_DEBUG_LEVEL 0
#define SSS_UNRESOLVED_DEBUG_LEVEL -1
+#define SSSDBG_TIMESTAMP_UNRESOLVED -1
+#define SSSDBG_TIMESTAMP_DEFAULT 1
+
#define SSSD_DEBUG_OPTS \
{"debug-level", 'd', POPT_ARG_INT, &debug_level, 0, \
_("Debug level"), NULL}, \