libpfctl: introduce a handle-enabled variant of pfctl_add_rule()
authorKristof Provost <kp@FreeBSD.org>
Thu, 4 Jan 2024 12:45:56 +0000 (13:45 +0100)
committerKristof Provost <kp@FreeBSD.org>
Thu, 4 Jan 2024 22:10:44 +0000 (23:10 +0100)
commit324fd7ec40439e6b3916429a69956d7acf74eb19
tree44d165d05672e8b51f4101485acf07543e6fdc67
parent66cacc141d372fdfa624a380bac6880ecf809994
libpfctl: introduce a handle-enabled variant of pfctl_add_rule()

Introduce pfctl_add_rule_h(), which takes a pfctl_handle rather than a
file descriptor (which it didn't use). This means that library users can
open the handle while they're running as root, but later drop privileges
and still add rules to pf.

Sponsored by: Rubicon Communications, LLC ("Netgate")
contrib/pf/ftp-proxy/filter.c
contrib/pf/tftp-proxy/filter.c
lib/libpfctl/libpfctl.c
lib/libpfctl/libpfctl.h