public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-process/acct/, sys-process/acct/files/
Date: Fri,  1 Mar 2024 07:55:40 +0000 (UTC)	[thread overview]
Message-ID: <1709279679.038e31c37d6e59768ae7abf5083559a0950c308f.sam@gentoo> (raw)

commit:     038e31c37d6e59768ae7abf5083559a0950c308f
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Mar  1 06:08:16 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Mar  1 07:54:39 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=038e31c3

sys-process/acct: update EAPI 7 -> 8, fix _F_S=3 crash, fix startup

* EAPI 8
* Fix crash with _FORTIFY_SOURCE=3 (bug #925419)
* Use tmpfiles to create /var/accounts/pacct which fixes startup/use on new installs
* Drop ancient workaround (bug #239748)

Bug: https://bugs.gentoo.org/239748
Signed-off-by: Sam James <sam <AT> gentoo.org>

 sys-process/acct/acct-6.6.4-r4.ebuild              | 55 ++++++++++++++++++++++
 ...-fortify-source-3-sprintf-buffer-overflow.patch | 15 ++++++
 sys-process/acct/files/acct.tmpfiles               |  1 +
 3 files changed, 71 insertions(+)

diff --git a/sys-process/acct/acct-6.6.4-r4.ebuild b/sys-process/acct/acct-6.6.4-r4.ebuild
new file mode 100644
index 000000000000..980c95891435
--- /dev/null
+++ b/sys-process/acct/acct-6.6.4-r4.ebuild
@@ -0,0 +1,55 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools systemd tmpfiles
+
+DESCRIPTION="GNU system accounting utilities"
+HOMEPAGE="https://savannah.gnu.org/projects/acct/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux"
+IUSE="selinux"
+
+RDEPEND="selinux? ( sec-policy/selinux-acct )"
+BDEPEND="sys-apps/texinfo"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-6.6.4-cross-compile-fixed.patch
+	"${FILESDIR}"/${PN}-6.6.4-fortify-source-3-sprintf-buffer-overflow.patch
+)
+
+src_prepare() {
+	default
+	eautoreconf
+}
+
+src_configure() {
+	econf --enable-linux-multiformat
+}
+
+src_install() {
+	default
+
+	keepdir /var/account
+
+	newinitd "${FILESDIR}"/acct.initd-r2 acct
+	newconfd "${FILESDIR}"/acct.confd-r1 acct
+
+	systemd_dounit "${FILESDIR}"/acct.service
+
+	insinto /etc/logrotate.d
+	newins "${FILESDIR}"/acct.logrotate-r1 psacct
+
+	# sys-apps/sysvinit already provides this
+	rm "${ED}"/usr/bin/last "${ED}"/usr/share/man/man1/last.1 || die
+
+	newtmpfiles "${FILESDIR}"/acct.tmpfiles acct.conf
+}
+
+pkg_postinst() {
+	tmpfiles_process acct.conf
+}

diff --git a/sys-process/acct/files/acct-6.6.4-fortify-source-3-sprintf-buffer-overflow.patch b/sys-process/acct/files/acct-6.6.4-fortify-source-3-sprintf-buffer-overflow.patch
new file mode 100644
index 000000000000..83f6e33415e7
--- /dev/null
+++ b/sys-process/acct/files/acct-6.6.4-fortify-source-3-sprintf-buffer-overflow.patch
@@ -0,0 +1,15 @@
+https://bugs.gentoo.org/925419
+https://bugzilla.redhat.com/2190057
+https://src.fedoraproject.org/rpms/psacct/blob/rawhide/f/psacct-6.6.4-sprintf-buffer-overflow.patch
+
+--- a/dev_hash.c
++++ b/dev_hash.c
+@@ -147,7 +147,7 @@ static void setup_devices(char *dirname)
+     {
+       char *fullname = (char *) alloca ((strlen (dirname)
+                                          + NAMLEN (dp)
+-                                         + 1) * sizeof (char));
++                                         + 2) * sizeof (char));  /* slash + null; Fedora BZ#2190057 */
+ 
+       (void)sprintf (fullname, "%s/%s", dirname, dp->d_name);
+       if (stat (fullname, &sp))

diff --git a/sys-process/acct/files/acct.tmpfiles b/sys-process/acct/files/acct.tmpfiles
new file mode 100644
index 000000000000..8f2b1e6f303c
--- /dev/null
+++ b/sys-process/acct/files/acct.tmpfiles
@@ -0,0 +1 @@
+f	/var/account/pacct	0600    -	-	-       -


             reply	other threads:[~2024-03-01  7:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-01  7:55 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-10-03 11:28 [gentoo-commits] repo/gentoo:master commit in: sys-process/acct/, sys-process/acct/files/ David Seifert
2017-12-12 15:10 Lars Wendler
2017-07-27 14:04 Thomas Deutschmann
2017-01-07 21:32 Robin H. Johnson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1709279679.038e31c37d6e59768ae7abf5083559a0950c308f.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox