mirror of
https://github.com/systemd/systemd.git
synced 2024-10-30 23:21:22 +03:00
resolve-tool: propagate sensible errors from due to dns_name_is_valid() check failures
This commit is contained in:
parent
27d8af3e39
commit
9f0454a833
@ -2131,8 +2131,10 @@ static int parse_argv(int argc, char *argv[]) {
|
||||
r = dns_name_is_valid(p);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to validate specified domain %s: %m", p);
|
||||
if (r == 0)
|
||||
return log_error_errno(r, "Domain not valid: %s", p);
|
||||
if (r == 0) {
|
||||
log_error("Domain not valid: %s", p);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
r = strv_extend(&arg_set_domain, optarg);
|
||||
if (r < 0)
|
||||
@ -2170,8 +2172,10 @@ static int parse_argv(int argc, char *argv[]) {
|
||||
r = dns_name_is_valid(optarg);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to validate specified domain %s: %m", optarg);
|
||||
if (r == 0)
|
||||
return log_error_errno(r, "Domain not valid: %s", optarg);
|
||||
if (r == 0) {
|
||||
log_error("Domain not valid: %s", optarg);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
r = strv_extend(&arg_set_nta, optarg);
|
||||
if (r < 0)
|
||||
|
Loading…
Reference in New Issue
Block a user