From af16b851dc7c7b821d86b07f070dd8e212669274 Mon Sep 17 00:00:00 2001 From: "Brian S. Stephan" Date: Tue, 11 Apr 2023 19:31:02 -0500 Subject: [PATCH] don't put unrealircd's pidfile where unrealircd could write it --- net-irc/unrealircd/files/unrealircd.initd-r4 | 9 +-------- net-irc/unrealircd/files/unrealircd.tmpfiles | 1 - net-irc/unrealircd/unrealircd-6.0.7.ebuild | 4 ++-- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/net-irc/unrealircd/files/unrealircd.initd-r4 b/net-irc/unrealircd/files/unrealircd.initd-r4 index d7398a5..29b3bc3 100644 --- a/net-irc/unrealircd/files/unrealircd.initd-r4 +++ b/net-irc/unrealircd/files/unrealircd.initd-r4 @@ -4,7 +4,7 @@ # Defaults : ${UNREALIRCD_CONF:=/etc/unrealircd/${SVCNAME}.conf} -: ${UNREALIRCD_PIDFILE:=/run/unrealircd/${SVCNAME#unreal}.pid} +: ${UNREALIRCD_PIDFILE:=/run/${SVCNAME#unreal}.pid} # Convenience variable for the chroot bits, not actually user-controllable via conf.d UNREALIRCD_USER="unrealircd" @@ -42,14 +42,7 @@ depend() { provide ircd } -# It is unsafe for the unrealircd user to be able to write to its own -# PID file, since root will be sending e.g. kill signals to the PID -# listed in that file. Ensure that we overwrite the ownership and -# permissions on /run/unrealircd from previous init scripts. start_pre() { - # commented out pending information about where to do pidfile vs. socket stuff - # checkpath --directory --owner root:root --mode 0700 "${UNREALIRCD_CHROOT}"/run/unrealircd - checkconfig || return $? } diff --git a/net-irc/unrealircd/files/unrealircd.tmpfiles b/net-irc/unrealircd/files/unrealircd.tmpfiles index 37afe71..8aed34b 100644 --- a/net-irc/unrealircd/files/unrealircd.tmpfiles +++ b/net-irc/unrealircd/files/unrealircd.tmpfiles @@ -1,2 +1 @@ d /run/unrealircd 755 unrealircd unrealircd - diff --git a/net-irc/unrealircd/unrealircd-6.0.7.ebuild b/net-irc/unrealircd/unrealircd-6.0.7.ebuild index e8ef8a0..cf96c67 100644 --- a/net-irc/unrealircd/unrealircd-6.0.7.ebuild +++ b/net-irc/unrealircd/unrealircd-6.0.7.ebuild @@ -71,7 +71,7 @@ src_configure() { --with-logdir="${EPREFIX}"/var/log/${PN} \ --with-modulesdir="${EPREFIX}/usr/$(get_libdir)"/${PN}/modules \ --without-privatelibdir \ - --with-pidfile="${EPREFIX}"/run/${PN}/ircd.pid \ + --with-pidfile="${EPREFIX}"/run/${PN}.pid \ --with-tmpdir="${EPREFIX}"/var/lib/${PN}/tmp \ --with-maxconnections=1024 \ --with-nick-history=2000 \ @@ -82,7 +82,7 @@ src_configure() { --with-system-sodium \ --with-system-jansson \ --enable-dynamic-linking \ - --with-controlfile="${EPREFIX}"/run/${PN}/unrealircd.ctl \ + --with-controlfile="${EPREFIX}"/run/${PN}/${PN}.ctl \ --enable-ssl="${EPREFIX}"/usr \ $(use_enable curl libcurl "${EPREFIX}"/usr) \ $(use_with !operoverride no-operoverride) \