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

Bug 603462

Summary: net-p2p/transmission: init script should use checkpath instead of mkdir/chown
Product: Gentoo Linux Reporter: Michael Orlitzky <mjo>
Component: Current packagesAssignee: Mike Gilbert <floppym>
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-22 13:44:33 UTC
The init script for transmission creates its own runtime directory:

  if [ ! -d "${rundir}" ]; then
      mkdir "${rundir}"
      if [ -n "${runas_user}" ]; then
          chown -R ${runas_user} "${rundir}"
      fi
  fi

A single call to "checkpath" from OpenRC (man openrc-run) would be more appropriate here. It's simpler, more portable (being part of OpenRC), and more secure: chown will follow symlinks and hardlinks, but checkpath will not.

(I don't see any way to exploit the stanza above, but since checkpath is preferable anyway, the total absence of "chown" from the init script would be reassuring.)
Comment 1 Mike Gilbert gentoo-dev 2016-12-22 15:11:28 UTC
You are looking at an obsolete version of the init script.
Comment 2 Michael Orlitzky gentoo-dev 2016-12-22 16:06:20 UTC
(In reply to Mike Gilbert from comment #1)
> an obsolete version

Not... alphabetically =)

Sorry for the noise.