From d108d7d2fbe0b178110295fd8335c258f699a5d4 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Thu, 6 Jan 2011 16:18:09 +0100 Subject: pass old pattern to ccpp hook and use it abrtd: instead of "|/usr/libexec/abrt-ccpp-hook DEBUG_DUMPS_DIR %p %s %u %c", sets coredump handler to "|/usr/libexec/abrt-ccpp-hook DEBUG_DUMPS_DIR %s %c %p %u %g %t %h %e OLD_PATTERN" abrt-ccpp-hook: expands OLD_PATTERN using values of %s %c %p %u %g %t %h %e and uses it as a name of "compat coredump". Patch has a feature which prevents usage of kernel-truncated OLD_PATTERN: it is passed as hex string *with terminating NUL* (encoded as 00). If ccpp hook doesn't see 00, it refuses to use OLD_PATTERN and uses string "core" instead. Run tested. On a new kernel, passes up to 27 char long old pattern. Longer patterns are still truncated. This may be improved in future kernels. Signed-off-by: Denys Vlasenko --- src/include/abrtlib.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/include') diff --git a/src/include/abrtlib.h b/src/include/abrtlib.h index 0eb0f2d0..2e23805a 100644 --- a/src/include/abrtlib.h +++ b/src/include/abrtlib.h @@ -233,6 +233,11 @@ double get_dirsize_find_largest_dir( const char *excluded /* can be NULL */ ); +/* Emit a string of hex representation of bytes */ +char* bin2hex(char *dst, const char *str, int count); +/* Convert "xxxxxxxx" hex string to binary, no more than COUNT bytes */ +char* hex2bin(char *dst, const char *str, int count); + /* Returns command line of running program. * Caller is responsible to free() the returned value. * If the pid is not valid or command line can not be obtained, -- cgit