summaryrefslogtreecommitdiffstats
path: root/src/util/child_common.c
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2014-07-08 15:05:24 +0200
committerJakub Hrozek <jhrozek@redhat.com>2014-07-09 17:36:08 +0200
commit9a990aa9f7e8c105e0cfeea8d8cbdc776c2d5d7a (patch)
tree05da2bdd23b7c8834338a7d72ce5b302c46bc386 /src/util/child_common.c
parent842f83f8db513214241a0fea076ac160b180e1dd (diff)
downloadsssd-9a990aa9f7e8c105e0cfeea8d8cbdc776c2d5d7a.tar.gz
sssd-9a990aa9f7e8c105e0cfeea8d8cbdc776c2d5d7a.tar.xz
sssd-9a990aa9f7e8c105e0cfeea8d8cbdc776c2d5d7a.zip
SSSD: Send debug to stderr when running on foreground
https://fedorahosted.org/sssd/ticket/2348 When SSSD is running in interactive mode, we should print DEBUG messages directly to stderr, not journal. Reviewed-by: Michal Židek <mzidek@redhat.com>
Diffstat (limited to 'src/util/child_common.c')
-rw-r--r--src/util/child_common.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/util/child_common.c b/src/util/child_common.c
index 08aac1143..81bbab70e 100644
--- a/src/util/child_common.c
+++ b/src/util/child_common.c
@@ -637,8 +637,10 @@ static errno_t prepare_child_argv(TALLOC_CTX *mem_ctx,
bool child_debug_to_file = debug_to_file;
bool child_debug_timestamps = debug_timestamps;
bool child_debug_microseconds = debug_microseconds;
+ bool child_debug_stderr = debug_to_stderr;
if (child_debug_to_file) argc++;
+ if (child_debug_stderr) argc++;
/*
* program name, debug_level, debug_to_file, debug_timestamps,
@@ -659,6 +661,14 @@ static errno_t prepare_child_argv(TALLOC_CTX *mem_ctx,
goto fail;
}
+ if (child_debug_stderr) {
+ argv[--argc] = talloc_strdup(argv, "--debug-to-stderr");
+ if (argv[argc] == NULL) {
+ ret = ENOMEM;
+ goto fail;
+ }
+ }
+
if (child_debug_to_file) {
argv[--argc] = talloc_asprintf(argv, "--debug-fd=%d",
child_debug_fd);