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/responder/nss | |
parent | 7d83d46ff9eb06b294c186a41ad9e7dbe648f5c3 (diff) | |
download | sssd-8ad7891f28c0ffd991c51f2d64c32cf04c9ddbbc.tar.gz sssd-8ad7891f28c0ffd991c51f2d64c32cf04c9ddbbc.tar.bz2 sssd-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/responder/nss')
-rw-r--r-- | src/responder/nss/nsssrv_cmd.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/responder/nss/nsssrv_cmd.c b/src/responder/nss/nsssrv_cmd.c index c43a544e..042517ad 100644 --- a/src/responder/nss/nsssrv_cmd.c +++ b/src/responder/nss/nsssrv_cmd.c @@ -205,9 +205,8 @@ static int fill_pwent(struct sss_packet *packet, } sss_packet_get_body(packet, &body, &blen); - ((uint32_t *)(&body[rp]))[0] = uid; - ((uint32_t *)(&body[rp]))[1] = gid; - rp += 2*sizeof(uint32_t); + SAFEALIGN_SET_UINT32(&body[rp], uid, &rp); + SAFEALIGN_SET_UINT32(&body[rp], gid, &rp); if (add_domain) { ret = snprintf((char *)&body[rp], s1, namefmt, name, domain); @@ -1566,10 +1565,10 @@ static int fill_grent(struct sss_packet *packet, sss_packet_get_body(packet, &body, &blen); /* 0-3: 32bit number gid */ - ((uint32_t *)(&body[rzero+GID_ROFFSET]))[0] = gid; + SAFEALIGN_SET_UINT32(&body[rzero+GID_ROFFSET], gid, NULL); /* 4-7: 32bit unsigned number of members */ - ((uint32_t *)(&body[rzero+MNUM_ROFFSET]))[0] = 0; + SAFEALIGN_SET_UINT32(&body[rzero+MNUM_ROFFSET], 0, NULL); /* 8-X: sequence of strings (name, passwd, mem..) */ if (add_domain) { @@ -1688,7 +1687,7 @@ static int fill_grent(struct sss_packet *packet, if (memnum) { /* set num of members */ - ((uint32_t *)(&body[rzero+MNUM_ROFFSET]))[0] = memnum; + SAFEALIGN_SET_UINT32(&body[rzero+MNUM_ROFFSET], memnum, NULL); } } |