The Samba-Bugzilla – Attachment 10323 Details for
Bug 10849
source3/lib/unix_msg/unix_msg.c and source3/modules/vfs_aio_fork.c compiling errors on Solaris platform
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Test patch
look (text/plain), 2.15 KB, created by
Jeremy Allison
on 2014-10-02 19:52:18 UTC
(
hide
)
Description:
Test patch
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2014-10-02 19:52:18 UTC
Size:
2.15 KB
patch
obsolete
>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;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 10849
: 10323 |
10664