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

Bug 603702

Summary: app-i18n/canna: init script should use checkpath instead of touch/chmod/chown
Product: Gentoo Linux Reporter: Michael Orlitzky <mjo>
Component: Current packagesAssignee: CJK Team <cjk>
Status: RESOLVED FIXED    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=540006
Whiteboard:
Package list:
Runtime testing required: ---

Description Michael Orlitzky gentoo-dev 2016-12-25 16:18:18 UTC
The init script for canna creates its own log file:

  ...
  else
    touch "${CANNASERVER_LOGFILE}"
    chmod u+w "${CANNASERVER_LOGFILEj}"
  fi

  if [ ! -z "${CANNASERVER_OWNER}" ] ; then
    if [ -f "${CANNASERVER_LOGFILE}" ] ; then
      chown "${CANNASERVER_OWNER}" "${CANNASERVER_LOGFILE}"
    fi
    ...

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

I don't see any problem with the chown/chmod above, but since checkpath is preferable anyway, their absence would provide some peace of mind.