From fd5cdaa7a6688eb8ec5c8df26be27253b8ca140f Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Sat, 4 Nov 2023 16:01:02 -0500 Subject: ddclient: T5708: Validate proper use of `web-options` `web-options` is only applicable when using HTTP(S) web request to obtain the IP address. Apply guard for that. --- src/conf_mode/dns_dynamic.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/conf_mode/dns_dynamic.py') diff --git a/src/conf_mode/dns_dynamic.py b/src/conf_mode/dns_dynamic.py index 874c4b689..d71dc22fd 100755 --- a/src/conf_mode/dns_dynamic.py +++ b/src/conf_mode/dns_dynamic.py @@ -81,6 +81,10 @@ def verify(dyndns): raise ConfigError(f'"{field.replace("_", "-")}" is required for RFC2136 ' f'based Dynamic DNS service on "{address}"') + # Dynamic DNS service provider - configuration validation + if 'web_options' in dyndns['address'][address] and address != 'web': + raise ConfigError(f'"web-options" is applicable only when using HTTP(S) web request to obtain the IP address') + # Dynamic DNS service provider - configuration validation if 'service' in dyndns['address'][address]: for service, config in dyndns['address'][address]['service'].items(): -- cgit v1.2.3