Gentoo Archives: gentoo-commits

From: Lars Wendler <polynomial-c@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-misc/uptimed/, app-misc/uptimed/files/
Date: Mon, 28 Aug 2017 23:04:50
Message-Id: 1503961481.3eaffbeb6908660dc67de8a0fb8526de7dab9154.polynomial-c@gentoo
1 commit: 3eaffbeb6908660dc67de8a0fb8526de7dab9154
2 Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
3 AuthorDate: Mon Aug 28 23:04:03 2017 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Mon Aug 28 23:04:41 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3eaffbeb
7
8 app-misc/uptimed: Revbump to fix PID file sec issue (bug #629238).
9
10 Thanks to Michael Orlitzky for finding the issue and providing a fixed init
11 script.
12 Bumped straight to stable.
13
14 Package-Manager: Portage-2.3.8, Repoman-2.3.3
15
16 app-misc/uptimed/files/uptimed.init | 13 -------------
17 app-misc/uptimed/files/uptimed.init-r1 | 18 ++++++++++++++++++
18 .../{uptimed-0.4.0.ebuild => uptimed-0.4.0-r1.ebuild} | 2 +-
19 3 files changed, 19 insertions(+), 14 deletions(-)
20
21 diff --git a/app-misc/uptimed/files/uptimed.init b/app-misc/uptimed/files/uptimed.init
22 deleted file mode 100644
23 index 0f024d0b41f..00000000000
24 --- a/app-misc/uptimed/files/uptimed.init
25 +++ /dev/null
26 @@ -1,13 +0,0 @@
27 -#!/sbin/openrc-run
28 -# Copyright 1999-2016 Gentoo Foundation
29 -# Distributed under the terms of the GNU General Public License v2
30 -
31 -description="uptimed - a daemon to record uptime records"
32 -pidfile="/var/run/uptimed/uptimed.pid"
33 -command="/usr/sbin/uptimed"
34 -command_args="-p ${pidfile}"
35 -start_stop_daemon_args="-u uptimed"
36 -
37 -start_pre() {
38 - checkpath -q -d -o uptimed ${pidfile%/*}
39 -}
40
41 diff --git a/app-misc/uptimed/files/uptimed.init-r1 b/app-misc/uptimed/files/uptimed.init-r1
42 new file mode 100644
43 index 00000000000..96564d8ee54
44 --- /dev/null
45 +++ b/app-misc/uptimed/files/uptimed.init-r1
46 @@ -0,0 +1,18 @@
47 +#!/sbin/openrc-run
48 +# Copyright 1999-2017 Gentoo Foundation
49 +# Distributed under the terms of the GNU General Public License v2
50 +
51 +description="uptimed - a daemon to record uptime records"
52 +pidfile="/run/uptimed.pid"
53 +command="/usr/sbin/uptimed"
54 +command_user="uptimed"
55 +
56 +# The uptimed daemon can create its own PID file, but it doesn't know
57 +# how to drop privileges. On the other hand, if we run it as a
58 +# restricted user under start-stop-daemon, the PID file it creates
59 +# will therefore be owned by a non-root user, and that poses a
60 +# security risk. To avoid the issue entirely, we run the daemon in the
61 +# foreground, and then use command_background=true to let OpenRC
62 +# handle the PID file.
63 +command_args="-f"
64 +command_background="true"
65
66 diff --git a/app-misc/uptimed/uptimed-0.4.0.ebuild b/app-misc/uptimed/uptimed-0.4.0-r1.ebuild
67 similarity index 96%
68 rename from app-misc/uptimed/uptimed-0.4.0.ebuild
69 rename to app-misc/uptimed/uptimed-0.4.0-r1.ebuild
70 index f0ab25d8ac0..2fbdfafd16b 100644
71 --- a/app-misc/uptimed/uptimed-0.4.0.ebuild
72 +++ b/app-misc/uptimed/uptimed-0.4.0-r1.ebuild
73 @@ -38,7 +38,7 @@ src_install() {
74 prune_libtool_files --all
75 keepdir /var/spool/uptimed
76 fowners uptimed:uptimed /var/spool/uptimed
77 - newinitd "${FILESDIR}"/${PN}.init uptimed
78 + newinitd "${FILESDIR}"/${PN}.init-r1 uptimed
79 systemd_dounit "${FILESDIR}/${PN}.service"
80 }