Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 603702 - app-i18n/canna: init script should use checkpath instead of touch/chmod/chown
Summary: app-i18n/canna: init script should use checkpath instead of touch/chmod/chown
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: CJK Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-25 16:18 UTC by Michael Orlitzky
Modified: 2017-07-08 07:51 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-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.