const uint8_t *buf, size_t len);
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);
void messaging_dispatch_rec(struct messaging_context *msg_ctx,
struct messaging_rec *rec);
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,
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;
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,
* 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;
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) {