[SCM] Samba Shared Repository - branch master updated
Michael Adam
obnox at samba.org
Mon Jun 2 17:15:04 MDT 2014
The branch, master has been updated
via 6a0ebc4 s3:messaging: protect use of msg_control with HAVE_STRUCT_MSGHDR_MSG_CONTROL
via 65a6c31 build: rename HAVE_MSGHDR_MSG_ACCTRIGHTS to HAVE_STRUCT_MSGHDR_MSG_ACCTRIGHTS
via 86be491 build: rename HAVE_MSGHDR_MSG_CONTROL to HAVE_STRUCT_MSGHDR_MSG_CONTROL
via abedc71 vfs:aio_fork: simplify checking of MSG_CONTROL and MSG_ACCTRIGHTS
from 51077c6 s3:smb2_server: call smbd_smb2_flush_send_queue() directly
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 6a0ebc45968e65fa65cb23582d109531733e8a0e
Author: Michael Adam <obnox at samba.org>
Date: Sat May 31 12:16:08 2014 +0200
s3:messaging: protect use of msg_control with HAVE_STRUCT_MSGHDR_MSG_CONTROL
Signed-off-by: Michael Adam <obnox at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
Autobuild-User(master): Michael Adam <obnox at samba.org>
Autobuild-Date(master): Tue Jun 3 01:14:17 CEST 2014 on sn-devel-104
commit 65a6c31d9d6467bf23875daa5bab8135f7b1d347
Author: Michael Adam <obnox at samba.org>
Date: Sat May 31 12:05:50 2014 +0200
build: rename HAVE_MSGHDR_MSG_ACCTRIGHTS to HAVE_STRUCT_MSGHDR_MSG_ACCTRIGHTS
for consistency.
Signed-off-by: Michael Adam <obnox at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
commit 86be491912811502fa29720128341f91a38266c1
Author: Michael Adam <obnox at samba.org>
Date: Sat May 31 12:04:05 2014 +0200
build: rename HAVE_MSGHDR_MSG_CONTROL to HAVE_STRUCT_MSGHDR_MSG_CONTROL
So that we are consistent with the socket_wrapper define.
Signed-off-by: Michael Adam <obnox at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
commit abedc7116e8a096398e3f8e07b03ba832088e014
Author: Michael Adam <obnox at samba.org>
Date: Sat May 31 11:58:01 2014 +0200
vfs:aio_fork: simplify checking of MSG_CONTROL and MSG_ACCTRIGHTS
Signed-off-by: Michael Adam <obnox at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
-----------------------------------------------------------------------
Summary of changes:
source3/lib/unix_msg/unix_msg.c | 4 ++++
source3/modules/vfs_aio_fork.c | 23 +++++++++++------------
source3/wscript | 6 +++---
3 files changed, 18 insertions(+), 15 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source3/lib/unix_msg/unix_msg.c b/source3/lib/unix_msg/unix_msg.c
index bcabd28..602ecc6 100644
--- a/source3/lib/unix_msg/unix_msg.c
+++ b/source3/lib/unix_msg/unix_msg.c
@@ -244,8 +244,10 @@ static void unix_dgram_recv_handler(struct poll_watch *w, int fd, short events,
msg = (struct msghdr) {
.msg_iov = &iov,
.msg_iovlen = 1,
+#ifdef HAVE_STRUCT_MSGHDR_MSG_CONTROL
.msg_control = NULL,
.msg_controllen = 0,
+#endif
};
received = recvmsg(fd, &msg, 0);
@@ -509,8 +511,10 @@ static int unix_dgram_send(struct unix_dgram_ctx *ctx, const char *dst_sock,
msg.msg_namelen = sizeof(addr);
msg.msg_iov = discard_const_p(struct iovec, iov);
msg.msg_iovlen = iovlen;
+#ifdef HAVE_STRUCT_MSGHDR_MSG_CONTROL
msg.msg_control = NULL;
msg.msg_controllen = 0;
+#endif
msg.msg_flags = 0;
ret = sendmsg(ctx->sock, &msg, 0);
diff --git a/source3/modules/vfs_aio_fork.c b/source3/modules/vfs_aio_fork.c
index dc33031..97ec1cd 100644
--- a/source3/modules/vfs_aio_fork.c
+++ b/source3/modules/vfs_aio_fork.c
@@ -27,6 +27,10 @@
#include "lib/async_req/async_sock.h"
#include "lib/util/tevent_unix.h"
+#if !defined(HAVE_STRUCT_MSGHDR_MSG_CONTROL) && !defined(HAVE_STRUCT_MSGHDR_MSG_ACCTRIGHTS)
+# error Can not pass file descriptors
+#endif
+
#undef recvmsg
#ifndef MAP_FILE
@@ -150,11 +154,13 @@ static ssize_t read_fd(int fd, void *ptr, size_t nbytes, int *recvfd)
struct msghdr msg;
struct iovec iov[1];
ssize_t n;
-#ifndef HAVE_MSGHDR_MSG_CONTROL
+#ifndef HAVE_STRUCT_MSGHDR_MSG_CONTROL
int newfd;
-#endif
-#ifdef HAVE_MSGHDR_MSG_CONTROL
+ msg.msg_accrights = (caddr_t) &newfd;
+ msg.msg_accrightslen = sizeof(int);
+#else
+
union {
struct cmsghdr cm;
char control[CMSG_SPACE(sizeof(int))];
@@ -163,13 +169,6 @@ static ssize_t read_fd(int fd, void *ptr, size_t nbytes, int *recvfd)
msg.msg_control = control_un.control;
msg.msg_controllen = sizeof(control_un.control);
-#else
-#if HAVE_MSGHDR_MSG_ACCTRIGHTS
- msg.msg_accrights = (caddr_t) &newfd;
- msg.msg_accrightslen = sizeof(int);
-#else
-#error Can not pass file descriptors
-#endif
#endif
msg.msg_name = NULL;
@@ -185,7 +184,7 @@ static ssize_t read_fd(int fd, void *ptr, size_t nbytes, int *recvfd)
return(n);
}
-#ifdef HAVE_MSGHDR_MSG_CONTROL
+#ifdef HAVE_STRUCT_MSGHDR_MSG_CONTROL
if ((cmptr = CMSG_FIRSTHDR(&msg)) != NULL
&& cmptr->cmsg_len == CMSG_LEN(sizeof(int))) {
if (cmptr->cmsg_level != SOL_SOCKET) {
@@ -219,7 +218,7 @@ static ssize_t write_fd(int fd, void *ptr, size_t nbytes, int sendfd)
struct msghdr msg;
struct iovec iov[1];
-#ifdef HAVE_MSGHDR_MSG_CONTROL
+#ifdef HAVE_STRUCT_MSGHDR_MSG_CONTROL
union {
struct cmsghdr cm;
char control[CMSG_SPACE(sizeof(int))];
diff --git a/source3/wscript b/source3/wscript
index 3b38d19..cf9d787 100644
--- a/source3/wscript
+++ b/source3/wscript
@@ -552,7 +552,7 @@ union {
msg.msg_control = control_un.control;
msg.msg_controllen = sizeof(control_un.control);
''',
- 'HAVE_MSGHDR_MSG_CONTROL',
+ 'HAVE_STRUCT_MSGHDR_MSG_CONTROL',
msg='Checking if we can use msg_control for passing file descriptors',
headers='sys/types.h stdlib.h stddef.h sys/socket.h sys/un.h')
conf.CHECK_CODE('''
@@ -561,7 +561,7 @@ int fd;
msg.msg_acctrights = (caddr_t) &fd;
msg.msg_acctrightslen = sizeof(fd);
''',
- 'HAVE_MSGHDR_MSG_ACCTRIGHTS',
+ 'HAVE_STRUCT_MSGHDR_MSG_ACCTRIGHTS',
msg='Checking if we can use msg_acctrights for passing file descriptors',
headers='sys/types.h stdlib.h stddef.h sys/socket.h sys/un.h')
@@ -1841,7 +1841,7 @@ main() {
if conf.CONFIG_SET('HAVE_STATFS_F_FSID'):
default_shared_modules.extend(TO_LIST('vfs_fileid'))
- if (conf.CONFIG_SET('HAVE_MSGHDR_MSG_CONTROL') or conf.CONFIG_SET('HAVE_MSGHDR_MSG_ACCTRIGHTS')):
+ if (conf.CONFIG_SET('HAVE_STRUCT_MSGHDR_MSG_CONTROL') or conf.CONFIG_SET('HAVE_STRUCT_MSGHDR_MSG_ACCTRIGHTS')):
default_shared_modules.extend(TO_LIST('vfs_aio_fork'))
if Options.options.with_pthreadpool:
--
Samba Shared Repository
More information about the samba-cvs
mailing list