Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 603334

Summary: net-irc/unrealircd: init script should use checkpath instead of mkdir/chown/chmod
Product: Gentoo Linux Reporter: Michael Orlitzky <mjo>
Component: Current packagesAssignee: Nathan Phillip Brink (binki) (RETIRED) <binki>
Status: RESOLVED OBSOLETE    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Michael Orlitzky gentoo-dev 2016-12-21 13:09:00 UTC
The init script for unrealircd creates its PID file directory with,

  if ! [ -d "${UNREALIRCD_PIDFILEDIR}" ]; then
      ebegin "Creating ${UNREALIRCD_PIDFILEDIR} for ${SVCNAME}"
      mkdir "${UNREALIRCD_PIDFILEDIR}" \
          && chown :unrealircd "${UNREALIRCD_PIDFILEDIR}" \
          && chmod 770 "${UNREALIRCD_PIDFILEDIR}"

A single unconditional call to "checkpath" from OpenRC (man openrc-run) would be better. It's more portable, being part of OpenRC, and more secure: chown and chmod affect the *target* of symlinks, so if root:root ever loses full control of that path, then the unrealircd user could trick root (via the init script) into giving him ownership of any file on the system.
Comment 1 Michael Orlitzky gentoo-dev 2017-08-20 20:17:33 UTC
Obsoleted by bug 628434.