summaryrefslogtreecommitdiffstats
path: root/src/providers
diff options
context:
space:
mode:
authorPavel Březina <pbrezina@redhat.com>2011-08-29 10:32:03 +0200
committerStephen Gallagher <sgallagh@redhat.com>2011-09-08 15:29:42 -0400
commit1a7529bf5f867b43e0475f7f9ac0cd8671fb16f1 (patch)
treeeca7704990f1d8e028bf6b3cba1cd9211d26b614 /src/providers
parent8414023e4ba838edb9712fa7e3f923f9b035665e (diff)
downloadsssd-1a7529bf5f867b43e0475f7f9ac0cd8671fb16f1.tar.gz
sssd-1a7529bf5f867b43e0475f7f9ac0cd8671fb16f1.tar.xz
sssd-1a7529bf5f867b43e0475f7f9ac0cd8671fb16f1.zip
DEBUG timestamps offer higher precision
https://fedorahosted.org/sssd/ticket/956 Added: --debug-microseconds=0/1 Added: debug_microseconds to sssd.conf
Diffstat (limited to 'src/providers')
-rw-r--r--src/providers/child_common.c21
-rw-r--r--src/providers/krb5/krb5_child.c2
-rw-r--r--src/providers/ldap/ldap_child.c2
-rw-r--r--src/providers/proxy/proxy_auth.c5
4 files changed, 24 insertions, 6 deletions
diff --git a/src/providers/child_common.c b/src/providers/child_common.c
index cde310c3b..5920ebc74 100644
--- a/src/providers/child_common.c
+++ b/src/providers/child_common.c
@@ -378,19 +378,25 @@ static errno_t prepare_child_argv(TALLOC_CTX *mem_ctx,
const char *binary,
char ***_argv)
{
- uint_t argc = 4; /* program name, debug_level, debug_timestamps and NULL */
+ /*
+ * program name, debug_level, debug_timestamps,
+ * debug_microseconds and NULL
+ */
+ uint_t argc = 5;
char ** argv;
errno_t ret = EINVAL;
/* Save the current state in case an interrupt changes it */
bool child_debug_to_file = debug_to_file;
bool child_debug_timestamps = debug_timestamps;
+ bool child_debug_microseconds = debug_microseconds;
if (child_debug_to_file) argc++;
- /* program name, debug_level,
- * debug_to_file, debug_timestamps
- * and NULL */
+ /*
+ * program name, debug_level, debug_to_file, debug_timestamps,
+ * debug_microseconds and NULL
+ */
argv = talloc_array(mem_ctx, char *, argc);
if (argv == NULL) {
DEBUG(1, ("talloc_array failed.\n"));
@@ -422,6 +428,13 @@ static errno_t prepare_child_argv(TALLOC_CTX *mem_ctx,
goto fail;
}
+ argv[--argc] = talloc_asprintf(argv, "--debug-microseconds=%d",
+ child_debug_microseconds);
+ if (argv[argc] == NULL) {
+ ret = ENOMEM;
+ goto fail;
+ }
+
argv[--argc] = talloc_strdup(argv, binary);
if (argv[argc] == NULL) {
ret = ENOMEM;
diff --git a/src/providers/krb5/krb5_child.c b/src/providers/krb5/krb5_child.c
index fc678efa6..7f6f93672 100644
--- a/src/providers/krb5/krb5_child.c
+++ b/src/providers/krb5/krb5_child.c
@@ -1554,6 +1554,8 @@ int main(int argc, const char *argv[])
_("Debug level"), NULL},
{"debug-timestamps", 0, POPT_ARG_INT, &debug_timestamps, 0,
_("Add debug timestamps"), NULL},
+ {"debug-microseconds", 0, POPT_ARG_INT, &debug_microseconds, 0,
+ _("Show timestamps with microseconds"), NULL},
{"debug-fd", 0, POPT_ARG_INT, &debug_fd, 0,
_("An open file descriptor for the debug logs"), NULL},
POPT_TABLEEND
diff --git a/src/providers/ldap/ldap_child.c b/src/providers/ldap/ldap_child.c
index 368c20120..b0051fa91 100644
--- a/src/providers/ldap/ldap_child.c
+++ b/src/providers/ldap/ldap_child.c
@@ -360,6 +360,8 @@ int main(int argc, const char *argv[])
_("Debug level"), NULL},
{"debug-timestamps", 0, POPT_ARG_INT, &debug_timestamps, 0,
_("Add debug timestamps"), NULL},
+ {"debug-microseconds", 0, POPT_ARG_INT, &debug_microseconds, 0,
+ _("Show timestamps with microseconds"), NULL},
{"debug-fd", 0, POPT_ARG_INT, &debug_fd, 0,
_("An open file descriptor for the debug logs"), NULL},
POPT_TABLEEND
diff --git a/src/providers/proxy/proxy_auth.c b/src/providers/proxy/proxy_auth.c
index 81ae896bb..cd291782e 100644
--- a/src/providers/proxy/proxy_auth.c
+++ b/src/providers/proxy/proxy_auth.c
@@ -240,9 +240,10 @@ static struct tevent_req *proxy_child_init_send(TALLOC_CTX *mem_ctx,
state->child_ctx = child_ctx;
state->command = talloc_asprintf(req,
- "%s/proxy_child -d %#.4x --debug-timestamps=%d%s --domain %s --id %d",
+ "%s/proxy_child -d %#.4x --debug-timestamps=%d "
+ "--debug-microseconds=%d%s --domain %s --id %d",
SSSD_LIBEXEC_PATH, debug_level, debug_timestamps,
- (debug_to_file ? " --debug-to-files" : ""),
+ debug_microseconds, (debug_to_file ? " --debug-to-files" : ""),
auth_ctx->be->domain->name,
child_ctx->id);
if (state->command == NULL) {