Remove the chown call from the openrc init script start_post function,
in order to prevent privilege escalation attacks. It is unsafe to call
chown in a directory that is not owned by root, since the target file
could be a hardlink to a root-owned file.
X-Gentoo-bug: 602550
X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=602550
Package-Manager: portage-2.3.3
start_pre() {
checkpath -d -m 0755 -o "${user}":"${group}" "${pidfile%/*}"
}
-
-start_post() {
- # Use -h to prevent privilege escalation attacks. Fixes bug #602550.
- chown -h "${user}":"${group}" "${logfile}"
-}
/var/log/peervpn/peervpn.log {
- su peervpn peervpn
missingok
size 5M
rotate 3
systemd_dounit "${FILESDIR}/${PN}.service"
keepdir /var/log/${PN}
- fowners ${PN}:${PN} /var/log/${PN}
insinto /etc/logrotate.d
newins "${FILESDIR}/${PN}.logrotated" "${PN}"
}