summaryrefslogtreecommitdiff
path: root/source4/scripting/bin
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2012-03-12 19:29:34 +0100
committerJelmer Vernooij <jelmer@samba.org>2012-03-13 13:07:03 +0100
commit441c214dda2ca93980461c03115b094a1e606d4a (patch)
tree3c72a416fe1bfebc612d0b16209dbf14265032d7 /source4/scripting/bin
parent8b42801609c82b5745a61a70149a41039973cfa1 (diff)
downloadsamba-441c214dda2ca93980461c03115b094a1e606d4a.tar.gz
samba-441c214dda2ca93980461c03115b094a1e606d4a.tar.bz2
samba-441c214dda2ca93980461c03115b094a1e606d4a.zip
samba_dnsupdate: Mention contents of invalid line when encountering parsing error.
Bug: https://bugzilla.samba.org/show_bug.cgi?id=8809
Diffstat (limited to 'source4/scripting/bin')
-rwxr-xr-xsource4/scripting/bin/samba_dnsupdate7
1 files changed, 5 insertions, 2 deletions
diff --git a/source4/scripting/bin/samba_dnsupdate b/source4/scripting/bin/samba_dnsupdate
index 076bc328b7..d21496ca21 100755
--- a/source4/scripting/bin/samba_dnsupdate
+++ b/source4/scripting/bin/samba_dnsupdate
@@ -125,6 +125,8 @@ class dnsobj(object):
def __init__(self, string_form):
list = string_form.split()
+ if len(list) < 3:
+ raise Exception("Invalid DNS entry %r" % string_form)
self.dest = None
self.port = None
self.ip = None
@@ -133,6 +135,8 @@ class dnsobj(object):
self.type = list[0]
self.name = list[1].lower()
if self.type == 'SRV':
+ if len(list) < 4:
+ raise Exception("Invalid DNS entry %r" % string_form)
self.dest = list[2].lower()
self.port = list[3]
elif self.type in ['A', 'AAAA']:
@@ -159,8 +163,7 @@ def parse_dns_line(line, sub_vars):
print "Skipping PDC entry (%s) as we are not a PDC" % line
return None
subline = samba.substitute_var(line, sub_vars)
- d = dnsobj(subline)
- return d
+ return dnsobj(subline)
def hostname_match(h1, h2):