ddns-updater icon indicating copy to clipboard operation
ddns-updater copied to clipboard

Bug: ddns-updater ignores unknown arguments

Open maruel opened this issue 9 months ago • 0 comments

TLDR: Running ddns-updater --unknown-argument runs ignoring unknown arguments

  1. Is this urgent: No
  2. DNS provider(s) you use: N/A
  3. Program version: v2.9.0
  4. What are you using to run the container: running directly via go install
  5. Extra information:
    • Host OS: ubuntu 22.04

Issue

Because of the way the arguments are treated as if they were environment variables, all arguments are processed even if they are not defined nor used.

This is a problem when someone does a typo in the argument, as the typo'ed argument will be silently ignored. This is very confusing for users.

Proposal

  1. Do not silently ignore unknown subcommands in _main().
  2. Do not silently ignore unknown arguments. Enforce an allowlist of arguments. This requires changing flag.New() from gosettings to have an allowlist.

maruel avatar Jan 23 '25 21:01 maruel