opscode/chef — pull request #1833 by bahamas10 (2014-08-14 18:52:14+00:00)
Title: tighten up /etc/rc.conf regex

I've run into a fun issue on FreeBSD 10 when trying to disable `syslogd`,
and enable `rsyslogd`.

Initially, the /etc/rc.conf config file may look something like this

syslogd_enable="YES"
rsyslogd_enable="NO"

And after chef it *should* look this

rsyslogd_enable="YES"
syslogd_enable="NO"

However, because the regex isn't as tight as it could be, it will search for
`syslogd_enable="(\w+)"`, and erroneously match the `rsyslogd` line, which leads
Chef to believe that `syslogd` is enabled, when in reality it isn't. This change
simply anchors the regex with `^` so the pattern must match at the beginning of
the line.

PS: This is my first time submitting a change to Chef after the move off of Jira, but I've already signed the CLA and am number 753 on the approved contributors list.