summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Hindley <mark@hindley.org.uk>2018-11-09 12:51:53 +0000
committerMark Hindley <mark@hindley.org.uk>2018-11-09 12:58:17 +0000
commit0283a93cb8e00114a29e630b4ff7867a819d5bd5 (patch)
tree8f01d446e5d9cf37c10d1bd44769f080dab3293b
parentae65e91a5439f395e0da0cd8ffda95d6289849e1 (diff)
Refreshed patch to match upstream fix for issue #92.
-rw-r--r--debian/changelog4
-rw-r--r--debian/patches/Fix_glibc_program_invocation_name_pointer_overlap.diff63
2 files changed, 31 insertions, 36 deletions
diff --git a/debian/changelog b/debian/changelog
index cbd0dfb..19aa5f5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,7 @@
+ * Update fix for SIGABRT to upstream #92.
+
+ --
+
elogind (239.1-1~rc1) unstable; urgency=medium
* New upstream release v239.1.
diff --git a/debian/patches/Fix_glibc_program_invocation_name_pointer_overlap.diff b/debian/patches/Fix_glibc_program_invocation_name_pointer_overlap.diff
index 5f18682..034bf29 100644
--- a/debian/patches/Fix_glibc_program_invocation_name_pointer_overlap.diff
+++ b/debian/patches/Fix_glibc_program_invocation_name_pointer_overlap.diff
@@ -3,44 +3,35 @@ Bug: https://github.com/elogind/elogind/issues/92
--- a/src/shared/musl_missing.c
+++ b/src/shared/musl_missing.c
-@@ -34,9 +34,14 @@
+@@ -26,14 +26,14 @@
+ #if HAVE_PROGRAM_INVOCATION_NAME == 0
+ char *program_invocation_name = NULL;
+ char *program_invocation_short_name = NULL;
+-#endif // libc does not provide these variables
- static void elogind_free_program_name(void) {
+-const char *program_arg_name = NULL;
++const char *program_arg_name = NULL; /* Helper */
++#endif // libc does not provide program_invocation_[short_]name
+
+ #include "musl_missing.h"
-- if (program_invocation_name && (program_invocation_name != program_arg_name) && strlen(program_invocation_name))
-+ if (program_invocation_name &&
-+ (program_invocation_name != program_arg_name) &&
-+ strlen(program_invocation_name))
++#if HAVE_PROGRAM_INVOCATION_NAME == 0
+ static void elogind_free_program_name(void) {
+-
+ if (program_invocation_name && (program_invocation_name != program_arg_name) && strlen(program_invocation_name))
program_invocation_name = mfree(program_invocation_name);
-- if (program_invocation_short_name && (program_invocation_short_name != program_arg_name) && strlen(program_invocation_short_name))
-+ if (program_invocation_short_name &&
-+ (program_invocation_short_name != program_arg_name) &&
-+ (program_invocation_short_name + strlen(program_invocation_short_name) != program_invocation_name + strlen(program_invocation_name))
-+ && strlen(program_invocation_short_name))
- program_invocation_short_name = mfree(program_invocation_short_name);
+ if (program_invocation_short_name && (program_invocation_short_name != program_arg_name) && strlen(program_invocation_short_name))
+@@ -55,8 +55,11 @@
+ program_invocation_name = strdup(program_arg_name);
+ if (NULL == program_invocation_short_name)
+ program_invocation_short_name = strdup(basename(program_arg_name));
+-#if HAVE_PROGRAM_INVOCATION_NAME == 0
+ atexit(elogind_free_program_name);
+-#endif // libc does not provide these variables
}
++#else
++void elogind_set_program_name(const char* pcall) {
++ assert(pcall && pcall[0]);
++}
++#endif // libc does not provide program_invocation_[short_]name
---- a/src/basic/process-util.c
-+++ b/src/basic/process-util.c
-@@ -10,6 +10,7 @@
- #include <stdio.h>
- #include <stdio_ext.h>
- #include <stdlib.h>
-+#include <libgen.h>
- #include <string.h>
- #include <sys/mman.h>
- #include <sys/mount.h>
-@@ -306,8 +307,12 @@
-
- k = strlen(program_invocation_name);
- strncpy(program_invocation_name, name, k);
-- if (l > k)
-+ if (l > k) {
- truncated = true;
-+ program_invocation_short_name = NULL;
-+ }
-+ else
-+ program_invocation_short_name = program_invocation_name + strlen(dirname(program_invocation_name)) -1;
- }
-
- /* Third step, completely replace the argv[] array the kernel maintains for us. This requires privileges, but