Bug: ddns-updater ignores unknown arguments #489

Open
opened 2025-11-20 04:24:32 -05:00 by saavagebueno · 0 comments
Owner

Originally created by @maruel on GitHub (Jan 23, 2025).

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.
Originally created by @maruel on GitHub (Jan 23, 2025). **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()](https://github.com/qdm12/ddns-updater/blob/master/cmd/ddns-updater/main.go#L105). 2. Do not silently ignore unknown arguments. Enforce an allowlist of arguments. This requires changing [flag.New() from gosettings](https://github.com/qdm12/gosettings/blob/main/reader/sources/flag/flag.go#L23) to have an allowlist.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ddns-updater#489