commit:     ac01d98719a81dadb940f2c6c262d62b45bbb29f
Author:     Hans de Graaff <graaff <AT> gentoo <DOT> org>
AuthorDate: Tue Aug  3 18:06:07 2021 +0000
Commit:     Hans de Graaff <graaff <AT> gentoo <DOT> org>
CommitDate: Tue Aug  3 18:06:49 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ac01d987

app-misc/ttyload: fix sigabrt on hardened kernels

Add Debian patch to fix a sigabrt on hardened kernels.

Closes: https://bugs.gentoo.org/732162
Package-Manager: Portage-3.0.20, Repoman-3.0.2
Signed-off-by: Hans de Graaff <graaff <AT> gentoo.org>

 .../ttyload-0.5.3-fix-sigabrt-in-strcpy.patch      | 16 +++++++++
 app-misc/ttyload/ttyload-0.5.3-r1.ebuild           | 42 ++++++++++++++++++++++
 2 files changed, 58 insertions(+)

diff --git a/app-misc/ttyload/files/ttyload-0.5.3-fix-sigabrt-in-strcpy.patch 
b/app-misc/ttyload/files/ttyload-0.5.3-fix-sigabrt-in-strcpy.patch
new file mode 100644
index 00000000000..70f51f9fa39
--- /dev/null
+++ b/app-misc/ttyload/files/ttyload-0.5.3-fix-sigabrt-in-strcpy.patch
@@ -0,0 +1,16 @@
+Subject: Fix SIGABRT in strcpy() call when running
+From: Ricardo Mones <[email protected]>
+Forwarded: https://github.com/lindes/ttyload/issues/8
+Last-Update: 2019-01-13
+
+--- a/ttyload.h
++++ b/ttyload.h
+@@ -34,7 +34,7 @@ typedef struct load_list {
+ /* storage for clock display along the bottom */
+ typedef struct clock_info {
+       int     pos;
+-      char    clock[6];
++      char    clock[7];
+         time_t  when;
+     } clock_info;
+ 

diff --git a/app-misc/ttyload/ttyload-0.5.3-r1.ebuild 
b/app-misc/ttyload/ttyload-0.5.3-r1.ebuild
new file mode 100644
index 00000000000..5a031a28898
--- /dev/null
+++ b/app-misc/ttyload/ttyload-0.5.3-r1.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit toolchain-funcs
+
+DESCRIPTION="color-coded graph of load averages over time"
+HOMEPAGE="https://www.daveltd.com/src/util/ttyload 
https://github.com/lindes/ttyload";
+SRC_URI="https://www.daveltd.com/src/util/${PN}/${P}.tar.bz2";
+
+KEYWORDS="~amd64 ~x86"
+LICENSE="ISC"
+SLOT="0"
+
+DEPEND="sys-libs/ncurses:0="
+
+RESTRICT="test"
+
+DOCS=( BUGS HISTORY LICENSE README.md TODO )
+
+src_prepare() {
+       default
+
+       eapply "${FILESDIR}/ttyload-0.5.3-fix-sigabrt-in-strcpy.patch"
+
+       sed -i '10i#include <time.h>' "${PN}.h" || die
+
+       sed -e "s#make#$\(MAKE\)#" \
+               -e "s#^CFLAGS.*#CFLAGS=\$(INCLUDES) ${CFLAGS} \$(VERSION)#" \
+               -i Makefile || die
+}
+
+src_compile() {
+       emake CC=$(tc-getCC) LDFLAGS="${LDFLAGS}"
+}
+
+src_install() {
+       dobin "${PN}"
+       doman "${PN}.1"
+       einstalldocs
+}

Reply via email to