void *private_data,
uint32_t msg_type,
struct server_id server_id,
+ size_t num_fds,
+ int *fds,
DATA_BLOB *data)
{
bool ok;
+ if (num_fds != 0) {
+ DBG_WARNING("Received %zu fds, ignoring message\n", num_fds);
+ return;
+ }
+
DBG_NOTICE("Rescanning trusted domains\n");
ok = add_trusted_domains_dc();
/* called by the samldb ldb module to tell us to ask for a new RID
pool */
-void dreplsrv_allocate_rid(struct imessaging_context *msg, void *private_data,
+void dreplsrv_allocate_rid(struct imessaging_context *msg,
+ void *private_data,
uint32_t msg_type,
- struct server_id server_id, DATA_BLOB *data)
+ struct server_id server_id,
+ size_t num_fds,
+ int *fds,
+ DATA_BLOB *data)
{
struct dreplsrv_service *service = talloc_get_type(private_data, struct dreplsrv_service);
+ if (num_fds != 0) {
+ DBG_WARNING("Received %zu fds, ignoring message\n", num_fds);
+ return;
+ }
dreplsrv_ridalloc_check_rid_pool(service);
}
/* an individual message */
-static void irpc_handler(struct imessaging_context *, void *,
- uint32_t, struct server_id, DATA_BLOB *);
+static void irpc_handler(struct imessaging_context *,
+ void *,
+ uint32_t,
+ struct server_id,
+ size_t,
+ int *,
+ DATA_BLOB *);
/*
A useful function for testing the message system.
*/
-static void ping_message(struct imessaging_context *msg, void *private_data,
- uint32_t msg_type, struct server_id src, DATA_BLOB *data)
+static void ping_message(struct imessaging_context *msg,
+ void *private_data,
+ uint32_t msg_type,
+ struct server_id src,
+ size_t num_fds,
+ int *fds,
+ DATA_BLOB *data)
{
struct server_id_buf idbuf;
+
+ if (num_fds != 0) {
+ DBG_WARNING("Received %zu fds, ignoring message\n", num_fds);
+ return;
+ }
+
DEBUG(1,("INFO: Received PING message from server %s [%.*s]\n",
server_id_str_buf(src, &idbuf), (int)data->length,
data->data?(const char *)data->data:""));
imessaging_send(msg, src, MSG_PONG, data);
}
-static void pool_message(struct imessaging_context *msg, void *private_data,
- uint32_t msg_type, struct server_id src,
+static void pool_message(struct imessaging_context *msg,
+ void *private_data,
+ uint32_t msg_type,
+ struct server_id src,
+ size_t num_fds,
+ int *fds,
DATA_BLOB *data)
{
char *report;
+ if (num_fds != 0) {
+ DBG_WARNING("Received %zu fds, ignoring message\n", num_fds);
+ return;
+ }
+
report = talloc_report_str(msg, NULL);
if (report != NULL) {
void *private_data,
uint32_t msg_type,
struct server_id src,
+ size_t num_fds,
+ int *fds,
DATA_BLOB *data)
{
char *log = debug_get_ringbuf();
size_t logsize = debug_get_ringbuf_size();
DATA_BLOB blob;
+ if (num_fds != 0) {
+ DBG_WARNING("Received %zu fds, ignoring message\n", num_fds);
+ return;
+ }
+
if (log == NULL) {
log = discard_const_p(char, "*disabled*\n");
logsize = strlen(log) + 1;
void *private_data,
uint32_t msg_type,
struct server_id src,
+ size_t num_fds,
+ int *fds,
DATA_BLOB *data)
{
const char *params_str = (const char *)data->data;
struct server_id dst = imessaging_get_server_id(msg_ctx);
struct server_id_buf dst_buf;
+ if (num_fds != 0) {
+ DBG_WARNING("Received %zu fds, ignoring message\n", num_fds);
+ return;
+ }
+
/* Check, it's a proper string! */
if (params_str[(data->length)-1] != '\0') {
DBG_ERR("Invalid debug message from pid %s to pid %s\n",
void *private_data,
uint32_t msg_type,
struct server_id src,
+ size_t num_fds,
+ int *fds,
DATA_BLOB *data)
{
char *message = debug_list_class_names_and_levels();
struct server_id dst = imessaging_get_server_id(msg_ctx);
struct server_id_buf dst_buf;
+ if (num_fds != 0) {
+ DBG_WARNING("Received %zu fds, ignoring message\n", num_fds);
+ return;
+ }
+
DBG_DEBUG("Received REQ_DEBUGLEVEL message (pid %s from pid %s)\n",
server_id_str_buf(dst, &dst_buf),
server_id_str_buf(src, &src_buf));
return;
}
- if (num_fds != 0) {
- /*
- * Source4 based messaging does not expect fd's yet
- */
- return;
- }
-
if (ev != msg->ev) {
int ret;
ret = imessaging_post_self(msg, buf, buf_len);
for (; d; d = next) {
next = d->next;
- d->fn(msg, d->private_data, d->msg_type, src, &data);
+ d->fn(msg,
+ d->private_data,
+ d->msg_type,
+ src,
+ num_fds,
+ fds,
+ &data);
}
} else {
DEBUG(10, ("%s: Ignoring type=0x%x dst %s, I am %s, \n",
/*
handle an incoming irpc message
*/
-static void irpc_handler(struct imessaging_context *msg_ctx, void *private_data,
- uint32_t msg_type, struct server_id src, DATA_BLOB *packet)
+static void irpc_handler(struct imessaging_context *msg_ctx,
+ void *private_data,
+ uint32_t msg_type,
+ struct server_id src,
+ size_t num_fds,
+ int *fds,
+ DATA_BLOB *packet)
{
struct irpc_message *m;
enum ndr_err_code ndr_err;
+ if (num_fds != 0) {
+ DBG_WARNING("Received %zu fds, ignoring message\n", num_fds);
+ return;
+ }
+
m = talloc(msg_ctx, struct irpc_message);
if (m == NULL) goto failed;
/* taskid for messaging of parent process */
#define SAMBA_PARENT_TASKID 0
-typedef void (*msg_callback_t)(struct imessaging_context *msg, void *private_data,
- uint32_t msg_type,
- struct server_id server_id, DATA_BLOB *data);
+typedef void (*msg_callback_t)(
+ struct imessaging_context *msg,
+ void *private_data,
+ uint32_t msg_type,
+ struct server_id server_id,
+ size_t num_fds,
+ int *fds,
+ DATA_BLOB *data);
NTSTATUS imessaging_send(struct imessaging_context *msg, struct server_id server,
uint32_t msg_type, const DATA_BLOB *data);
void *private_data,
uint32_t msg_type,
struct server_id src,
+ size_t num_fds,
+ int *fds,
DATA_BLOB *data)
{
int sig;
struct server_id_buf tmp;
+ if (num_fds != 0) {
+ DBG_WARNING("Received %zu fds, ignoring message\n", num_fds);
+ return;
+ }
+
if (data->length != sizeof(sig)) {
DBG_ERR("Process %s sent bogus signal injection request\n",
server_id_str_buf(src, &tmp));
void *private_data,
uint32_t msg_type,
struct server_id src,
+ size_t num_fds,
+ int *fds,
DATA_BLOB *data)
{
unsigned int seconds;
struct server_id_buf tmp;
+ if (num_fds != 0) {
+ DBG_WARNING("Received %zu fds, ignoring message\n", num_fds);
+ return;
+ }
+
if (data->length != sizeof(seconds)) {
DBG_ERR("Process %s sent bogus sleep request\n",
server_id_str_buf(src, &tmp));
Py_RETURN_NONE;
}
-static void py_msg_callback_wrapper(struct imessaging_context *msg, void *private_data,
- uint32_t msg_type,
- struct server_id server_id, DATA_BLOB *data)
+static void py_msg_callback_wrapper(struct imessaging_context *msg,
+ void *private_data,
+ uint32_t msg_type,
+ struct server_id server_id,
+ size_t num_fds,
+ int *fds,
+ DATA_BLOB *data)
{
PyObject *py_server_id, *callback_and_tuple = (PyObject *)private_data;
PyObject *callback, *py_private;
struct server_id *p_server_id = talloc(NULL, struct server_id);
+
+ if (num_fds != 0) {
+ DBG_WARNING("Received %zu fds, ignoring message\n", num_fds);
+ return;
+ }
+
if (!p_server_id) {
PyErr_NoMemory();
return;
static uint32_t msg_pong;
-static void ping_message(struct imessaging_context *msg, void *private_data,
- uint32_t msg_type, struct server_id src, DATA_BLOB *data)
+static void ping_message(struct imessaging_context *msg,
+ void *private_data,
+ uint32_t msg_type,
+ struct server_id src,
+ size_t num_fds,
+ int *fds,
+ DATA_BLOB *data)
{
NTSTATUS status;
+
+ if (num_fds != 0) {
+ DBG_WARNING("Received %zu fds, ignoring message\n", num_fds);
+ return;
+ }
+
status = imessaging_send(msg, src, msg_pong, data);
if (!NT_STATUS_IS_OK(status)) {
printf("pong failed - %s\n", nt_errstr(status));
}
}
-static void pong_message(struct imessaging_context *msg, void *private_data,
- uint32_t msg_type, struct server_id src, DATA_BLOB *data)
+static void pong_message(struct imessaging_context *msg,
+ void *private_data,
+ uint32_t msg_type,
+ struct server_id src,
+ size_t num_fds,
+ int *fds,
+ DATA_BLOB *data)
{
int *count = (int *)private_data;
+
+ if (num_fds != 0) {
+ DBG_WARNING("Received %zu fds, ignoring message\n", num_fds);
+ return;
+ }
+
(*count)++;
}
-static void exit_message(struct imessaging_context *msg, void *private_data,
- uint32_t msg_type, struct server_id src, DATA_BLOB *data)
+static void exit_message(struct imessaging_context *msg,
+ void *private_data,
+ uint32_t msg_type,
+ struct server_id src,
+ size_t num_fds,
+ int *fds,
+ DATA_BLOB *data)
{
+ if (num_fds != 0) {
+ DBG_WARNING("Received %zu fds, ignoring message\n", num_fds);
+ return;
+ }
+
talloc_free(private_data);
exit(0);
}
void *private_data,
uint32_t msg_type,
struct server_id server_id,
+ size_t num_fds,
+ int *fds,
DATA_BLOB *data)
{
struct overflow_parent_child *state = private_data;
+ if (num_fds != 0) {
+ DBG_WARNING("Received %zu fds, ignoring message\n", num_fds);
+ return;
+ }
+
if (data->length == 0) {
state->done = true;
return;
void *private_data,
uint32_t msg_type,
struct server_id server_id,
+ size_t num_fds,
+ int *fds,
DATA_BLOB *data)
{
struct overflow_child_parent *state = private_data;
+ if (num_fds != 0) {
+ DBG_WARNING("Received %zu fds, ignoring message\n", num_fds);
+ return;
+ }
+
if (data->length != sizeof(state->final)) {
memset(state->final, 0, sizeof(state->final));
state->done = true;
void *private_data,
uint32_t msg_type,
struct server_id server_id,
+ size_t num_fds,
+ int *fds,
DATA_BLOB *data)
{
struct test_multi_ctx *state = private_data;
char *str = NULL;
+ if (num_fds != 0) {
+ DBG_WARNING("Received %zu fds, ignoring message\n", num_fds);
+ return;
+ }
+
torture_assert_goto(state->tctx, state->num_missing >= 1,
state->ok, fail,
"num_missing should be at least 1.");
void *private_data,
uint32_t msg_type,
struct server_id server_id,
+ size_t num_fds,
+ int *fds,
DATA_BLOB *data)
{
struct test_multi_ctx *state = private_data;
char *str = NULL;
+ if (num_fds != 0) {
+ DBG_WARNING("Received %zu fds, ignoring message\n", num_fds);
+ return;
+ }
+
torture_assert_goto(state->tctx, state->num_missing >= 2,
state->ok, fail,
"num_missing should be at least 2.");
void *private_data,
uint32_t msg_type,
struct server_id server_id,
+ size_t num_fds,
+ int *fds,
DATA_BLOB *data)
{
struct test_multi_ctx *state = private_data;
char *str = NULL;
+ if (num_fds != 0) {
+ DBG_WARNING("Received %zu fds, ignoring message\n", num_fds);
+ return;
+ }
+
torture_assert_goto(state->tctx, state->num_missing >= 2,
state->ok, fail,
"num_missing should be at least 2.");
#define NOTIFY_ENABLE_DEFAULT true
static NTSTATUS notify_remove_all(struct notify_context *notify);
-static void notify_handler(struct imessaging_context *msg_ctx, void *private_data,
- uint32_t msg_type, struct server_id server_id, DATA_BLOB *data);
+static void notify_handler(struct imessaging_context *msg_ctx,
+ void *private_data,
+ uint32_t msg_type,
+ struct server_id server_id,
+ size_t num_fds,
+ int *fds,
+ DATA_BLOB *data);
/*
destroy the notify context
/*
handle incoming notify messages
*/
-static void notify_handler(struct imessaging_context *msg_ctx, void *private_data,
- uint32_t msg_type, struct server_id server_id, DATA_BLOB *data)
+static void notify_handler(struct imessaging_context *msg_ctx,
+ void *private_data,
+ uint32_t msg_type,
+ struct server_id server_id,
+ size_t num_fds,
+ int *fds,
+ DATA_BLOB *data)
{
struct notify_context *notify = talloc_get_type(private_data, struct notify_context);
enum ndr_err_code ndr_err;
TALLOC_CTX *tmp_ctx = talloc_new(notify);
struct notify_list *listel;
+ if (num_fds != 0) {
+ DBG_WARNING("Received %zu fds, ignoring message\n", num_fds);
+ return;
+ }
+
if (tmp_ctx == NULL) {
return;
}
}
static void pvfs_oplock_break_dispatch(struct imessaging_context *msg,
- void *private_data, uint32_t msg_type,
- struct server_id src, DATA_BLOB *data)
+ void *private_data,
+ uint32_t msg_type,
+ struct server_id src,
+ size_t num_fds,
+ int *fds,
+ DATA_BLOB *data)
{
struct pvfs_oplock *opl = talloc_get_type(private_data,
struct pvfs_oplock);
struct opendb_oplock_break opb;
+ if (num_fds != 0) {
+ DBG_WARNING("Received %zu fds, ignoring message\n", num_fds);
+ return;
+ }
+
ZERO_STRUCT(opb);
/* we need to check that this one is for us. See
receive a completion message for a wait
*/
static void pvfs_wait_dispatch(struct imessaging_context *msg,
- void *private_data, uint32_t msg_type,
- struct server_id src, DATA_BLOB *data)
+ void *private_data,
+ uint32_t msg_type,
+ struct server_id src,
+ size_t num_fds,
+ int *fds,
+ DATA_BLOB *data)
{
struct pvfs_wait *pwait = talloc_get_type(private_data,
struct pvfs_wait);
struct ntvfs_request *req;
void *p = NULL;
+ if (num_fds != 0) {
+ DBG_WARNING("Received %zu fds, ignoring message\n", num_fds);
+ return;
+ }
+
/* we need to check that this one is for us. See
imessaging_send_ptr() for the other side of this.
*/
void *private_data,
uint32_t msg_type,
struct server_id src,
+ size_t num_fds,
+ int *fds,
DATA_BLOB *data)
{
struct server_state *state =
struct server_id dst = imessaging_get_server_id(msg);
struct server_id_buf dst_buf;
+ if (num_fds != 0) {
+ DBG_WARNING("Received %zu fds, ignoring message\n", num_fds);
+ return;
+ }
+
DBG_ERR("samba_shutdown of %s %s: from %s\n",
state->binary_name,
server_id_str_buf(dst, &dst_buf),