summaryrefslogtreecommitdiff
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
parent8a07521b413a3b5879f824e1872c5770c92ee5c0 (diff)
downloadsssd-96ea25cbd9b94d48c57b6173eeda2b3fbe670a70.tar.gz
sssd-96ea25cbd9b94d48c57b6173eeda2b3fbe670a70.tar.bz2
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
-rw-r--r--src/man/sssd.8.xml11
-rw-r--r--src/util/debug.c2
-rw-r--r--src/util/server.c22
-rw-r--r--src/util/util.h3
4 files changed, 24 insertions, 14 deletions
diff --git a/src/man/sssd.8.xml b/src/man/sssd.8.xml
index bab37b21..18567195 100644
--- a/src/man/sssd.8.xml
+++ b/src/man/sssd.8.xml
@@ -55,13 +55,18 @@
</listitem>
</varlistentry>
<varlistentry>
- <term>debug_timestamps (bool)</term>
+ <term>
+ <option>--debug-timestamps=</option><replaceable>mode</replaceable>
+ </term>
<listitem>
<para>
- Add a timestamp to the debug messages
+ <emphasis>1</emphasis>: Add a timestamp to the debug messages
+ </para>
+ <para>
+ <emphasis>0</emphasis>: Disable timestamp in the debug messages
</para>
<para>
- Default: false
+ Default: 1
</para>
</listitem>
</varlistentry>
diff --git a/src/util/debug.c b/src/util/debug.c
index 18bfda42..e9ed8ae1 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 d33c5cb1..7d16d048 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 a59603d0..3ff5f629 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}, \