summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--abrt-ccpp.init12
-rw-r--r--src/hooks/abrt-hook-ccpp.c19
2 files changed, 19 insertions, 12 deletions
diff --git a/abrt-ccpp.init b/abrt-ccpp.init
index 480cb1e8..07a79ae5 100644
--- a/abrt-ccpp.init
+++ b/abrt-ccpp.init
@@ -62,17 +62,9 @@ start() {
if test x"$cur_first" != x"|$HOOK_BIN"; then # no
# It is not installed
printf "%s\n" "$cur" >"$SAVED_PATTERN_FILE"
- OLD_PATTERN=""
- # Does old pattern start with '|'?
- if test x"${cur#|}" = x"$cur"; then # no
- # Encode it as hex string, NUL terminated
- OLD_PATTERN=`printf "%s" "$cur" | od -tx1 | sed 's/000[^ ]*//' | xargs | sed 's/ //g'`
- $verbose && printf "OLD_PATTERN:'%s'\n" "$OLD_PATTERN"
- OLD_PATTERN=" ${OLD_PATTERN}00"
- fi
# Install new handler
- $verbose && printf "Installing to %s:'%s'\n" "$PATTERN_FILE" "${PATTERN}${OLD_PATTERN}"
- $dry_run || echo "${PATTERN}${OLD_PATTERN}" >"$PATTERN_FILE"
+ $verbose && printf "Installing to %s:'%s'\n" "$PATTERN_FILE" "$PATTERN"
+ $dry_run || echo "$PATTERN" >"$PATTERN_FILE"
$dry_run || touch -- "$LOCK"
# Check core_pipe_limit and change it if it's 0,
diff --git a/src/hooks/abrt-hook-ccpp.c b/src/hooks/abrt-hook-ccpp.c
index 8be24b9b..dfccee74 100644
--- a/src/hooks/abrt-hook-ccpp.c
+++ b/src/hooks/abrt-hook-ccpp.c
@@ -308,7 +308,9 @@ int main(int argc, char** argv)
{
/* percent specifier: %s %c %p %u %g %t %h %e */
/* argv: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] */
- error_msg_and_die("Usage: %s DUMPDIR SIGNO CORE_SIZE_LIMIT PID UID GID TIME HOSTNAME BINARY_NAME [OLD_PATTERN]", argv[0]);
+ // [OLD_PATTERN] is deprecated, so removing it from help:
+ //error_msg_and_die("Usage: %s DUMPDIR SIGNO CORE_SIZE_LIMIT PID UID GID TIME HOSTNAME BINARY_NAME [OLD_PATTERN]", argv[0]);
+ error_msg_and_die("Usage: %s DUMPDIR SIGNO CORE_SIZE_LIMIT PID UID GID TIME HOSTNAME BINARY_NAME", argv[0]);
}
/* Not needed on 2.6.30.
@@ -345,7 +347,20 @@ int main(int argc, char** argv)
{
perror_msg_and_die("pid '%s' or limit '%s' is bogus", argv[4], argv[3]);
}
- if (argv[10]) /* OLD_PATTERN */
+
+ FILE *saved_core_pattern = fopen(VAR_RUN"/abrt/saved_core_pattern", "r");
+ if (saved_core_pattern)
+ {
+ char *s = xmalloc_fgetline(saved_core_pattern);
+ fclose(saved_core_pattern);
+ /* If we have a saved pattern and it's not a "|PROG ARGS" thing... */
+ if (s && s[0] != '|')
+ {
+ core_basename = s;
+ argv[10] = NULL; /* don't use old way to pass OLD_PATTERN */
+ }
+ }
+ if (argv[10]) /* OLD_PATTERN (deprecated) */
{
char *buf = (char*) xzalloc(strlen(argv[10]) / 2 + 2);
char *end = hex2bin(buf, argv[10], strlen(argv[10]));