Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 603412 - net-proxy/ufdbguard: init script should use checkpath to create directories
Summary: net-proxy/ufdbguard: init script should use checkpath to create directories
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-22 01:46 UTC by Michael Orlitzky
Modified: 2016-12-26 23:45 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-22 01:46:39 UTC
The init script for ufdbguard creates two directories,

  if [ ! -d "${logdir}" ] ; then
      mkdir -p ${logdir}
      chown -R ${UFDB_USER} ${logdir}
  fi

  if [ ! -d /var/run/ufdbguardd ] ; then
      mkdir -p /var/run/ufdbguard
      chown -R ${UFDB_USER} /var/run/ufdbguard
  fi

Two calls to "checkpath" from OpenRC (man openrc-run) would be more appropriate here. It's more portable, being part of OpenRC, and will avoid unintended side effects (why use "-R" if the directory should be empty?). Most importantly, checkpath will refuse to follow symlinks, which eliminates one class of security vulnerabilities.
Comment 1 Michael Orlitzky gentoo-dev 2016-12-26 23:45:33 UTC
I missed that there's a new revision of the init script for this package.