Browse Source

Make a stricter comparison for matching against zone names

This adds a dot in front of the fqdn and the zone name, so the
comparison will only check against full DNS parts of the fqdn and the
zone name. This will prevent to match a fqdn against an unrelated zone
name which overlaps with the wanted zone in the naming.

Fixes #398
pull/399/head
Emily Karisch 7 years ago
parent
commit
d62800b454
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      dns_scripts/dns_route53.py

+ 2
- 2
dns_scripts/dns_route53.py View File

@ -32,7 +32,7 @@ for zone in response['HostedZones']:
zone_list[zone['Name']] = zone['Id']
for key in sorted(zone_list.iterkeys(), key=len, reverse=True):
if key in "{z}.".format(z=fqdn):
if ".{z}".format(z=key) in ".{z}.".format(z=fqdn):
zone_id = zone_list[key]
if zone_id == "":
@ -84,4 +84,4 @@ if action == 'UPSERT':
print("Didn't find {f} entry yet, sleeping... ({w}s)".format(f=challenge_fqdn,
w=waiting))
time.sleep(10)
pass
pass

Loading…
Cancel
Save