commit:     003194957fafdd2832863e8bd445085189e2a743
Author:     Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 24 00:16:25 2023 +0000
Commit:     Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
CommitDate: Sun Sep 24 00:17:33 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=00319495

sys-process/systemd-cron: revbump 2.1.3, fix SIGABRT with cxx assertions

Happens on hardened toolchain systems.

Issue: https://github.com/systemd-cron/systemd-cron/issues/134
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>

 .../systemd-cron-2.1.3-MAYBE_DUPA_SIGABRT.patch    | 30 ++++++++++++++++++++++
 ...n-2.1.3.ebuild => systemd-cron-2.1.3-r1.ebuild} |  3 +++
 2 files changed, 33 insertions(+)

diff --git 
a/sys-process/systemd-cron/files/systemd-cron-2.1.3-MAYBE_DUPA_SIGABRT.patch 
b/sys-process/systemd-cron/files/systemd-cron-2.1.3-MAYBE_DUPA_SIGABRT.patch
new file mode 100644
index 000000000000..93d44a15c8f2
--- /dev/null
+++ b/sys-process/systemd-cron/files/systemd-cron-2.1.3-MAYBE_DUPA_SIGABRT.patch
@@ -0,0 +1,30 @@
+From acd77f59d58d9ec812f64c833a5e029b9dbae92a Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= <nabijaczlew...@nabijaczleweli.xyz>
+Date: Sun, 24 Sep 2023 01:27:09 +0200
+Subject: [PATCH] MAYBE_DUPA needs to work around helpful toolchains that make
+ string_view::operator[] actually be ::at()
+
+Closes: #134
+---
+ src/include/libvoreutils.hpp | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/src/include/libvoreutils.hpp b/src/include/libvoreutils.hpp
+index 02fad8e..eaa7adc 100644
+--- a/src/include/libvoreutils.hpp
++++ b/src/include/libvoreutils.hpp
+@@ -361,10 +361,10 @@ namespace vore {
+ #endif
+ 
+ 
+-#define MAYBE_DUPA(strv)                                                      
 \
+-      __extension__({                                                         
     \
+-              auto && _strv = strv;                                           
           \
+-              _strv[_strv.size()] ? strndupa(_strv.data(), _strv.size()) : 
_strv.data(); \
++#define MAYBE_DUPA(strv)                                                      
        \
++      __extension__({                                                         
            \
++              auto && _strv = strv;                                           
                  \
++              _strv.data()[_strv.size()] ? strndupa(_strv.data(), 
_strv.size()) : _strv.data(); \
+       })
+ 
+ 

diff --git a/sys-process/systemd-cron/systemd-cron-2.1.3.ebuild 
b/sys-process/systemd-cron/systemd-cron-2.1.3-r1.ebuild
similarity index 92%
rename from sys-process/systemd-cron/systemd-cron-2.1.3.ebuild
rename to sys-process/systemd-cron/systemd-cron-2.1.3-r1.ebuild
index 752240ab8359..892d8b5f3d04 100644
--- a/sys-process/systemd-cron/systemd-cron-2.1.3.ebuild
+++ b/sys-process/systemd-cron/systemd-cron-2.1.3-r1.ebuild
@@ -50,6 +50,9 @@ src_prepare() {
                        "${S}/test/test-generator" || die
        fi
 
+       # https://github.com/systemd-cron/systemd-cron/issues/134
+       # 
https://github.com/systemd-cron/systemd-cron/commit/acd77f59d58d9ec812f64c833a5e029b9dbae92a
+       eapply "${FILESDIR}/${P}-MAYBE_DUPA_SIGABRT.patch"
        eapply_user
 }
 

Reply via email to