From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id BDF4B138335 for ; Sat, 20 Apr 2019 23:10:04 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7EEECE0826; Sat, 20 Apr 2019 23:10:03 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 5186CE0824 for ; Sat, 20 Apr 2019 23:10:03 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 0246B3421F2 for ; Sat, 20 Apr 2019 20:33:51 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 78EC5326 for ; Sat, 20 Apr 2019 20:33:49 +0000 (UTC) From: "Lars Wendler" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Lars Wendler" Message-ID: <1555792423.8029ba6c8920e379ea1f5f71afc297bfd30925b3.polynomial-c@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: app-misc/uptimed/ X-VCS-Repository: repo/gentoo X-VCS-Files: app-misc/uptimed/uptimed-0.4.0-r1.ebuild app-misc/uptimed/uptimed-0.4.1.ebuild X-VCS-Directories: app-misc/uptimed/ X-VCS-Committer: polynomial-c X-VCS-Committer-Name: Lars Wendler X-VCS-Revision: 8029ba6c8920e379ea1f5f71afc297bfd30925b3 X-VCS-Branch: master Date: Sat, 20 Apr 2019 20:33:49 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 273d598d-c9cb-4682-9f37-04262b5598c4 X-Archives-Hash: 14e325c59e79a838426002fc477f8db3 commit: 8029ba6c8920e379ea1f5f71afc297bfd30925b3 Author: Lars Wendler gentoo org> AuthorDate: Sat Apr 20 20:31:38 2019 +0000 Commit: Lars Wendler gentoo org> CommitDate: Sat Apr 20 20:33:43 2019 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8029ba6c app-misc/uptimed: Attempt to fix privilege escalation in pkg_postinst Bug: https://bugs.gentoo.org/630810 Package-Manager: Portage-2.3.64, Repoman-2.3.12 Signed-off-by: Lars Wendler gentoo.org> app-misc/uptimed/uptimed-0.4.0-r1.ebuild | 19 +++++++++++++------ app-misc/uptimed/uptimed-0.4.1.ebuild | 19 +++++++++++++------ 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/app-misc/uptimed/uptimed-0.4.0-r1.ebuild b/app-misc/uptimed/uptimed-0.4.0-r1.ebuild index 2fbdfafd16b..cea4bac4db8 100644 --- a/app-misc/uptimed/uptimed-0.4.0-r1.ebuild +++ b/app-misc/uptimed/uptimed-0.4.0-r1.ebuild @@ -1,9 +1,9 @@ -# Copyright 1999-2017 Gentoo Foundation +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=6 -inherit autotools eutils user systemd +inherit autotools ltprune user systemd DESCRIPTION="System uptime record daemon that keeps track of your highest uptimes" HOMEPAGE="https://github.com/rpodgorny/uptimed/" @@ -36,15 +36,22 @@ src_install() { local DOCS=( ChangeLog README.md TODO AUTHORS CREDITS INSTALL.cgi sample-cgi/* ) default prune_libtool_files --all - keepdir /var/spool/uptimed - fowners uptimed:uptimed /var/spool/uptimed + + local spooldir="/var/spool/${PN}" + keepdir ${spooldir} + fowners uptimed:uptimed ${spooldir} + newinitd "${FILESDIR}"/${PN}.init-r1 uptimed systemd_dounit "${FILESDIR}/${PN}.service" } pkg_postinst() { - einfo "Fixing permissions in /var/spool/${PN}" - chown -R uptimed:uptimed /var/spool/${PN} + local spooldir="/var/spool/${PN}" + if [[ -d "${spooldir}" ]] ; then + einfo "Fixing permissions in ${spooldir}" + find ${spooldir} -type f -print0 \ + | xargs --null chown uptimed:uptimed || die + fi echo elog "Start uptimed with '/etc/init.d/uptimed start' (for openRC)" elog "or systemctl start uptimed (for systemd)" diff --git a/app-misc/uptimed/uptimed-0.4.1.ebuild b/app-misc/uptimed/uptimed-0.4.1.ebuild index 498d1fc6475..cc06a89220a 100644 --- a/app-misc/uptimed/uptimed-0.4.1.ebuild +++ b/app-misc/uptimed/uptimed-0.4.1.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2018 Gentoo Foundation +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=6 @@ -33,16 +33,23 @@ src_configure() { src_install() { local DOCS=( ChangeLog README.md TODO AUTHORS CREDITS INSTALL.cgi sample-cgi/* ) default - find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die - keepdir /var/spool/uptimed - fowners uptimed:uptimed /var/spool/uptimed + find "${ED}" -name '*.la' -delete || die + + local spooldir="/var/spool/${PN}" + keepdir ${spooldir} + fowners uptimed:uptimed ${spooldir} + newinitd "${FILESDIR}"/${PN}.init-r1 uptimed systemd_dounit "${FILESDIR}/${PN}.service" } pkg_postinst() { - einfo "Fixing permissions in /var/spool/${PN}" - chown -R uptimed:uptimed /var/spool/${PN} + local spooldir="/var/spool/${PN}" + if [[ -d "${spooldir}" ]] ; then + einfo "Fixing permissions in ${spooldir}" + find ${spooldir} -type f -print0 \ + | xargs --null chown uptimed:uptimed || die + fi echo elog "Start uptimed with '/etc/init.d/uptimed start' (for openRC)" elog "or systemctl start uptimed (for systemd)"