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

Bug 603336

Summary: mail-filter/rmilter: init script should use checkpath instead of mkdir/chown/chmod
Product: Gentoo Linux Reporter: Michael Orlitzky <mjo>
Component: Current packagesAssignee: Dirkjan Ochtman (RETIRED) <djc>
Status: RESOLVED FIXED    
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:47:19 UTC
(This is the same as bug #603248)

The init script for rmilter creates its socket directory with,

  mkdir -m0750 -p $RUNDIR
  chown rmilter:rmilter $RUNDIR
  chmod g+s $RUNDIR

It would be better to use a single call to "checkpath" from OpenRC. It's more portable, being part of OpenRC, and more secure: with chown and chmod, you run the risk of following symlinks if the "rmilter" user is ever able to overwrite that path. Doing so would essentially give rmilter root, since he could take ownership of any path on the system.
Comment 1 Dirkjan Ochtman (RETIRED) gentoo-dev 2017-01-03 19:01:16 UTC
Fixed in the tree.