summaryrefslogtreecommitdiff
path: root/kerberosV
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2008-03-24 16:11:09 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2008-03-24 16:11:09 +0000
commit0bdf18c9edb2e6a9fa89a28e89d11e7b6785b1fd (patch)
treebd0dc86a525e38150bde9f0c3d55ad9dfeb4e6a2 /kerberosV
parent6e48c70f167662c7aec42af9bafc316e322ef92a (diff)
msg_controllen has to be CMSG_SPACE so that the kernel can account for
each cmsg_len (ie. msg_controllen = sum of CMSG_ALIGN(cmsg_len). This works now that kernel fd passing has been fixed to accept a bit of sloppiness because of this ABI repair. lots of discussion with kettenis
Diffstat (limited to 'kerberosV')
-rw-r--r--kerberosV/src/kcm/connect.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/kerberosV/src/kcm/connect.c b/kerberosV/src/kcm/connect.c
index 559453c224a..739e2b13871 100644
--- a/kerberosV/src/kcm/connect.c
+++ b/kerberosV/src/kcm/connect.c
@@ -143,25 +143,24 @@ update_client_creds(int s, kcm_client *peer)
/* NetBSD */
if (peer->uid == -1) {
struct msghdr msg;
- socklen_t crmsgspace, crmsglen;
+ socklen_t crmsgsize;
void *crmsg;
struct cmsghdr *cmp;
struct sockcred *sc;
memset(&msg, 0, sizeof(msg));
- crmsgspace = CMSG_SPACE(SOCKCREDSIZE(NGROUPS));
- crmsglen = CMSG_LEN(SOCKCREDSIZE(NGROUPS));
+ crmsgsize = CMSG_SPACE(SOCKCREDSIZE(NGROUPS));
if (crmsgsize == 0)
return 1 ;
- crmsg = malloc(crmsgspace);
+ crmsg = malloc(crmsgsize);
if (crmsg == NULL)
goto failed_scm_creds;
- memset(crmsg, 0, crmsgspace);
+ memset(crmsg, 0, crmsgsize);
msg.msg_control = crmsg;
- msg.msg_controllen = crmsglen;
+ msg.msg_controllen = crmsgsize;
if (recvmsg(s, &msg, 0) < 0) {
free(crmsg);