summaryrefslogtreecommitdiff
path: root/source3/nsswitch
diff options
context:
space:
mode:
Diffstat (limited to 'source3/nsswitch')
-rw-r--r--source3/nsswitch/winbindd.c11
-rw-r--r--source3/nsswitch/winbindd_cm.c36
-rw-r--r--source3/nsswitch/winbindd_dual.c35
3 files changed, 53 insertions, 29 deletions
diff --git a/source3/nsswitch/winbindd.c b/source3/nsswitch/winbindd.c
index 57591fb6c2..ae1078fe02 100644
--- a/source3/nsswitch/winbindd.c
+++ b/source3/nsswitch/winbindd.c
@@ -44,6 +44,17 @@ struct event_context *winbind_event_context(void)
return ctx;
}
+struct messaging_context *winbind_messaging_context(void)
+{
+ static struct messaging_context *ctx;
+
+ if (!ctx && !(ctx = messaging_init(NULL, server_id_self(),
+ winbind_event_context()))) {
+ smb_panic("Could not init winbind messaging context\n");
+ }
+ return ctx;
+}
+
/* Reload configuration */
static BOOL reload_services_file(void)
diff --git a/source3/nsswitch/winbindd_cm.c b/source3/nsswitch/winbindd_cm.c
index a0d12ee62c..58e0ff9d0a 100644
--- a/source3/nsswitch/winbindd_cm.c
+++ b/source3/nsswitch/winbindd_cm.c
@@ -219,18 +219,22 @@ static BOOL fork_child_dc_connect(struct winbindd_domain *domain)
if ((!get_dcs(mem_ctx, domain, &dcs, &num_dcs)) || (num_dcs == 0)) {
/* Still offline ? Can't find DC's. */
- message_send_pid(pid_to_procid(parent_pid), MSG_WINBIND_FAILED_TO_GO_ONLINE,
- domain->name,
- strlen(domain->name)+1, False);
+ messaging_send_buf(winbind_messaging_context(),
+ pid_to_procid(parent_pid),
+ MSG_WINBIND_FAILED_TO_GO_ONLINE,
+ (uint8 *)domain->name,
+ strlen(domain->name)+1);
_exit(0);
}
/* We got a DC. Send a message to our parent to get it to
try and do the same. */
- message_send_pid(pid_to_procid(parent_pid), MSG_WINBIND_TRY_TO_GO_ONLINE,
- domain->name,
- strlen(domain->name)+1, False);
+ messaging_send_buf(winbind_messaging_context(),
+ pid_to_procid(parent_pid),
+ MSG_WINBIND_TRY_TO_GO_ONLINE,
+ (uint8 *)domain->name,
+ strlen(domain->name)+1);
_exit(0);
}
@@ -358,11 +362,11 @@ void set_domain_offline(struct winbindd_domain *domain)
struct winbindd_child *idmap = idmap_child();
if ( idmap->pid != 0 ) {
- message_send_pid(pid_to_procid(idmap->pid),
- MSG_WINBIND_OFFLINE,
- domain->name,
- strlen(domain->name)+1,
- False);
+ messaging_send_buf(winbind_messaging_context(),
+ pid_to_procid(idmap->pid),
+ MSG_WINBIND_OFFLINE,
+ (uint8 *)domain->name,
+ strlen(domain->name)+1);
}
}
@@ -435,11 +439,11 @@ static void set_domain_online(struct winbindd_domain *domain)
struct winbindd_child *idmap = idmap_child();
if ( idmap->pid != 0 ) {
- message_send_pid(pid_to_procid(idmap->pid),
- MSG_WINBIND_ONLINE,
- domain->name,
- strlen(domain->name)+1,
- False);
+ messaging_send_buf(winbind_messaging_context(),
+ pid_to_procid(idmap->pid),
+ MSG_WINBIND_ONLINE,
+ (uint8 *)domain->name,
+ strlen(domain->name)+1);
}
}
diff --git a/source3/nsswitch/winbindd_dual.c b/source3/nsswitch/winbindd_dual.c
index fb335b56a5..ec6a32c445 100644
--- a/source3/nsswitch/winbindd_dual.c
+++ b/source3/nsswitch/winbindd_dual.c
@@ -524,8 +524,11 @@ void winbind_msg_offline(int msg_type, struct server_id src,
DEBUG(10,("winbind_msg_offline: sending message to pid %u for domain %s.\n",
(unsigned int)child->pid, domain->name ));
- message_send_pid(pid_to_procid(child->pid), MSG_WINBIND_OFFLINE, child->domain->name,
- strlen(child->domain->name)+1, False);
+ messaging_send_buf(winbind_messaging_context(),
+ pid_to_procid(child->pid),
+ MSG_WINBIND_OFFLINE,
+ (uint8 *)child->domain->name,
+ strlen(child->domain->name)+1);
}
}
@@ -567,11 +570,11 @@ void winbind_msg_online(int msg_type, struct server_id src,
struct winbindd_child *idmap = idmap_child();
if ( idmap->pid != 0 ) {
- message_send_pid(pid_to_procid(idmap->pid),
- MSG_WINBIND_ONLINE,
- domain->name,
- strlen(domain->name)+1,
- False);
+ messaging_send_buf(winbind_messaging_context(),
+ pid_to_procid(idmap->pid),
+ MSG_WINBIND_ONLINE,
+ (uint8 *)domain->name,
+ strlen(domain->name)+1);
}
}
@@ -594,8 +597,11 @@ void winbind_msg_online(int msg_type, struct server_id src,
DEBUG(10,("winbind_msg_online: sending message to pid %u for domain %s.\n",
(unsigned int)child->pid, child->domain->name ));
- message_send_pid(pid_to_procid(child->pid), MSG_WINBIND_ONLINE, child->domain->name,
- strlen(child->domain->name)+1, False);
+ messaging_send_buf(winbind_messaging_context(),
+ pid_to_procid(child->pid),
+ MSG_WINBIND_ONLINE,
+ (uint8 *)child->domain->name,
+ strlen(child->domain->name)+1);
}
}
@@ -612,8 +618,10 @@ void winbind_msg_onlinestatus(int msg_type, struct server_id src,
DEBUG(10,("winbind_msg_onlinestatus: "
"sending message to pid %u of primary domain.\n",
(unsigned int)child->pid));
- message_send_pid(pid_to_procid(child->pid),
- MSG_WINBIND_ONLINESTATUS, buf, len, False);
+ messaging_send_buf(winbind_messaging_context(),
+ pid_to_procid(child->pid),
+ MSG_WINBIND_ONLINESTATUS,
+ (uint8 *)buf, len);
break;
}
}
@@ -791,8 +799,9 @@ static void child_msg_onlinestatus(int msg_type, struct server_id src,
return;
}
- message_send_pid(*sender, MSG_WINBIND_ONLINESTATUS,
- message, strlen(message) + 1, True);
+ messaging_send_buf(winbind_messaging_context(),
+ *sender, MSG_WINBIND_ONLINESTATUS,
+ (uint8 *)message, strlen(message) + 1);
talloc_destroy(mem_ctx);
}