summaryrefslogtreecommitdiff
path: root/src/responder
diff options
context:
space:
mode:
authorGeorge McCollister <George.McCollister@gmail.com>2010-03-15 13:54:53 -0500
committerStephen Gallagher <sgallagh@redhat.com>2010-03-15 16:12:52 -0400
commit12c6b6683f8a2036578e87c659afa79d3a1d68a9 (patch)
tree26c62ec0648150df99660611fbf51187da9f403e /src/responder
parentcf5f37509e0215de9fb0bd169d49c701a65de769 (diff)
downloadsssd-12c6b6683f8a2036578e87c659afa79d3a1d68a9.tar.gz
sssd-12c6b6683f8a2036578e87c659afa79d3a1d68a9.tar.bz2
sssd-12c6b6683f8a2036578e87c659afa79d3a1d68a9.zip
Fixed buffer alignment in exchange_credentials().
buf needs to be 32 bit aligned on ARM. Also made the fix on the server side. Signed-off-by: George McCollister <George.McCollister@gmail.com>
Diffstat (limited to 'src/responder')
-rw-r--r--src/responder/common/responder_common.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/responder/common/responder_common.c b/src/responder/common/responder_common.c
index f4de3a79..156f0c84 100644
--- a/src/responder/common/responder_common.c
+++ b/src/responder/common/responder_common.c
@@ -157,7 +157,11 @@ static void cred_handler(struct cli_ctx *cctx, char action)
struct iovec iov;
struct cmsghdr *cmsg;
struct ucred *creds;
- char buf[CMSG_SPACE(sizeof(struct ucred))];
+ /* buf must be aligned on some architectures. */
+ union ubuf {
+ int align;
+ char buf[CMSG_SPACE(sizeof(struct ucred))];
+ } u;
char dummy='s';
int enable=1;
@@ -178,8 +182,8 @@ static void cred_handler(struct cli_ctx *cctx, char action)
msg.msg_iov = &iov;
msg.msg_iovlen = 1;
- msg.msg_control = buf;
- msg.msg_controllen = sizeof(buf);
+ msg.msg_control = u.buf;
+ msg.msg_controllen = sizeof(u.buf);
switch (action) {
case 'r':