[monitor_fdpass.c]
     use ssize_t for recvmsg() and sendmsg() return
This commit is contained in:
Ben Lindstrom 2002-06-27 00:21:03 +00:00
parent d5502180cd
commit d5bf46e4c0
2 changed files with 12 additions and 8 deletions

View File

@ -3,6 +3,9 @@
- deraadt@cvs.openbsd.org 2002/06/26 14:49:36 - deraadt@cvs.openbsd.org 2002/06/26 14:49:36
[monitor.c] [monitor.c]
correct %u correct %u
- deraadt@cvs.openbsd.org 2002/06/26 14:50:04
[monitor_fdpass.c]
use ssize_t for recvmsg() and sendmsg() return
20020626 20020626
- (stevesk) [monitor.c] remove duplicate proto15 dispatch entry for PAM - (stevesk) [monitor.c] remove duplicate proto15 dispatch entry for PAM
@ -1175,4 +1178,4 @@
- (stevesk) entropy.c: typo in debug message - (stevesk) entropy.c: typo in debug message
- (djm) ssh-keygen -i needs seeded RNG; report from markus@ - (djm) ssh-keygen -i needs seeded RNG; report from markus@
$Id: ChangeLog,v 1.2303 2002/06/27 00:12:57 mouring Exp $ $Id: ChangeLog,v 1.2304 2002/06/27 00:21:03 mouring Exp $

View File

@ -24,7 +24,7 @@
*/ */
#include "includes.h" #include "includes.h"
RCSID("$OpenBSD: monitor_fdpass.c,v 1.3 2002/06/04 23:05:49 markus Exp $"); RCSID("$OpenBSD: monitor_fdpass.c,v 1.4 2002/06/26 14:50:04 deraadt Exp $");
#include <sys/uio.h> #include <sys/uio.h>
@ -38,7 +38,7 @@ mm_send_fd(int socket, int fd)
struct msghdr msg; struct msghdr msg;
struct iovec vec; struct iovec vec;
char ch = '\0'; char ch = '\0';
int n; ssize_t n;
#ifndef HAVE_ACCRIGHTS_IN_MSGHDR #ifndef HAVE_ACCRIGHTS_IN_MSGHDR
char tmp[CMSG_SPACE(sizeof(int))]; char tmp[CMSG_SPACE(sizeof(int))];
struct cmsghdr *cmsg; struct cmsghdr *cmsg;
@ -67,8 +67,8 @@ mm_send_fd(int socket, int fd)
fatal("%s: sendmsg(%d): %s", __func__, fd, fatal("%s: sendmsg(%d): %s", __func__, fd,
strerror(errno)); strerror(errno));
if (n != 1) if (n != 1)
fatal("%s: sendmsg: expected sent 1 got %d", fatal("%s: sendmsg: expected sent 1 got %ld",
__func__, n); __func__, (long)n);
#else #else
fatal("%s: UsePrivilegeSeparation=yes not supported", fatal("%s: UsePrivilegeSeparation=yes not supported",
__func__); __func__);
@ -81,8 +81,9 @@ mm_receive_fd(int socket)
#if defined(HAVE_RECVMSG) && (defined(HAVE_ACCRIGHTS_IN_MSGHDR) || defined(HAVE_CONTROL_IN_MSGHDR)) #if defined(HAVE_RECVMSG) && (defined(HAVE_ACCRIGHTS_IN_MSGHDR) || defined(HAVE_CONTROL_IN_MSGHDR))
struct msghdr msg; struct msghdr msg;
struct iovec vec; struct iovec vec;
ssize_t n;
char ch; char ch;
int fd, n; int fd;
#ifndef HAVE_ACCRIGHTS_IN_MSGHDR #ifndef HAVE_ACCRIGHTS_IN_MSGHDR
char tmp[CMSG_SPACE(sizeof(int))]; char tmp[CMSG_SPACE(sizeof(int))];
struct cmsghdr *cmsg; struct cmsghdr *cmsg;
@ -104,8 +105,8 @@ mm_receive_fd(int socket)
if ((n = recvmsg(socket, &msg, 0)) == -1) if ((n = recvmsg(socket, &msg, 0)) == -1)
fatal("%s: recvmsg: %s", __func__, strerror(errno)); fatal("%s: recvmsg: %s", __func__, strerror(errno));
if (n != 1) if (n != 1)
fatal("%s: recvmsg: expected received 1 got %d", fatal("%s: recvmsg: expected received 1 got %ld",
__func__, n); __func__, (long)n);
#ifdef HAVE_ACCRIGHTS_IN_MSGHDR #ifdef HAVE_ACCRIGHTS_IN_MSGHDR
if (msg.msg_accrightslen != sizeof(fd)) if (msg.msg_accrightslen != sizeof(fd))