The branch, master has been updated
       via  174f7a1 nwrap: Cast max_hostents to avoid warnings
       via  451a4d7 nwrap: Fix initialization of e entry
       via  6e74b6d tests: Silence compiler warnings about uninitialized 
variables
       via  48a952b tests: Fix getaddrinfo test on BSD
      from  0f089bd add me to AUTHORS

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


- Log -----------------------------------------------------------------
commit 174f7a1341a015eec18cd70c9e4a9b15d0dc9e99
Author: Andreas Schneider <a...@samba.org>
Date:   Mon Nov 16 10:19:27 2015 +0100

    nwrap: Cast max_hostents to avoid warnings
    
    Signed-off-by: Andreas Schneider <a...@samba.org>
    Reviewed-by: Michael Adam <ob...@samba.org>

commit 451a4d7c33778bb8200b9cbd1775eee1bda96527
Author: Andreas Schneider <a...@samba.org>
Date:   Mon Nov 16 10:17:39 2015 +0100

    nwrap: Fix initialization of e entry
    
    This fixes a compiler warning.
    
    Signed-off-by: Andreas Schneider <a...@samba.org>
    Reviewed-by: Michael Adam <ob...@samba.org>

commit 6e74b6d87f9273ffe3a30ea3414c4ee3765108c5
Author: Andreas Schneider <a...@samba.org>
Date:   Mon Nov 16 10:15:06 2015 +0100

    tests: Silence compiler warnings about uninitialized variables
    
    Signed-off-by: Andreas Schneider <a...@samba.org>
    Reviewed-by: Michael Adam <ob...@samba.org>

commit 48a952b09f1eee5604d9ec666b49a7bc062b4ab2
Author: Andreas Schneider <a...@samba.org>
Date:   Mon Nov 16 10:12:03 2015 +0100

    tests: Fix getaddrinfo test on BSD
    
    EAI_ADDRFAMILY is a GNU extension. EAI_FAMILY is the return value on
    BSD.
    
    Signed-off-by: Andreas Schneider <a...@samba.org>
    Reviewed-by: Michael Adam <ob...@samba.org>

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

Summary of changes:
 src/nss_wrapper.c        |  9 ++++++---
 tests/test_getaddrinfo.c | 12 ++++++++++--
 2 files changed, 16 insertions(+), 5 deletions(-)


Changeset truncated at 500 lines:

diff --git a/src/nss_wrapper.c b/src/nss_wrapper.c
index 9a7fbf5..a8cbc22 100644
--- a/src/nss_wrapper.c
+++ b/src/nss_wrapper.c
@@ -1566,14 +1566,15 @@ static void nwrap_init(void)
                                  "Error parsing NSS_WRAPPER_MAX_HOSTENTS "
                                  "value or value is too small. "
                                  "Using default value: %lu.",
-                                 max_hostents);
+                                 (unsigned long)max_hostents);
                } else {
                        max_hostents = max_hostents_tmp;
                }
        }
        /* Initialize hash table */
        NWRAP_LOG(NWRAP_LOG_DEBUG,
-                 "Initializing hash table of size %lu items.", max_hostents);
+                 "Initializing hash table of size %lu items.",
+                 (unsigned long)max_hostents);
        if (hcreate(max_hostents) == 0) {
                NWRAP_LOG(NWRAP_LOG_ERROR,
                          "Failed to initialize hash table");
@@ -3518,7 +3519,9 @@ static int nwrap_files_getaddrinfo(const char *name,
        size_t name_len;
        char canon_name[DNS_NAME_MAX] = { 0 };
        bool skip_canonname = false;
-       ENTRY e = { 0 };
+       ENTRY e = {
+               .key = NULL,
+       };
        ENTRY *e_p = NULL;
        int rc;
        bool ok;
diff --git a/tests/test_getaddrinfo.c b/tests/test_getaddrinfo.c
index 01ae3d8..ea3e995 100644
--- a/tests/test_getaddrinfo.c
+++ b/tests/test_getaddrinfo.c
@@ -442,8 +442,8 @@ static void test_nwrap_getaddrinfo_multiple_mixed(void 
**state)
        struct sockaddr_in *r_addr;
        struct sockaddr_in6 *r_addr6;
 
-       const char *result;
-       const char *value;
+       const char *result = NULL;
+       const char *value = NULL;
 
        /* For inet_ntop call */
        char buf[4096];
@@ -595,7 +595,11 @@ static void 
test_nwrap_getaddrinfo_flags_ai_numerichost(void **state)
        freeaddrinfo(res);
 
        rc = getaddrinfo("::1", NULL, &hints, &res);
+#ifdef EAI_ADDRFAMILY
        assert_int_equal(rc, EAI_ADDRFAMILY);
+#else
+       assert_int_equal(rc, EAI_FAMILY);
+#endif
 
        rc = getaddrinfo(NULL, "echo", &hints, &res);
        assert_int_equal(rc, 0);
@@ -616,7 +620,11 @@ static void 
test_nwrap_getaddrinfo_flags_ai_numerichost(void **state)
        hints.ai_family = AF_INET6;
 
        rc = getaddrinfo("127.0.0.11", NULL, &hints, &res);
+#ifdef EAI_ADDRFAMILY
        assert_int_equal(rc, EAI_ADDRFAMILY);
+#else
+       assert_int_equal(rc, EAI_FAMILY);
+#endif
 
        rc = getaddrinfo("::1", NULL, &hints, &res);
        assert_int_equal(rc, 0);


-- 
NSS Wrapper Repository

Reply via email to