The branch, master has been updated via 57bcb80 s3: lib, s3: modules: Fix compilation on Solaris. via 7366204 lib: uid_wrapper: Fix setgroups and syscall detection on a system without native uid_wrapper library. from 1584095 windbindd: Make cm_connect_lsa_tcp static
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit 57bcb8055eb3e15c4ce7bcdeeef7efed175ed347 Author: Jeremy Allison <j...@samba.org> Date: Fri Oct 3 09:24:04 2014 -0700 s3: lib, s3: modules: Fix compilation on Solaris. Based on work from YOUZHONG YANG <youzh...@gmail.com>. Code needs fixing when HAVE_STRUCT_MSGHDR_MSG_CONTROL is not defined. Also Solaris doesn't have msg_flags field (which we set to zero anyway, so if we initialize the entire struct to zero, we never need to refer to it). https://bugzilla.samba.org/show_bug.cgi?id=10849 Signed-off-by: Jeremy Allison <j...@samba.org> Reviewed-by: Andreas Schneider <a...@samba.org> Autobuild-User(master): Andreas Schneider <a...@cryptomilk.org> Autobuild-Date(master): Mon Oct 6 12:33:36 CEST 2014 on sn-devel-104 commit 7366204845fda07ee4a83a1a63875f643d0a5794 Author: Jeremy Allison <j...@samba.org> Date: Fri Oct 3 17:18:34 2014 -0700 lib: uid_wrapper: Fix setgroups and syscall detection on a system without native uid_wrapper library. Originally from youzh...@gmail.com. https://bugzilla.samba.org/show_bug.cgi?id=10851 Signed-off-by: Jeremy Allison <j...@samba.org> Reviewed-by: Andreas Schneider <a...@samba.org> ----------------------------------------------------------------------- Summary of changes: lib/uid_wrapper/wscript | 7 +++++++ source3/lib/unix_msg/unix_msg.c | 19 ++++++++++--------- source3/modules/vfs_aio_fork.c | 5 ++++- 3 files changed, 21 insertions(+), 10 deletions(-) Changeset truncated at 500 lines: diff --git a/lib/uid_wrapper/wscript b/lib/uid_wrapper/wscript index 3e73e83..6b58595 100644 --- a/lib/uid_wrapper/wscript +++ b/lib/uid_wrapper/wscript @@ -49,6 +49,13 @@ def configure(conf): 'HAVE_FUNCTION_ATTRIBUTE_FORMAT', addmain=False, msg='Checking for printf format validation support') + # Prototype checks + conf.CHECK_C_PROTOTYPE('setgroups', + 'int setgroups(int ngroups, const gid_t *grouplist)', + define='HAVE_SETGROUPS_INT', headers='unistd.h sys/types.h') + conf.CHECK_C_PROTOTYPE('syscall', + 'int syscall(int number, ...)', + define='HAVE_SYSCALL_INT', headers='unistd.h sys/syscall.h') # Create full path to uid_wrapper srcdir = os.path.realpath(conf.srcdir) diff --git a/source3/lib/unix_msg/unix_msg.c b/source3/lib/unix_msg/unix_msg.c index 4870068..00ac7f5 100644 --- a/source3/lib/unix_msg/unix_msg.c +++ b/source3/lib/unix_msg/unix_msg.c @@ -477,7 +477,7 @@ static int queue_msg(struct unix_dgram_send_queue *q, struct unix_dgram_msg *msg; ssize_t data_len; uint8_t *data_buf; - size_t msglen; + size_t msglen = sizeof(struct unix_dgram_msg); int i; size_t tmp; int ret = -1; @@ -487,6 +487,13 @@ static int queue_msg(struct unix_dgram_send_queue *q, size_t cmsg_len = CMSG_LEN(fds_size); size_t cmsg_space = CMSG_SPACE(fds_size); char *cmsg_buf; + + /* + * Note: No need to check for overflow here, + * since cmsg will store <= INT8_MAX fds. + */ + msglen += cmsg_space; + #endif /* HAVE_STRUCT_MSGHDR_MSG_CONTROL */ if (num_fds > INT8_MAX) { @@ -499,14 +506,6 @@ static int queue_msg(struct unix_dgram_send_queue *q, } #endif - msglen = sizeof(struct unix_dgram_msg); - - /* - * Note: No need to check for overflow here, - * since cmsg will store <= INT8_MAX fds. - */ - msglen += cmsg_space; - data_len = iov_buflen(iov, iovlen); if (data_len == -1) { return EINVAL; @@ -593,7 +592,9 @@ static int queue_msg(struct unix_dgram_send_queue *q, return 0; fail: +#ifdef HAVE_STRUCT_MSGHDR_MSG_CONTROL close_fd_array(fds_copy, num_fds); +#endif return ret; } diff --git a/source3/modules/vfs_aio_fork.c b/source3/modules/vfs_aio_fork.c index c1bded9..12e6f80 100644 --- a/source3/modules/vfs_aio_fork.c +++ b/source3/modules/vfs_aio_fork.c @@ -157,6 +157,7 @@ static ssize_t read_fd(int fd, void *ptr, size_t nbytes, int *recvfd) #ifndef HAVE_STRUCT_MSGHDR_MSG_CONTROL int newfd; + ZERO_STRUCT(msg); msg.msg_accrights = (caddr_t) &newfd; msg.msg_accrightslen = sizeof(int); #else @@ -167,13 +168,15 @@ static ssize_t read_fd(int fd, void *ptr, size_t nbytes, int *recvfd) } control_un; struct cmsghdr *cmptr; + ZERO_STRUCT(msg); + ZERO_STRUCT(control_un); + msg.msg_control = control_un.control; msg.msg_controllen = sizeof(control_un.control); #endif msg.msg_name = NULL; msg.msg_namelen = 0; - msg.msg_flags = 0; iov[0].iov_base = (void *)ptr; iov[0].iov_len = nbytes; -- Samba Shared Repository