Possible bug in 3.2.7

Jeremy Allison jra at samba.org
Thu Jan 15 18:29:26 GMT 2009


On Thu, Jan 15, 2009 at 10:04:02AM -0800, Jeremy Allison wrote:
> On Thu, Jan 15, 2009 at 02:16:34PM +0100, Remy Zandwijk wrote:
> > Developers,
> >
> > I believe there is a bug in Samba 3.2.7. Please refer to:
> >
> > 	http://marc.info/?l=samba&m=123188218612431&w=2
> > 	"Calling Samba print server with an aliased DNS-name fails"

And here is the patch. Committing to all post 3.2.x branches.

Thanks !

Jeremy.
-------------- next part --------------
diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c
index e913b35..b46ff2c 100644
--- a/source3/lib/util_sock.c
+++ b/source3/lib/util_sock.c
@@ -1940,11 +1940,12 @@ bool is_myname_or_ipaddr(const char *s)
 	if (!is_ipaddress(servername)) {
 		/* Use DNS to resolve the name, but only the first address */
 		struct sockaddr_storage ss;
-		if (interpret_string_addr(&ss, servername,0)) {
-			print_sockaddr(name,
-					sizeof(name),
+		if (interpret_string_addr(&ss, servername, 0)) {
+			char addr[INET6_ADDRSTRLEN];
+			print_sockaddr(addr,
+					sizeof(addr),
 					&ss);
-			servername = name;
+			servername = addr;
 		}
 	}
 


More information about the samba-technical mailing list