Skip to content
Snippets Groups Projects
Commit 206b071e authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Add check of <sys/uio.h> and include as needed for struct iovec.

parent e820f2f5
No related branches found
No related tags found
No related merge requests found
This diff is collapsed.
......@@ -836,10 +836,12 @@ AC_CHECK_HEADERS( \
sys/resource.h \
sys/select.h \
sys/socket.h \
sys/stat.h \
sys/syslog.h \
sys/time.h \
sys/types.h \
sys/ucred.h \
sys/uio.h \
syslog.h \
termios.h \
unistd.h \
......
......@@ -539,6 +539,9 @@
/* Define if you have the <sys/socket.h> header file. */
#undef HAVE_SYS_SOCKET_H
/* Define if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define if you have the <sys/syslog.h> header file. */
#undef HAVE_SYS_SYSLOG_H
......@@ -551,6 +554,9 @@
/* Define if you have the <sys/ucred.h> header file. */
#undef HAVE_SYS_UCRED_H
/* Define if you have the <sys/uio.h> header file. */
#undef HAVE_SYS_UIO_H
/* Define if you have the <sys/un.h> header file. */
#undef HAVE_SYS_UN_H
......
......@@ -25,8 +25,12 @@
#include <ac/time.h>
#include <ac/unistd.h>
/* XXX non-portable */
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
#ifdef HAVE_SYS_UIO_H
#include <sys/uio.h>
#endif
#ifdef HAVE_IO_H
#include <io.h>
......@@ -163,10 +167,12 @@ ldap_pvt_connect(LDAP *ld, ber_socket_t s, struct sockaddr_un *sa, int async)
/* Send a dummy message with access rights. Remote side will
* obtain our uid/gid by fstat'ing this descriptor.
*/
sendcred: {
sendcred:
{
int fds[2];
/* Abandon, noop, has no reply */
char txt[] = {LDAP_TAG_MESSAGE, 6, LDAP_TAG_MSGID, 1, 0, LDAP_REQ_ABANDON, 1, 0};
char txt[] = {LDAP_TAG_MESSAGE, 6,
LDAP_TAG_MSGID, 1, 0, LDAP_REQ_ABANDON, 1, 0};
struct iovec iov = {txt, sizeof(txt)};
struct msghdr msg = {0};
if (pipe(fds) == 0) {
......@@ -175,7 +181,7 @@ sendcred: {
msg.msg_accrights = (char *)fds;
msg.msg_accrightslen = sizeof(int);
sendmsg( s, &msg, 0 );
close(fds[0]);
close(fds[0]);
close(fds[1]);
}
}
......
......@@ -21,6 +21,9 @@
#if !defined(SO_PEERCRED) && !defined(LOCAL_PEERCRED) && defined(HAVE_SENDMSG)
#define DO_SENDMSG
#ifdef HAVE_SYS_UIO_H
#include <sys/uio.h>
#endif
#include <sys/stat.h>
#endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment