mirror of
https://github.com/jlu5/SupyPlugins.git
synced 2025-04-26 13:01:07 -05:00
SysDNS: don't allow spaces in lookup
This commit is contained in:
parent
13d9c78ee2
commit
725680d2bd
@ -48,7 +48,7 @@ class SysDNS(callbacks.Plugin):
|
|||||||
utility available on the host machine.
|
utility available on the host machine.
|
||||||
"""
|
"""
|
||||||
threaded = True
|
threaded = True
|
||||||
def dns(self, irc, msg, args, optlist, text):
|
def dns(self, irc, msg, args, optlist, server):
|
||||||
"""[--type type] <host>
|
"""[--type type] <host>
|
||||||
Looks up a DNS hostname using the 'host' binary available on the system. --type
|
Looks up a DNS hostname using the 'host' binary available on the system. --type
|
||||||
controls the type of record to look for. (A, AAAA, etc.)
|
controls the type of record to look for. (A, AAAA, etc.)
|
||||||
@ -59,9 +59,9 @@ class SysDNS(callbacks.Plugin):
|
|||||||
'supybot.plugins.SysDNS.command appropriately.', Raise=True)
|
'supybot.plugins.SysDNS.command appropriately.', Raise=True)
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
args = [cmd, '-t', dict(optlist)['type'], text]
|
args = [cmd, '-t', dict(optlist)['type'], server]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
args = [cmd, text]
|
args = [cmd, server]
|
||||||
try:
|
try:
|
||||||
with open(os.devnull) as null:
|
with open(os.devnull) as null:
|
||||||
inst = subprocess.Popen(args,
|
inst = subprocess.Popen(args,
|
||||||
@ -78,7 +78,7 @@ class SysDNS(callbacks.Plugin):
|
|||||||
response = result[0].decode('utf8').splitlines()
|
response = result[0].decode('utf8').splitlines()
|
||||||
response = [l for l in response if l]
|
response = [l for l in response if l]
|
||||||
irc.replies(response)
|
irc.replies(response)
|
||||||
dns = thread(wrap(dns, [getopts({'type':'something'}), 'text']))
|
dns = thread(wrap(dns, [getopts({'type':'something'}), 'somethingWithoutSpaces']))
|
||||||
|
|
||||||
|
|
||||||
Class = SysDNS
|
Class = SysDNS
|
||||||
|
Loading…
x
Reference in New Issue
Block a user