[dovecot-cvs] dovecot/src/lib fdpass.c,1.23,1.24

cras at procontrol.fi cras at procontrol.fi
Wed May 7 16:05:04 EEST 2003


Update of /home/cvs/dovecot/src/lib
In directory danu:/tmp/cvs-serv5565

Modified Files:
	fdpass.c 
Log Message:
Compile even if SCM_RIGHTS isn't supported.



Index: fdpass.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib/fdpass.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- fdpass.c	7 May 2003 08:16:17 -0000	1.23
+++ fdpass.c	7 May 2003 12:05:01 -0000	1.24
@@ -57,6 +57,8 @@
 	(CMSG_ALIGN(sizeof(struct cmsghdr)) + (len))
 #endif
 
+#ifdef SCM_RIGHTS
+
 ssize_t fd_send(int handle, int send_fd, const void *data, size_t size)
 {
         struct msghdr msg;
@@ -131,7 +133,7 @@
 	   Tru64 - msg_controllen isn't set */
 	cmsg = CMSG_FIRSTHDR(&msg);
 	if (
-#ifndef __osf__
+#ifndef __osf__ /* Tru64 */
 	    msg.msg_controllen < CMSG_SPACE(sizeof(int)) ||
 #endif
 	    cmsg == NULL || cmsg->cmsg_len < CMSG_LEN(sizeof(int)) ||
@@ -141,3 +143,22 @@
 		*fd = *((int *) CMSG_DATA(cmsg));
 	return ret;
 }
+
+#else
+#  ifdef __GNUC__
+#    warning SCM_RIGHTS not supported, privilege separation not possible
+#  endif
+ssize_t fd_send(int handle __attr_unused__, int send_fd __attr_unused__,
+		const void *data __attr_unused__, size_t size __attr_unused__)
+{
+	errno = EINVAL;
+	return -1;
+}
+
+ssize_t fd_read(int handle __attr_unused__, void *data __attr_unused__,
+		size_t size __attr_unused__, int *fd __attr_unused__)
+{
+	errno = EINVAL;
+	return -1;
+}
+#endif




More information about the dovecot-cvs mailing list