[PATCH v3] samba-tool dns: Don't use localhost to connect to local host

Michael Adam obnox at samba.org
Fri Nov 16 03:01:21 MST 2012


Hi,

I would extend the commit message with an explanation.
Proposal attached. This one I would push (or have pushed).

Cheers - Michael

On 2012-11-15 at 12:21 +0100, Kai Blin wrote:
> Taking in Rowland Penny's hints, here's another attempt at solving the
> silly stack trace samba-tool dns returns when people specify 'localhost'
> 
> 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).
> 
> Cheers,
> Kai
> 
> -- 
> Kai Blin
> Worldforge developer http://www.worldforge.org/
> Wine developer http://wiki.winehq.org/KaiBlin
> Samba team member http://www.samba.org/samba/team/

> >From 8776feeea38777e12a1ce6ec574757dc99e92db4 Mon Sep 17 00:00:00 2001
> From: Kai Blin <kai at samba.org>
> Date: Wed, 14 Nov 2012 11:32:06 +0100
> Subject: [PATCH] samba-tool dns: Don't use localhost to connect to local host
> 
> Signed-off-by: Kai Blin <kai at samba.org>
> ---
>  source4/scripting/python/samba/netcmd/dns.py |    2 ++
>  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 8bd3249..c00d17a 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
> -- 
> 1.7.0.4
> 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-samba-tool-dns-Don-t-use-localhost-to-connect-to-loc.patch
Type: text/x-patch
Size: 1198 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20121116/600e06dc/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 206 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20121116/600e06dc/attachment.pgp>


More information about the samba-technical mailing list