mirror of
https://git.freebsd.org/ports.git
synced 2025-04-28 01:26:39 -04:00
net/isc-dhcp44-server: Fix checkconfig command.
This adds an undocumented -Q flag which cancels out any -q option that may be present in dhcpd_flags, avoiding the need for a fragile sed command. It also adds a comment explaining why we are running the check twice and what the -q and -Q are for. PR: 281701
This commit is contained in:
parent
be18158f3c
commit
6725d10536
3 changed files with 22 additions and 11 deletions
|
@ -19,7 +19,7 @@ USES= cpe gmake
|
|||
|
||||
CPE_VENDOR= isc
|
||||
|
||||
PORTREVISION_SERVER= 1
|
||||
PORTREVISION_SERVER= 2
|
||||
PORTREVISION_CLIENT= 1
|
||||
PORTREVISION_RELAY= 1
|
||||
|
||||
|
|
|
@ -499,16 +499,15 @@ dhcpd_restartprecmd ()
|
|||
|
||||
dhcpd_checkconfig ()
|
||||
{
|
||||
local rc_flags_mod
|
||||
setup_flags
|
||||
rc_flags_mod="$rc_flags"
|
||||
# Eliminate '-q' flag if it is present
|
||||
case "$rc_flags" in
|
||||
*-q*) rc_flags_mod=`echo "${rc_flags}" | sed -Ee 's/(^-q | -q | -q$)//'` ;;
|
||||
esac
|
||||
if ! ${command} -t -q ${rc_flags_mod}; then
|
||||
err 1 "`${command} -t ${rc_flags_mod}` Configuration file sanity check failed"
|
||||
fi
|
||||
setup_flags
|
||||
# Run dhcpcd -t quietly to check for errors. If this fails,
|
||||
# run it again unquietly so the errors are shown to the user,
|
||||
# then error out. The -q and -Q flags need to be at the end
|
||||
# to override contradictory flags in ${rc_flags}.
|
||||
if ! ${command} -t ${rc_flags} -q; then
|
||||
${command} -t ${rc_flags} -Q
|
||||
err 1 "Configuration file sanity check failed"
|
||||
fi
|
||||
}
|
||||
|
||||
rcvar=${name}_enable
|
||||
|
|
12
net/isc-dhcp44-server/files/patch-server_dhcpd.c
Normal file
12
net/isc-dhcp44-server/files/patch-server_dhcpd.c
Normal file
|
@ -0,0 +1,12 @@
|
|||
--- server/dhcpd.c.orig 2022-09-28 14:39:15 UTC
|
||||
+++ server/dhcpd.c
|
||||
@@ -492,6 +492,9 @@ main(int argc, char **argv) {
|
||||
cftest = 1;
|
||||
lftest = 1;
|
||||
log_perror = -1;
|
||||
+ } else if (!strcmp (argv [i], "-Q")) {
|
||||
+ quiet = 0;
|
||||
+ quiet_interface_discovery = 0;
|
||||
} else if (!strcmp (argv [i], "-q")) {
|
||||
quiet = 1;
|
||||
quiet_interface_discovery = 1;
|
Loading…
Add table
Reference in a new issue