diff options
author | Lars Wendler <polynomial-c@gentoo.org> | 2019-04-20 22:31:38 +0200 |
---|---|---|
committer | Lars Wendler <polynomial-c@gentoo.org> | 2019-04-20 22:33:43 +0200 |
commit | 8029ba6c8920e379ea1f5f71afc297bfd30925b3 (patch) | |
tree | e534ae7f43d862df83b092e0d0de21f251f81e54 /app-misc/uptimed | |
parent | gnome-extra/polkit-gnome: arm64 stable (diff) | |
download | gentoo-8029ba6c8920e379ea1f5f71afc297bfd30925b3.tar.gz gentoo-8029ba6c8920e379ea1f5f71afc297bfd30925b3.tar.bz2 gentoo-8029ba6c8920e379ea1f5f71afc297bfd30925b3.zip |
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 <polynomial-c@gentoo.org>
Diffstat (limited to 'app-misc/uptimed')
-rw-r--r-- | app-misc/uptimed/uptimed-0.4.0-r1.ebuild | 19 | ||||
-rw-r--r-- | 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 2fbdfafd16b3..cea4bac4db8e 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 498d1fc64756..cc06a89220a9 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)" |