From 10727586735882a48d57d0c41cb44a7a535645dd Mon Sep 17 00:00:00 2001 From: Sam James Date: Tue, 7 Mar 2023 16:38:11 +0000 Subject: app-mobilephone/gammu: fix runtime w/ FORTIFY_SOURCE=3 Closes: https://bugs.gentoo.org/854324 Signed-off-by: Sam James --- .../files/gammu-1.42.0-fortify-source-3.patch | 31 ++++++++++ app-mobilephone/gammu/gammu-1.42.0-r1.ebuild | 69 ++++++++++++++++++++++ app-mobilephone/gammu/gammu-1.42.0.ebuild | 66 --------------------- 3 files changed, 100 insertions(+), 66 deletions(-) create mode 100644 app-mobilephone/gammu/files/gammu-1.42.0-fortify-source-3.patch create mode 100644 app-mobilephone/gammu/gammu-1.42.0-r1.ebuild delete mode 100644 app-mobilephone/gammu/gammu-1.42.0.ebuild (limited to 'app-mobilephone') diff --git a/app-mobilephone/gammu/files/gammu-1.42.0-fortify-source-3.patch b/app-mobilephone/gammu/files/gammu-1.42.0-fortify-source-3.patch new file mode 100644 index 000000000000..dba1ca50ec6d --- /dev/null +++ b/app-mobilephone/gammu/files/gammu-1.42.0-fortify-source-3.patch @@ -0,0 +1,31 @@ +https://bugs.gentoo.org/854324 +https://github.com/gammu/gammu/commit/a37e5d8054f863fa71e38e244dd4da13eee6e251 + +From a37e5d8054f863fa71e38e244dd4da13eee6e251 Mon Sep 17 00:00:00 2001 +From: Martin Liska +Date: Mon, 20 Jun 2022 10:24:13 +0200 +Subject: [PATCH] Fix buffer overflow in Backup.Creator + +I noticed that while testing the upcoming GCC 12 with -D_FORTIFY_SOURCE=3: +here I have + +$1 = 0x7ffff7f0f940 "Linux, kernel 5.16.14-1-default (#1 SMP PREEMPT Fri Mar 11 12:33:34 UTC 2022 (80acc65))" +(gdb) p (int)strlen(GetOS()) +$3 = 87 +so GetOS() returns 87 chars while: + +include/gammu-backup.h: char Creator[80]; + +Fixes: #701 +--- a/include/gammu-backup.h ++++ b/include/gammu-backup.h +@@ -218,7 +218,7 @@ typedef struct { + /** + * Name of program which created backup + */ +- char Creator[80]; ++ char Creator[512]; + /** + * Timestamp of backup + */ + diff --git a/app-mobilephone/gammu/gammu-1.42.0-r1.ebuild b/app-mobilephone/gammu/gammu-1.42.0-r1.ebuild new file mode 100644 index 000000000000..ba396cb0f1fc --- /dev/null +++ b/app-mobilephone/gammu/gammu-1.42.0-r1.ebuild @@ -0,0 +1,69 @@ +# Copyright 2022-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit cmake + +DESCRIPTION="A tool to handle your cellular phone" +HOMEPAGE="https://wammu.eu/gammu/" +SRC_URI="https://dl.cihar.com/${PN}/releases/${P}.tar.bz2" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="amd64 x86" +IUSE="bluetooth curl dbi debug irda mysql nls odbc postgres usb" + +COMMON_DEPEND=" + dev-libs/glib:2= + dev-libs/libgudev:= + virtual/libiconv + bluetooth? ( net-wireless/bluez:= ) + curl? ( net-misc/curl:= ) + dbi? ( >=dev-db/libdbi-0.8.3:= ) + mysql? ( dev-db/mysql-connector-c:= ) + nls? ( sys-devel/gettext ) + odbc? ( dev-db/unixODBC ) + postgres? ( dev-db/postgresql:= ) + usb? ( virtual/libusb:1= ) +" +DEPEND=" + ${COMMON_DEPEND} + irda? ( virtual/os-headers ) +" +RDEPEND=" + ${COMMON_DEPEND} + dev-util/dialog +" +PATCHES=( + "${FILESDIR}/${P}-CMP0110-policy.patch" + "${FILESDIR}/${P}-gammu-detect.patch" + "${FILESDIR}/${P}-fortify-source-3.patch" +) + +src_configure() { + local mycmakeargs=( + -DWITH_BLUETOOTH=$(usex bluetooth) + -DWITH_CURL=$(usex curl) + -DWITH_Gettext=$(usex nls) + -DWITH_Iconv=$(usex nls) + -DWITH_IRDA=$(usex irda) + -DWITH_LibDBI=$(usex dbi) + -DWITH_MySQL=$(usex mysql) + -DWITH_ODBC=$(usex odbc) + -DWITH_Postgres=$(usex postgres) + -DWITH_USB=$(usex usb) + -DINSTALL_DOC_DIR="share/doc/${PF}" + ) + cmake_src_configure +} + +src_test() { + addwrite "/var/lock/LCK..bar" + LD_LIBRARY_PATH="${BUILD_DIR}/libgammu" cmake_src_test -j1 +} + +src_install() { + cmake_src_install + docompress -x /usr/share/doc/${PF}/examples/ +} diff --git a/app-mobilephone/gammu/gammu-1.42.0.ebuild b/app-mobilephone/gammu/gammu-1.42.0.ebuild deleted file mode 100644 index 79bd7daa5e61..000000000000 --- a/app-mobilephone/gammu/gammu-1.42.0.ebuild +++ /dev/null @@ -1,66 +0,0 @@ -# Copyright 2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -inherit cmake - -DESCRIPTION="A tool to handle your cellular phone" -HOMEPAGE="https://wammu.eu/gammu/" -SRC_URI="https://dl.cihar.com/${PN}/releases/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="amd64 x86" -IUSE="bluetooth curl dbi debug irda mysql nls odbc postgres usb" - -COMMON_DEPEND=" - dev-libs/glib:2= - dev-libs/libgudev:= - virtual/libiconv - bluetooth? ( net-wireless/bluez:= ) - curl? ( net-misc/curl:= ) - dbi? ( >=dev-db/libdbi-0.8.3:= ) - mysql? ( dev-db/mysql-connector-c:= ) - nls? ( sys-devel/gettext ) - odbc? ( dev-db/unixODBC ) - postgres? ( dev-db/postgresql:= ) - usb? ( virtual/libusb:1= ) -" -DEPEND=" - ${COMMON_DEPEND} - irda? ( virtual/os-headers ) -" -RDEPEND=" - ${COMMON_DEPEND} - dev-util/dialog -" -PATCHES=( "${FILESDIR}/${P}-CMP0110-policy.patch" - "${FILESDIR}/${P}-gammu-detect.patch" ) - -src_configure() { - local mycmakeargs=( - -DWITH_BLUETOOTH=$(usex bluetooth) - -DWITH_CURL=$(usex curl) - -DWITH_Gettext=$(usex nls) - -DWITH_Iconv=$(usex nls) - -DWITH_IRDA=$(usex irda) - -DWITH_LibDBI=$(usex dbi) - -DWITH_MySQL=$(usex mysql) - -DWITH_ODBC=$(usex odbc) - -DWITH_Postgres=$(usex postgres) - -DWITH_USB=$(usex usb) - -DINSTALL_DOC_DIR="share/doc/${PF}" - ) - cmake_src_configure -} - -src_test() { - addwrite "/var/lock/LCK..bar" - LD_LIBRARY_PATH="${BUILD_DIR}/libgammu" cmake_src_test -j1 -} - -src_install() { - cmake_src_install - docompress -x /usr/share/doc/${PF}/examples/ -} -- cgit v1.2.3-65-gdbad