Commit 08b44fb0 authored by Mark Andrews's avatar Mark Andrews
Browse files

more shell quoting required

parent 25e72ee3
...@@ -146,7 +146,8 @@ class DLVRR: ...@@ -146,7 +146,8 @@ class DLVRR:
############################################################################ ############################################################################
def checkds(zone, masterfile = None): def checkds(zone, masterfile = None):
dslist=[] dslist=[]
fp=os.popen("%s +noall +answer -t ds -q %s" % (args.dig, shellquote(zone))) fp=os.popen("%s +noall +answer -t ds -q %s" %
(shellquote(args.dig), shellquote(zone)))
for line in fp: for line in fp:
dslist.append(DSRR(line)) dslist.append(DSRR(line))
dslist = sorted(dslist, key=lambda ds: (ds.keyid, ds.keyalg, ds.hashalg)) dslist = sorted(dslist, key=lambda ds: (ds.keyid, ds.keyalg, ds.hashalg))
...@@ -156,11 +157,12 @@ def checkds(zone, masterfile = None): ...@@ -156,11 +157,12 @@ def checkds(zone, masterfile = None):
if masterfile: if masterfile:
fp = os.popen("%s -f %s %s " % fp = os.popen("%s -f %s %s " %
(args.dsfromkey, masterfile, zone)) (shellquote(args.dsfromkey), shellquote(masterfile),
shellquote(zone)))
else: else:
fp = os.popen("%s +noall +answer -t dnskey -q %s | %s -f - %s" % fp = os.popen("%s +noall +answer -t dnskey -q %s | %s -f - %s" %
(args.dig, shellquote(zone), args.dsfromkey, (shellquote(args.dig), shellquote(zone),
shellquote(zone))) shellquote(args.dsfromkey), shellquote(zone)))
for line in fp: for line in fp:
dsklist.append(DSRR(line)) dsklist.append(DSRR(line))
...@@ -190,7 +192,7 @@ def checkds(zone, masterfile = None): ...@@ -190,7 +192,7 @@ def checkds(zone, masterfile = None):
def checkdlv(zone, lookaside, masterfile = None): def checkdlv(zone, lookaside, masterfile = None):
dlvlist=[] dlvlist=[]
fp=os.popen("%s +noall +answer -t dlv -q %s" % fp=os.popen("%s +noall +answer -t dlv -q %s" %
(args.dig, shellquote(zone + '.' + lookaside))) (shellquote(args.dig), shellquote(zone + '.' + lookaside)))
for line in fp: for line in fp:
dlvlist.append(DLVRR(line, lookaside)) dlvlist.append(DLVRR(line, lookaside))
dlvlist = sorted(dlvlist, dlvlist = sorted(dlvlist,
...@@ -206,8 +208,9 @@ def checkdlv(zone, lookaside, masterfile = None): ...@@ -206,8 +208,9 @@ def checkdlv(zone, lookaside, masterfile = None):
(args.dsfromkey, masterfile, lookaside, zone)) (args.dsfromkey, masterfile, lookaside, zone))
else: else:
fp = os.popen("%s +noall +answer -t dnskey %s | %s -f - -l %s %s" fp = os.popen("%s +noall +answer -t dnskey %s | %s -f - -l %s %s"
% (args.dig, shellquote(zone), args.dsfromkey, % (shellquote(args.dig), shellquote(zone),
shellquote(lookaside), shellquote(zone))) shellquote(args.dsfromkey), shellquote(lookaside),
shellquote(zone)))
for line in fp: for line in fp:
dlvklist.append(DLVRR(line, lookaside)) dlvklist.append(DLVRR(line, lookaside))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment