Bug 175079

Summary: [rc.subr] [patch] rc.subr poorly handles recursive run_rc_command invocations
Product: Base System Reporter: Yuriy Taraday <yorik.sar>
Component: confAssignee: freebsd-bugs (Nobody) <bugs>
Status: Open ---    
Severity: Affects Only Me Keywords: patch
Priority: Normal    
Version: 8.3-RELEASE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description Yuriy Taraday 2013-01-06 23:10:00 UTC
When custom precmd or cmd calls run_rc_command, postcmd and/or cmd are most likely to be missed.
For example, when squid stop_cmd calls "run_rc_command poll", _postcmd variable is overwritten and my postcmd was never called.

Fix: Proposed patch makes these variables local to function so that they are not overwritten in caller's namespace.

Patch attached with submission follows:
How-To-Repeat: Add your custom stop_postcmd for squid in /etc/rc.conf.d/squid. It will never be called.
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2013-01-07 03:25:40 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-rc

Over to maintainer(s).
Comment 2 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 07:59:39 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped
Comment 3 Graham Perrin freebsd_committer freebsd_triage 2022-10-17 12:34:50 UTC
Keyword: 

    patch
or  patch-ready

– in lieu of summary line prefix: 

    [patch]

* bulk change for the keyword
* summary lines may be edited manually (not in bulk). 

Keyword descriptions and search interface: 

    <https://bugs.freebsd.org/bugzilla/describekeywords.cgi>