summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorKai Blin <kai@samba.org>2012-11-14 11:32:06 +0100
committerMichael Adam <obnox@samba.org>2012-11-16 13:18:14 +0100
commit10b6cceb1f0f09c7a8f5fc8882fdc3852d11951f (patch)
tree85dfee9e0869e45acf25eda049150c6f7bed7cab /source4
parentd5de797af2aeb3697022e33ea51c516621b25e2f (diff)
downloadsamba-10b6cceb1f0f09c7a8f5fc8882fdc3852d11951f.tar.gz
samba-10b6cceb1f0f09c7a8f5fc8882fdc3852d11951f.tar.bz2
samba-10b6cceb1f0f09c7a8f5fc8882fdc3852d11951f.zip
samba-tool dns: Don't use "localhost" to connect to local host
Calling "samba-tool dns <cmd> localhost" provokes a stacktrace. This just makes 'samba-tool dns <cmd> localhost' work and doesn't fix the underlying issue, but I don't see it causing any harm (unless you don't have an ipv4 localhost, I guess). Signed-off-by: Kai Blin <kai@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Fri Nov 16 13:18:14 CET 2012 on sn-devel-104
Diffstat (limited to 'source4')
-rw-r--r--source4/scripting/python/samba/netcmd/dns.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/source4/scripting/python/samba/netcmd/dns.py b/source4/scripting/python/samba/netcmd/dns.py
index 8bd3249ae2..c00d17ad72 100644
--- a/source4/scripting/python/samba/netcmd/dns.py
+++ b/source4/scripting/python/samba/netcmd/dns.py
@@ -31,6 +31,8 @@ from samba.dcerpc import dnsp, dnsserver
def dns_connect(server, lp, creds):
+ if server.lower() == 'localhost':
+ server = '127.0.0.1'
binding_str = "ncacn_ip_tcp:%s[sign]" % server
dns_conn = dnsserver.dnsserver(binding_str, lp, creds)
return dns_conn