diff options
author | 2017-09-16 12:55:34 +0200 | |
---|---|---|
committer | 2017-09-16 12:57:53 +0200 | |
commit | ae1766daedf1ac9b767fc682495a9e2ce123e800 (patch) | |
tree | b757d526aaf4a0d62249cce6e46a0dfc4fdbfe3c /net-misc/spiped/files | |
parent | dev-lang/crystal: add llvm-5 support, bug #630634 (diff) | |
download | gentoo-ae1766daedf1ac9b767fc682495a9e2ce123e800.tar.gz gentoo-ae1766daedf1ac9b767fc682495a9e2ce123e800.tar.bz2 gentoo-ae1766daedf1ac9b767fc682495a9e2ce123e800.zip |
net-misc/spiped: update initd script and avoid privilege escalation.
Gentoo-Bug: https://bugs.gentoo.org/631022
Package-Manager: Portage-2.3.6, Repoman-2.3.1
Diffstat (limited to 'net-misc/spiped/files')
-rw-r--r-- | net-misc/spiped/files/spiped.initd | 39 |
1 files changed, 13 insertions, 26 deletions
diff --git a/net-misc/spiped/files/spiped.initd b/net-misc/spiped/files/spiped.initd index 0f33ccfa9cdb..ccc95ac80add 100644 --- a/net-misc/spiped/files/spiped.initd +++ b/net-misc/spiped/files/spiped.initd @@ -1,13 +1,19 @@ #!/sbin/openrc-run -# Copyright 1999-2015 Gentoo Foundation +# Copyright 1999-2017 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -KEYFILE=${KEYFILE:="/etc/spiped/keyfile"} -SPIPED_USER=${SPIPED_USER:="nobody"} -PIDFILE="/run/spiped/spiped.pid" +: ${KEYFILE:="/etc/spiped/keyfile"} +: ${SPIPED_USER:="nobody"} -command="spiped" -command_args="${OPTS} -s [${SRCHOST}]:${SRCPORT} -t ${TARGETHOST}:${TARGETPORT} -k ${KEYFILE} -p ${PIDFILE}" +command="/usr/sbin/spiped" +command_args="${OPTS} + -s [${SRCHOST}]:${SRCPORT} + -t ${TARGETHOST}:${TARGETPORT} + -k ${KEYFILE} + -F" +command_background="true" +command_user="${SPIPED_USER}" +pidfile="/run/${RC_SVCNAME}.pid" depend() { use net @@ -21,25 +27,6 @@ checkconfig() { fi } -start() { +start_pre() { checkconfig || return 1 - - ebegin "Starting ${SVCNAME}" - checkpath -d -o "${SPIPED_USER}" -m750 "$(dirname "${PIDFILE}")" - - start-stop-daemon --start \ - --user ${SPIPED_USER} \ - --pidfile ${PIDFILE} \ - --exec $command -- $command_args - - eend $? -} - -stop() { - ebegin "Stopping ${SVCNAME}" - - start-stop-daemon --stop \ - --pidfile ${PIDFILE} - - eend $? } |