diff options
author | George McCollister <georgem@novatech-llc.com> | 2010-03-04 09:41:33 -0600 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2010-03-08 13:42:46 -0500 |
commit | 8ad7891f28c0ffd991c51f2d64c32cf04c9ddbbc (patch) | |
tree | 6e6e8d8a8ad4e6e4b185b1aeeff2fdce0d943b90 /src/sss_client/passwd.c | |
parent | 7d83d46ff9eb06b294c186a41ad9e7dbe648f5c3 (diff) | |
download | sssd_unused-8ad7891f28c0ffd991c51f2d64c32cf04c9ddbbc.tar.gz sssd_unused-8ad7891f28c0ffd991c51f2d64c32cf04c9ddbbc.tar.xz sssd_unused-8ad7891f28c0ffd991c51f2d64c32cf04c9ddbbc.zip |
Fixed alignment problems in nss client/server
I fixed a handful of alignment problems in sss_client and nss responder.
Enumerating group and passwd with getgrent and getpwent now works correctly
on ARM.
Signed-off-by: George McCollister <georgem@novatech-llc.com>
Diffstat (limited to 'src/sss_client/passwd.c')
-rw-r--r-- | src/sss_client/passwd.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/sss_client/passwd.c b/src/sss_client/passwd.c index 0d70b684..aa5c7602 100644 --- a/src/sss_client/passwd.c +++ b/src/sss_client/passwd.c @@ -74,13 +74,16 @@ static int sss_nss_getpw_readrep(struct sss_nss_pw_rep *pr, { size_t i, slen, dlen; char *sbuf; + uint32_t c; if (*len < 13) { /* not enough space for data, bad packet */ return EBADMSG; } - pr->result->pw_uid = ((uint32_t *)buf)[0]; - pr->result->pw_gid = ((uint32_t *)buf)[1]; + SAFEALIGN_COPY_UINT32(&c, buf, NULL); + pr->result->pw_uid = c; + SAFEALIGN_COPY_UINT32(&c, buf+sizeof(uint32_t), NULL); + pr->result->pw_gid = c; sbuf = (char *)&buf[8]; slen = *len - 8; |