From 89c84f9f0760a625d249efc1babf0f4746dd43e8 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Sat, 29 Jun 2024 02:34:28 -0400 Subject: [PATCH] Ignore (with warning) unknown vars in `--options` --- ddclient.in | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ddclient.in b/ddclient.in index 958b394..716682d 100755 --- a/ddclient.in +++ b/ddclient.in @@ -2002,6 +2002,11 @@ sub init_config { # TODO: This might grab an arbitrary protocol-specific variable, which could cause # surprising behavior. my $def = $variables{'merged'}{$k}; + if (!$def) { + warning("ignoring unknown setting '$k=$globals{$k}'"); + delete($globals{$k}); + next; + } # TODO: Isn't $globals{$k} guaranteed to be defined here? Otherwise $k wouldn't appear in # %globals. my $ovalue = $globals{$k} // $def->{'default'};