summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wendler <polynomial-c@gentoo.org>2017-08-29 01:04:03 +0200
committerLars Wendler <polynomial-c@gentoo.org>2017-08-29 01:04:41 +0200
commit3eaffbeb6908660dc67de8a0fb8526de7dab9154 (patch)
treee4d0925a76c4eba8267096870a33373b4c01c928 /app-misc/uptimed
parentmedia-libs/mesa: Version bump to 17.1.8 (diff)
downloadgentoo-3eaffbeb6908660dc67de8a0fb8526de7dab9154.tar.gz
gentoo-3eaffbeb6908660dc67de8a0fb8526de7dab9154.tar.bz2
gentoo-3eaffbeb6908660dc67de8a0fb8526de7dab9154.zip
app-misc/uptimed: Revbump to fix PID file sec issue (bug #629238).
Thanks to Michael Orlitzky for finding the issue and providing a fixed init script. Bumped straight to stable. Package-Manager: Portage-2.3.8, Repoman-2.3.3
Diffstat (limited to 'app-misc/uptimed')
-rw-r--r--app-misc/uptimed/files/uptimed.init13
-rw-r--r--app-misc/uptimed/files/uptimed.init-r118
-rw-r--r--app-misc/uptimed/uptimed-0.4.0-r1.ebuild (renamed from app-misc/uptimed/uptimed-0.4.0.ebuild)2
3 files changed, 19 insertions, 14 deletions
diff --git a/app-misc/uptimed/files/uptimed.init b/app-misc/uptimed/files/uptimed.init
deleted file mode 100644
index 0f024d0b41fd..000000000000
--- a/app-misc/uptimed/files/uptimed.init
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/sbin/openrc-run
-# Copyright 1999-2016 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-description="uptimed - a daemon to record uptime records"
-pidfile="/var/run/uptimed/uptimed.pid"
-command="/usr/sbin/uptimed"
-command_args="-p ${pidfile}"
-start_stop_daemon_args="-u uptimed"
-
-start_pre() {
- checkpath -q -d -o uptimed ${pidfile%/*}
-}
diff --git a/app-misc/uptimed/files/uptimed.init-r1 b/app-misc/uptimed/files/uptimed.init-r1
new file mode 100644
index 000000000000..96564d8ee541
--- /dev/null
+++ b/app-misc/uptimed/files/uptimed.init-r1
@@ -0,0 +1,18 @@
+#!/sbin/openrc-run
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+description="uptimed - a daemon to record uptime records"
+pidfile="/run/uptimed.pid"
+command="/usr/sbin/uptimed"
+command_user="uptimed"
+
+# The uptimed daemon can create its own PID file, but it doesn't know
+# how to drop privileges. On the other hand, if we run it as a
+# restricted user under start-stop-daemon, the PID file it creates
+# will therefore be owned by a non-root user, and that poses a
+# security risk. To avoid the issue entirely, we run the daemon in the
+# foreground, and then use command_background=true to let OpenRC
+# handle the PID file.
+command_args="-f"
+command_background="true"
diff --git a/app-misc/uptimed/uptimed-0.4.0.ebuild b/app-misc/uptimed/uptimed-0.4.0-r1.ebuild
index f0ab25d8ac00..2fbdfafd16b3 100644
--- a/app-misc/uptimed/uptimed-0.4.0.ebuild
+++ b/app-misc/uptimed/uptimed-0.4.0-r1.ebuild
@@ -38,7 +38,7 @@ src_install() {
prune_libtool_files --all
keepdir /var/spool/uptimed
fowners uptimed:uptimed /var/spool/uptimed
- newinitd "${FILESDIR}"/${PN}.init uptimed
+ newinitd "${FILESDIR}"/${PN}.init-r1 uptimed
systemd_dounit "${FILESDIR}/${PN}.service"
}