lib: Update nss_wrapper to version 1.1.3
authorAndreas Schneider <asn@samba.org>
Fri, 18 Mar 2016 11:03:28 +0000 (12:03 +0100)
committerJeremy Allison <jra@samba.org>
Mon, 21 Mar 2016 23:23:20 +0000 (00:23 +0100)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
lib/nss_wrapper/nss_wrapper.c
lib/nss_wrapper/wscript

index c4f1b33e4965250d8d83786a17929f2403d15dd2..82581b17aaf73d868e5d5f62814f9178255fb545 100644 (file)
@@ -154,6 +154,14 @@ typedef nss_status_t NSS_STATUS;
 #define SAFE_FREE(x) do { if ((x) != NULL) {free(x); (x)=NULL;} } while(0)
 #endif
 
+#ifndef discard_const
+#define discard_const(ptr) ((void *)((uintptr_t)(ptr)))
+#endif
+
+#ifndef discard_const_p
+#define discard_const_p(type, ptr) ((type *)discard_const(ptr))
+#endif
+
 #ifdef HAVE_IPV6
 #define NWRAP_INET_ADDRSTRLEN INET6_ADDRSTRLEN
 #else
@@ -1963,6 +1971,28 @@ static bool nwrap_pw_parse_line(struct nwrap_cache *nwrap, char *line)
 
        NWRAP_LOG(NWRAP_LOG_TRACE, "gid[%u]\n", pw->pw_gid);
 
+#ifdef HAVE_STRUCT_PASSWD_PW_CLASS
+       pw->pw_class = discard_const_p(char, "");
+
+       NWRAP_LOG(NWRAP_LOG_TRACE, "class[%s]", pw->pw_class);
+#endif /* HAVE_STRUCT_PASSWD_PW_CLASS */
+
+#ifdef HAVE_STRUCT_PASSWD_PW_CHANGE
+       pw->pw_change = 0;
+
+       NWRAP_LOG(NWRAP_LOG_TRACE,
+                 "change[%lu]",
+                 (unsigned long)pw->pw_change);
+#endif /* HAVE_STRUCT_PASSWD_PW_CHANGE */
+
+#ifdef HAVE_STRUCT_PASSWD_PW_EXPIRE
+       pw->pw_expire = 0;
+
+       NWRAP_LOG(NWRAP_LOG_TRACE,
+                 "expire[%lu]",
+                 (unsigned long)pw->pw_expire);
+#endif /* HAVE_STRUCT_PASSWD_PW_EXPIRE */
+
        /* gecos */
        p = strchr(c, ':');
        if (!p) {
@@ -5421,7 +5451,7 @@ static int nwrap_getnameinfo(const struct sockaddr *sa, socklen_t salen,
                if (he != NULL && he->h_name != NULL) {
                        if (strlen(he->h_name) >= hostlen)
                                return EAI_OVERFLOW;
-                       strcpy(host, he->h_name);
+                       snprintf(host, hostlen, "%s", he->h_name);
                        if (flags & NI_NOFQDN)
                                host[strcspn(host, ".")] = '\0';
                } else {
@@ -5439,7 +5469,7 @@ static int nwrap_getnameinfo(const struct sockaddr *sa, socklen_t salen,
                if (service != NULL) {
                        if (strlen(service->s_name) >= servlen)
                                return EAI_OVERFLOW;
-                       strcpy(serv, service->s_name);
+                       snprintf(serv, servlen, "%s", service->s_name);
                } else {
                        if (snprintf(serv, servlen, "%u", port) >= (int) servlen)
                                return EAI_OVERFLOW;
index 6c3d7f7940ca62939dc847f5379739e32554d73f..32bdbbd64473af60f3f64cd47acd2036ee750a2b 100644 (file)
@@ -2,7 +2,7 @@
 
 import os
 
-VERSION="1.1.2"
+VERSION="1.1.3"
 
 def configure(conf):
     if conf.CHECK_BUNDLED_SYSTEM('nss_wrapper', minversion=VERSION, set_target=False):