Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 603334 - net-irc/unrealircd: init script should use checkpath instead of mkdir/chown/chmod
Summary: net-irc/unrealircd: init script should use checkpath instead of mkdir/chown/c...
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Nathan Phillip Brink (binki) (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-21 13:09 UTC by Michael Orlitzky
Modified: 2017-08-20 20:17 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.