nwrap: fix nwrap_module_getpwuid_r
authorRalph Wuerthner <ralph.wuerthner@de.ibm.com>
Fri, 19 Oct 2018 10:15:53 +0000 (12:15 +0200)
committerAndreas Schneider <asn@samba.org>
Tue, 30 Oct 2018 19:48:53 +0000 (20:48 +0100)
On success *pwdstp must point to pwdst, on error return NULL instead.

Signed-off-by: Ralph Wuerthner <ralph.wuerthner@de.ibm.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
src/nss_wrapper.c

index a0f25db3962bfc24327e718b9f88e9204372407a..3866d056c3a714a709631e36f2f50f7b28713aad 100644 (file)
@@ -3902,7 +3902,7 @@ static int nwrap_module_getpwuid_r(struct nwrap_backend *b,
 {
        int ret;
 
-       (void) pwdstp; /* unused */
+       *pwdstp = NULL;
 
        if (!b->fns->_nss_getpwuid_r) {
                return ENOENT;
@@ -3911,6 +3911,7 @@ static int nwrap_module_getpwuid_r(struct nwrap_backend *b,
        ret = b->fns->_nss_getpwuid_r(uid, pwdst, buf, buflen, &errno);
        switch (ret) {
        case NSS_STATUS_SUCCESS:
+               *pwdstp = pwdst;
                return 0;
        case NSS_STATUS_NOTFOUND:
                if (errno != 0) {