summaryrefslogtreecommitdiff
path: root/lib/libc/gen/auth_subr.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2004-08-30 18:14:34 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2004-08-30 18:14:34 +0000
commita50ea864e13261b030a966155cd54a19bc844789 (patch)
tree6f3f46e36625f1a8c07154710f084579566c7196 /lib/libc/gen/auth_subr.c
parentccc4a76c57abbfcf253bf6be25ea72c42fd0186d (diff)
Use CMSG_SPACE when allocating space for the control message.
Fixes fd passing problems on sparc and sparc64. OK henning@
Diffstat (limited to 'lib/libc/gen/auth_subr.c')
-rw-r--r--lib/libc/gen/auth_subr.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libc/gen/auth_subr.c b/lib/libc/gen/auth_subr.c
index b3a568beb23..75a547195cc 100644
--- a/lib/libc/gen/auth_subr.c
+++ b/lib/libc/gen/auth_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: auth_subr.c,v 1.28 2004/08/09 01:39:31 millert Exp $ */
+/* $OpenBSD: auth_subr.c,v 1.29 2004/08/30 18:14:33 millert Exp $ */
/*
* Copyright (c) 2000-2002,2004 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -976,7 +976,7 @@ _recv_fd(auth_session_t *as, int fd)
{
struct msghdr msg;
struct cmsghdr *cmp;
- char cmsgbuf[CMSG_LEN(sizeof(int))];
+ char cmsgbuf[CMSG_SPACE(sizeof(int))];
memset(&msg, 0, sizeof(msg));
msg.msg_control = cmsgbuf;
@@ -996,7 +996,7 @@ _recv_fd(auth_session_t *as, int fd)
else if (cmp->cmsg_type != SCM_RIGHTS)
syslog(LOG_ERR, "unexpected cmsg_type %d",
cmp->cmsg_type);
- else if (cmp->cmsg_len != sizeof(cmsgbuf))
+ else if (cmp->cmsg_len != CMSG_LEN(sizeof(int)))
syslog(LOG_ERR, "bad cmsg_len %d",
cmp->cmsg_len);
else {