nwrap: Remove unneeded memcpy in getgrouplist()
authorAndreas Schneider <asn@samba.org>
Mon, 14 Sep 2015 12:57:40 +0000 (14:57 +0200)
committerMichael Adam <obnox@samba.org>
Mon, 11 Jan 2016 11:25:27 +0000 (12:25 +0100)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
lib/nss_wrapper/nss_wrapper.c

index 252735693886fd8a121a9e615de3b9f9cc4db9f9..3e8545cc4f68b5fab9db3ef51784149383e240d0 100644 (file)
@@ -3561,8 +3561,7 @@ static int nwrap_getgrouplist(const char *user, gid_t group,
                errno = ENOMEM;
                return -1;
        }
-
-       memcpy(groups_tmp, &group, sizeof(gid_t));
+       groups_tmp[0] = group;
 
        nwrap_setgrent();
        while ((grp = nwrap_getgrent()) != NULL) {
@@ -3589,8 +3588,8 @@ static int nwrap_getgrouplist(const char *user, gid_t group,
                                        errno = ENOMEM;
                                        return -1;
                                }
+                               groups_tmp[count] = grp->gr_gid;
 
-                               memcpy(&groups_tmp[count], &grp->gr_gid, sizeof(gid_t));
                                count++;
                        }
                }