[SCM] NSS Wrapper Repository - branch master updated

Andreas Schneider asn at samba.org
Wed Sep 10 05:06:26 MDT 2014


The branch, master has been updated
       via  12f707b nwrap: Make sure addr is initialized.
       via  055e7b7 nwrap: Use DNS_NAME_MAX cause it is not available on BSD.
      from  0e50956 nwrap: Don't overflow the in_addr if convert IPv6.

http://gitweb.samba.org/?p=nss_wrapper.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 12f707b5e44d14421db43db6c6197cf9c1498ac8
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Sep 10 08:30:22 2014 +0200

    nwrap: Make sure addr is initialized.
    
    CID #72755
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>

commit 055e7b7b1296dd0e2c0fa98261377069d11b76ec
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Sep 10 08:26:34 2014 +0200

    nwrap: Use DNS_NAME_MAX cause it is not available on BSD.
    
    Also HOST_NAME_MAX is only for the value returned by gethostname(). It
    is normally limited to 64 chars on Linux.
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>

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

Summary of changes:
 src/nss_wrapper.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/src/nss_wrapper.c b/src/nss_wrapper.c
index 931aaa5..a41de9e 100644
--- a/src/nss_wrapper.c
+++ b/src/nss_wrapper.c
@@ -49,7 +49,6 @@
 #include <string.h>
 #include <unistd.h>
 #include <ctype.h>
-#include <limits.h>
 
 /*
  * Defining _POSIX_PTHREAD_SEMANTICS before including pwd.h and grp.h  gives us
@@ -122,6 +121,10 @@ typedef nss_status_t NSS_STATUS;
 #define __location__ __FILE__ ":" __LINESTR__
 #endif
 
+#ifndef DNS_NAME_MAX
+#define DNS_NAME_MAX 255
+#endif
+
 /* GCC have printf type attribute check. */
 #ifdef HAVE_ATTRIBUTE_PRINTF_FORMAT
 #define PRINTF_ATTRIBUTE(a,b) __attribute__ ((__format__ (__printf__, a, b)))
@@ -2352,7 +2355,7 @@ static void nwrap_files_endgrent(struct nwrap_backend *b)
 static struct hostent *nwrap_files_gethostbyname(const char *name, int af)
 {
 	struct hostent *he;
-	char canon_name[HOST_NAME_MAX] = { 0 };
+	char canon_name[DNS_NAME_MAX] = { 0 };
 	size_t name_len;
 	int i;
 
@@ -3862,7 +3865,9 @@ static int nwrap_getaddrinfo(const char *node,
 			struct in6_addr v6;
 		} in;
 #endif
-	} addr;
+	} addr = {
+		.family = AF_UNSPEC,
+	};
 	int eai = EAI_SYSTEM;
 	int ret;
 	int rc;


-- 
NSS Wrapper Repository


More information about the samba-cvs mailing list