Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 296678 Details for
Bug 433515
Server setup script should validate hostname and A / PTR dns records
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
require DNS A record, match A record to PTR
freeipa-701-dns.patch (text/plain), 2.12 KB, created by
Rob Crittenden
on 2008-03-03 21:11:20 UTC
(
hide
)
Description:
require DNS A record, match A record to PTR
Filename:
MIME Type:
Creator:
Rob Crittenden
Created:
2008-03-03 21:11:20 UTC
Size:
2.12 KB
patch
obsolete
># HG changeset patch ># User Rob Crittenden <rcritten@redhat.com> ># Date 1204578606 18000 ># Node ID de81fc4f3986fb70ec1ff6e3e323a56aca2af64b ># Parent 16c36d36ca66f6672447b55241dbcbac573a303a >Require that the hostname is a DNS A record and that the forward and reverse >match. > >433515 > >diff -r 16c36d36ca66 -r de81fc4f3986 ipa-python/dnsclient.py >--- a/ipa-python/dnsclient.py Mon Mar 03 14:13:26 2008 -0500 >+++ b/ipa-python/dnsclient.py Mon Mar 03 16:10:06 2008 -0500 >@@ -327,6 +327,7 @@ def dnsParsePTR(data, base): > (rest, rdata.ptrdname) = dnsParseLabel(data, base) > if DEBUG_DNSCLIENT: > print "PTR = \"%s\"." % rdata.ptrdname >+ return rdata > > def dnsParseSRV(data, base): > rdata = DNSRData() >diff -r 16c36d36ca66 -r de81fc4f3986 ipa-server/ipaserver/installutils.py >--- a/ipa-server/ipaserver/installutils.py Mon Mar 03 14:13:26 2008 -0500 >+++ b/ipa-server/ipaserver/installutils.py Mon Mar 03 16:10:06 2008 -0500 >@@ -26,8 +26,10 @@ import fileinput > import fileinput > import sys > import time >+import struct > > from ipa import ipautil >+from ipa import dnsclient > > def get_fqdn(): > fqdn = "" >@@ -43,6 +45,25 @@ def verify_fqdn(host_name): > def verify_fqdn(host_name): > if len(host_name.split(".")) < 2 or host_name == "localhost.localdomain": > raise RuntimeError("Invalid hostname: " + host_name) >+ >+ # Verify that it is a DNS A record >+ rs = dnsclient.query(host_name+".", dnsclient.DNS_C_IN, dnsclient.DNS_T_A) >+ if len(rs) == 0: >+ raise RuntimeError("hostname %s is not found or is not a DNS A record" % host_name) >+ >+ # Compare the forward and reverse >+ forward = rs[0].dns_name >+ >+ addr = socket.inet_ntoa(struct.pack('L',rs[0].rdata.address)) >+ addr = addr + ".in-addr.arpa." >+ >+ rs = dnsclient.query(addr, dnsclient.DNS_C_IN, dnsclient.DNS_T_PTR) >+ if len(rs) == 0: >+ raise RuntimeError("Cannot find PTR record for %s" % addr) >+ reverse = rs[0].rdata.ptrdname >+ >+ if forward != reverse: >+ raise RuntimeError("The DNS forward record %s does not match the reverse lookup %s" % (forward, reverse)) > > def port_available(port): > """Try to bind to a port on the wildcard host
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 433515
: 296678 |
297085