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

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