]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
pf: Return non-zero from 'status' if pf is not enabled
authorkp <kp@FreeBSD.org>
Wed, 6 Jun 2018 19:36:37 +0000 (19:36 +0000)
committerkp <kp@FreeBSD.org>
Wed, 6 Jun 2018 19:36:37 +0000 (19:36 +0000)
commit86ab05f953ab74b480bd2f0bbac3900ba1d7f80a
tree14195f93ffa9c7b9903338677a0f01b2a6fa21f8
parenta14ea730b654194dbd48675a502a45f7b7284323
pf: Return non-zero from 'status' if pf is not enabled

In the pf rc.d script the output of `/etc/rc.d/pf status` or `/etc/rc.d/pf
onestatus` always provided an exit status of zero. This made it fiddly to
programmatically determine if pf was running or not.

Return a non-zero status if the pf module is not loaded, extend pfctl to have
an option to return an error status if pf is not enabled.

PR: 228632
Submitted by: James Park-Watt <jimmypw AT gmail.com>
MFC after: 1 week
etc/rc.d/pf
sbin/pfctl/pfctl.8
sbin/pfctl/pfctl.c
sbin/pfctl/pfctl_parser.c
sbin/pfctl/pfctl_parser.h