mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Use absolute domain in detection of A/AAAA records
Python dns resolver append configured domain to queries which may lead to false positive answer. Exmaple: resolving "ipa.example.com" may return records for "ipa.example.com.example.com" if domain is configured as "example.com" https://fedorahosted.org/freeipa/ticket/5421 Reviewed-By: Petr Spacek <pspacek@redhat.com>
This commit is contained in:
@@ -4189,16 +4189,12 @@ class dns_resolve(Command):
|
||||
|
||||
takes_args = (
|
||||
Str('hostname',
|
||||
label=_('Hostname'),
|
||||
label=_('Hostname (FQDN)'),
|
||||
),
|
||||
)
|
||||
|
||||
def execute(self, *args, **options):
|
||||
query=args[0]
|
||||
if query.find(api.env.domain) == -1 and query.find('.') == -1:
|
||||
query = '%s.%s.' % (query, api.env.domain)
|
||||
if query[-1] != '.':
|
||||
query = query + '.'
|
||||
|
||||
if not is_host_resolvable(query):
|
||||
raise errors.NotFound(
|
||||
|
||||
Reference in New Issue
Block a user