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

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