[SCM] Samba Shared Repository - branch v3-2-test updated - release-3-2-0pre2-414-g36f8baf

Gerald Carter jerry at samba.org
Mon Mar 24 22:27:39 GMT 2008


The branch, v3-2-test has been updated
       via  36f8bafbd3dee66a869aa26cfc2eb4aa62019325 (commit)
       via  6e9287c5c3a6bbd15ec495593978c1a76e64ee60 (commit)
      from  f19d1e3d93d0d9dfe80372c6c5635f1047f9aa88 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test


- Log -----------------------------------------------------------------
commit 36f8bafbd3dee66a869aa26cfc2eb4aa62019325
Author: Gerald (Jerry) Carter <jerry at samba.org>
Date:   Mon Mar 24 14:48:29 2008 -0500

    Ignore port when pulling IP addr from struct sockaddr_storage.
    
    Linux man page states that getaddinfo() will leave the port
    uninitialized when passing in NULL for the service name.  So we
    can't really trust that anymore.  I doubt non-default KDC ports
    are an issues so just drop the port from the generated krb5.conf.
    AIX exhibits this bug the most.

commit 6e9287c5c3a6bbd15ec495593978c1a76e64ee60
Author: Gerald (Jerry) Carter <jerry at samba.org>
Date:   Mon Mar 24 14:27:01 2008 -0500

    Fix libtdb some to move back towards allowing out of tree builds
    
    Remaining problem is that not all *.syms linker scripts are generated
    so the LD command needs to look in a single place.  Out of tree
    builds now work but report write access to the source tree in order
    to create the $(srcdir)/expotrs/libtdb.sysms file.

-----------------------------------------------------------------------

Summary of changes:
 source/Makefile.in      |    2 +-
 source/configure.in     |    2 +-
 source/lib/util_sock.c  |   44 ++++++++++----------------------------------
 source/script/mksyms.sh |    2 +-
 4 files changed, 13 insertions(+), 37 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/Makefile.in b/source/Makefile.in
index 19bdad3..d9d0ea2 100644
--- a/source/Makefile.in
+++ b/source/Makefile.in
@@ -150,7 +150,7 @@ LIBTALLOC=$(LIBTALLOC_STATIC_TARGET) @LIBTALLOC_SHARED@
 LIBTDB_SHARED_TARGET=@LIBTDB_SHARED_TARGET@
 LIBTDB_STATIC_TARGET=@LIBTDB_STATIC_TARGET@
 LIBTDB=$(LIBTDB_STATIC_TARGET) @LIBTDB_SHARED@
-LIBTDB_SYMS=exports/libtdb.syms
+LIBTDB_SYMS=$(srcdir)/exports/libtdb.syms
 LIBTDB_HEADERS=@tdbdir@/include/tdb.h
 
 LIBSMBCLIENT=bin/libsmbclient.a @LIBSMBCLIENT_SHARED@
diff --git a/source/configure.in b/source/configure.in
index 8b227d0..bcfad68 100644
--- a/source/configure.in
+++ b/source/configure.in
@@ -33,7 +33,7 @@ AC_SUBST(TALLOC_OBJS)
 
 # TODO: These should come from m4_include(lib/tdb/libtdb.m4)
 # but currently this fails: things have to get merged from s4.
-tdbdir="lib/tdb"
+tdbdir="${srcdir-.}/lib/tdb"
 AC_SUBST(tdbdir)
 TDB_CFLAGS="-I$tdbdir/include"
 AC_SUBST(TDB_CFLAGS)
diff --git a/source/lib/util_sock.c b/source/lib/util_sock.c
index 6562513..8ceabe1 100644
--- a/source/lib/util_sock.c
+++ b/source/lib/util_sock.c
@@ -108,9 +108,13 @@ static bool interpret_string_addr_internal(struct addrinfo **ppres,
 	hints.ai_socktype = SOCK_STREAM;
 	hints.ai_flags = flags;
 
+	/* Linux man page on getaddinfo() says port will be
+	   uninitialized when service string in NULL */
+
 	ret = getaddrinfo(str, NULL,
 			&hints,
 			ppres);
+
 	if (ret) {
 		DEBUG(3,("interpret_string_addr_internal: getaddrinfo failed "
 			"for name %s [%s]\n",
@@ -541,50 +545,22 @@ char *print_canonical_sockaddr(TALLOC_CTX *ctx,
 	char *dest = NULL;
 	int ret;
 
+	/* Linux getnameinfo() man pages says port is unitialized if
+	   service name is NULL. */
+
 	ret = sys_getnameinfo((const struct sockaddr *)pss,
 			sizeof(struct sockaddr_storage),
 			addr, sizeof(addr),
 			NULL, 0,
 			NI_NUMERICHOST);
-	if (ret) {
+	if (ret != 0) {
 		return NULL;
 	}
-	if (pss->ss_family != AF_INET) {
 #if defined(HAVE_IPV6)
-		/* IPv6 */
-		const struct sockaddr_in6 *sa6 =
-			(const struct sockaddr_in6 *)pss;
-		uint16_t port = ntohs(sa6->sin6_port);
-
-		if (port) {
-			dest = talloc_asprintf(ctx,
-					"[%s]:%d",
-					addr,
-					(unsigned int)port);
-		} else {
-			dest = talloc_asprintf(ctx,
-					"[%s]",
-					addr);
-		}
+	dest = talloc_asprintf(ctx, "[%s]", addr);
 #else
-		return NULL;
+	dest = talloc_asprintf(ctx, "%s", addr);
 #endif
-	} else {
-		const struct sockaddr_in *sa =
-			(const struct sockaddr_in *)pss;
-		uint16_t port = ntohs(sa->sin_port);
-
-		if (port) {
-			dest = talloc_asprintf(ctx,
-					"%s:%d",
-					addr,
-					(unsigned int)port);
-		} else {
-			dest = talloc_asprintf(ctx,
-					"%s",
-					addr);
-		}
-	}
 	return dest;
 }
 
diff --git a/source/script/mksyms.sh b/source/script/mksyms.sh
index 637ec50..51d3fbd 100755
--- a/source/script/mksyms.sh
+++ b/source/script/mksyms.sh
@@ -34,7 +34,7 @@ echo creating $symsfile
 
 mkdir -p `dirname $symsfile`
 
-${awk} -f script/mksyms.awk $proto_src > $symsfile_tmp
+${awk} -f `dirname $0`/mksyms.awk $proto_src > $symsfile_tmp
 
 if cmp -s $symsfile $symsfile_tmp 2>/dev/null
 then


-- 
Samba Shared Repository


More information about the samba-cvs mailing list