Bug 246158 - USE_RC_SUBR ought to check or enforce script ownership
Summary: USE_RC_SUBR ought to check or enforce script ownership
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Port Management Team
URL: https://reviews.freebsd.org/D25295
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-04 06:23 UTC by Chad Jacob Milios
Modified: 2020-06-25 12:38 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chad Jacob Milios 2020-05-04 06:23:11 UTC
USE_RC_SUBR implicitly adds the script to the end of the plist, affected by @owner and @group. This invites some foot-shooting.

I noticed an rc.d script owned by the daemon it controlled. I added a patch to PR# 218179.

Then I asked myself if modifying the operation of USE_RC_SUBR to avoid this happening might be a better solution. At the bare minimum the appropriate page in the Porter's Handbook deserves a note. I don't have patches provided for any of that, I'm sorry.

I don't know that portlint does or doesn't check for this issue. Still though, even if it does, any hypothetical reason that the rc.d script have an owner besides root (and i can't think of a valid one without going very contrived) should be equal reason to point it out to the user during the install process.
Comment 1 Mathieu Arnold freebsd_committer 2020-06-16 12:23:36 UTC
Tentative patch in D25295
Comment 2 commit-hook freebsd_committer 2020-06-25 12:37:58 UTC
A commit references this bug:

Author: mat
Date: Thu Jun 25 12:37:26 UTC 2020
New revision: 540386
URL: https://svnweb.freebsd.org/changeset/ports/540386

Log:
  Make sure rc files are owned by root:wheel with a sensible mode.

  PR:		246158
  Reported by:	Chad Jacob Milios
  Differential Revision:	https://reviews.freebsd.org/D25295

Changes:
  head/Mk/bsd.port.mk