Skip to content

Commit

Permalink
Quieter output when auth domain is a TLD
Browse files Browse the repository at this point in the history
  • Loading branch information
tedjp committed Oct 22, 2009
1 parent 8d3a67a commit d30f7ff
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
11 changes: 11 additions & 0 deletions conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,17 @@ config_get_string(const char *key, const char *def_value)
return config->value;
}

/* Returns nonzero if a configuration setting is set explicitly,
* or zero if it is not set.
*/
int
config_is_set(const char *key)
{
if (config_get(key))
return 1;
return 0;
}

/*------------------------------------------------------------
* Private config functions
*/
Expand Down
10 changes: 7 additions & 3 deletions dnsupdate.c
Original file line number Diff line number Diff line change
Expand Up @@ -1349,10 +1349,14 @@ main(int argc, char **argv)

/* Check for non FQDNs and top-level domain names */
if (count_dots(auth_domain) < 1) {
warnx("auth domain '%.255s' is top-level", auth_domain);
if (verbose)
warnx("auth domain '%.255s' is top-level", auth_domain);

if (config_get_int("UpdateTopLevelDomainZones", 0) == 0) {
if (verbose)
warnx("Refusing to update top level domain zones\n");
/* Be silent unless TLD updates are explicitly enabled. */
if (config_is_set("UpdateTopLevelDomainZones"))
warnx("Refusing to update top level domain zone \"%.255s\"",
auth_domain);
continue;
}
}
Expand Down

0 comments on commit d30f7ff

Please sign in to comment.