Blame 0269-ccpp-add-h-parameter-into-abrt-hook-ccpp.patch

69165ba
From e0361b1688c82f9fbfa07d2683effedac870ae17 Mon Sep 17 00:00:00 2001
69165ba
From: Matej Habrnal <mhabrnal@redhat.com>
69165ba
Date: Mon, 13 Feb 2017 13:12:39 +0100
69165ba
Subject: [PATCH] ccpp: add %h parameter into abrt-hook-ccpp
69165ba
69165ba
Without this commit core_pattern's parameter %h was not translated to hostname.
69165ba
69165ba
Example:
69165ba
If 'core_pattern = core.%h.%e.%p.%t' the result was
69165ba
core.%h.sleep.26284.1469805542 not core.myshostmane.sleep.26284.1469805542.
69165ba
69165ba
Related to #1364899
69165ba
69165ba
Signed-off-by: Matej Habrnal <mhabrnal@redhat.com>
69165ba
---
69165ba
 src/hooks/abrt-hook-ccpp.c          | 6 +++---
69165ba
 src/hooks/abrt-install-ccpp-hook.in | 4 ++--
69165ba
 2 files changed, 5 insertions(+), 5 deletions(-)
69165ba
69165ba
diff --git a/src/hooks/abrt-hook-ccpp.c b/src/hooks/abrt-hook-ccpp.c
69165ba
index 581a540..cb4d1e0 100644
69165ba
--- a/src/hooks/abrt-hook-ccpp.c
69165ba
+++ b/src/hooks/abrt-hook-ccpp.c
69165ba
@@ -161,14 +161,14 @@ static struct dump_dir *dd;
69165ba
  * %g - gid
69165ba
  * %t - UNIX time of dump
69165ba
  * %e - executable filename
69165ba
- * %I - global crash thread tid
69165ba
  * %P - global pid
69165ba
+ * %I - global crash thread tid
69165ba
+ * %h - hostname
69165ba
  * %% - output one "%"
69165ba
  */
69165ba
 /* Hook must be installed with exactly the same sequence of %c specifiers.
69165ba
- * Last one, %h, may be omitted (we can find it out).
69165ba
  */
69165ba
-static const char percent_specifiers[] = "%scpugtePI";
69165ba
+static const char percent_specifiers[] = "%scpugtePIh";
69165ba
 static char *core_basename = (char*) "core";
69165ba
 
69165ba
 static char* get_executable(pid_t pid, int *fd_p)
69165ba
diff --git a/src/hooks/abrt-install-ccpp-hook.in b/src/hooks/abrt-install-ccpp-hook.in
69165ba
index 707c57d..171bd4a 100755
69165ba
--- a/src/hooks/abrt-install-ccpp-hook.in
69165ba
+++ b/src/hooks/abrt-install-ccpp-hook.in
69165ba
@@ -11,9 +11,9 @@ SAVED_PATTERN_DIR="@VAR_RUN@/abrt"
69165ba
 SAVED_PATTERN_FILE="@VAR_RUN@/abrt/saved_core_pattern"
69165ba
 HOOK_BIN="@libexecdir@/abrt-hook-ccpp"
69165ba
 # Must match percent_specifiers[] order in abrt-hook-ccpp.c:
69165ba
-PATTERN="|$HOOK_BIN %s %c %p %u %g %t %e %P %I"
69165ba
+PATTERN="|$HOOK_BIN %s %c %p %u %g %t %e %P %I %h"
69165ba
 # Same, but with bogus "executable name" parameter
69165ba
-PATTERN1="|$HOOK_BIN %s %c %p %u %g %t e %P %I"
69165ba
+PATTERN1="|$HOOK_BIN %s %c %p %u %g %t e %P %I %h"
69165ba
 
69165ba
 # core_pipe_limit specifies how many dump_helpers can run at the same time
69165ba
 # 0 - means unlimited, but it's not guaranteed that /proc/<pid> of crashing
69165ba
-- 
69165ba
1.8.3.1
69165ba