summaryrefslogtreecommitdiffstats
path: root/source3/lib
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2014-05-17 15:19:18 +0200
committerMichael Adam <obnox@samba.org>2014-09-24 08:44:12 +0200
commit01026363dd0051eac00b555c5e0503a0484134cc (patch)
tree158c5f9bb2959366602e48fd91453cbbfedd8e61 /source3/lib
parent16678391925335d84ac95de11158959cb20280bc (diff)
downloadsamba-01026363dd0051eac00b555c5e0503a0484134cc.tar.gz
samba-01026363dd0051eac00b555c5e0503a0484134cc.tar.xz
samba-01026363dd0051eac00b555c5e0503a0484134cc.zip
s3:messaging: add fds-array to messaging_send_iov()
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> Signed-off-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/messages.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/source3/lib/messages.c b/source3/lib/messages.c
index 0579dbf359..84147de0f6 100644
--- a/source3/lib/messages.c
+++ b/source3/lib/messages.c
@@ -442,7 +442,7 @@ NTSTATUS messaging_send(struct messaging_context *msg_ctx,
iov.iov_base = data->data;
iov.iov_len = data->length;
- return messaging_send_iov(msg_ctx, server, msg_type, &iov, 1);
+ return messaging_send_iov(msg_ctx, server, msg_type, &iov, 1, NULL, 0);
}
NTSTATUS messaging_send_buf(struct messaging_context *msg_ctx,
@@ -455,7 +455,8 @@ NTSTATUS messaging_send_buf(struct messaging_context *msg_ctx,
NTSTATUS messaging_send_iov(struct messaging_context *msg_ctx,
struct server_id server, uint32_t msg_type,
- const struct iovec *iov, int iovlen)
+ const struct iovec *iov, int iovlen,
+ const int *fds, size_t num_fds)
{
int ret;
struct messaging_hdr hdr;
@@ -465,7 +466,15 @@ NTSTATUS messaging_send_iov(struct messaging_context *msg_ctx,
return NT_STATUS_INVALID_PARAMETER_MIX;
}
+ if (num_fds > INT8_MAX) {
+ return NT_STATUS_INVALID_PARAMETER_MIX;
+ }
+
if (!procid_is_local(&server)) {
+ if (num_fds > 0) {
+ return NT_STATUS_NOT_SUPPORTED;
+ }
+
ret = msg_ctx->remote->send_fn(msg_ctx->id, server,
msg_type, iov, iovlen,
NULL, 0,
@@ -484,6 +493,10 @@ NTSTATUS messaging_send_iov(struct messaging_context *msg_ctx,
* Self-send, directly dispatch
*/
+ if (num_fds > 0) {
+ return NT_STATUS_NOT_SUPPORTED;
+ }
+
buf = iov_buf(talloc_tos(), iov, iovlen);
if (buf == NULL) {
return NT_STATUS_NO_MEMORY;
@@ -511,7 +524,7 @@ NTSTATUS messaging_send_iov(struct messaging_context *msg_ctx,
memcpy(&iov2[1], iov, iovlen * sizeof(*iov));
become_root();
- ret = messaging_dgm_send(server.pid, iov2, iovlen+1, NULL, 0);
+ ret = messaging_dgm_send(server.pid, iov2, iovlen+1, fds, num_fds);
unbecome_root();
if (ret != 0) {