Revert "resolve: refuse to resolve empty hostname"
This reverts commit 6e8ecb8974.
This commit is contained in:
@@ -433,9 +433,6 @@ static int bus_method_resolve_hostname(sd_bus_message *message, void *userdata,
|
||||
if (r != 0)
|
||||
return r;
|
||||
|
||||
if (dns_name_is_empty(hostname))
|
||||
return sd_bus_error_set(error, SD_BUS_ERROR_INVALID_ARGS, "Empty hostname");
|
||||
|
||||
r = dns_name_is_valid(hostname);
|
||||
if (r < 0)
|
||||
return r;
|
||||
@@ -743,9 +740,6 @@ static int bus_method_resolve_record(sd_bus_message *message, void *userdata, sd
|
||||
if (ifindex < 0)
|
||||
return sd_bus_error_set(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid interface index");
|
||||
|
||||
if (dns_name_is_empty(name))
|
||||
return sd_bus_error_set(error, SD_BUS_ERROR_INVALID_ARGS, "Empty name");
|
||||
|
||||
r = dns_name_is_valid(name);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
@@ -303,9 +303,6 @@ static int vl_method_resolve_hostname(Varlink *link, JsonVariant *parameters, Va
|
||||
if (p.ifindex < 0)
|
||||
return varlink_error_invalid_parameter(link, JSON_VARIANT_STRING_CONST("ifindex"));
|
||||
|
||||
if (dns_name_is_empty(p.name))
|
||||
return varlink_error_invalid_parameter(link, JSON_VARIANT_STRING_CONST("name"));
|
||||
|
||||
r = dns_name_is_valid(p.name);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
@@ -60,10 +60,6 @@ static inline int dns_name_is_valid_ldh(const char *s) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
static inline bool dns_name_is_empty(const char *s) {
|
||||
return isempty(s) || streq(s, ".");
|
||||
}
|
||||
|
||||
void dns_name_hash_func(const char *s, struct siphash *state);
|
||||
int dns_name_compare_func(const char *a, const char *b);
|
||||
extern const struct hash_ops dns_name_hash_ops;
|
||||
|
||||
Reference in New Issue
Block a user