summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2013-10-10 10:03:32 +0200
committerKarolin Seeger <kseeger@samba.org>2013-10-14 10:14:51 +0200
commit80a5575849c903a3cb4a9bd74f029e5b7c293aa3 (patch)
tree168894dcee7fefcd3334263c20058f02d4a91f14
parent920f8013ad5c57aaa941d5c7aea335726ed0bbae (diff)
downloadsamba-80a5575849c903a3cb4a9bd74f029e5b7c293aa3.tar.gz
s3-winbind: Send online/offline message of the domain to the parent.
https://bugzilla.samba.org/show_bug.cgi?id=10194 Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Fri Oct 11 13:37:56 CEST 2013 on sn-devel-104 (cherry picked from commit 275f6586c4d4547978c6ff2f04670b0d8f89fd4b)
-rw-r--r--source3/winbindd/winbindd_cm.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c
index 34955cd744a..82712793768 100644
--- a/source3/winbindd/winbindd_cm.c
+++ b/source3/winbindd/winbindd_cm.c
@@ -384,6 +384,8 @@ void winbind_msg_domain_online(struct messaging_context *msg_ctx,
void set_domain_offline(struct winbindd_domain *domain)
{
+ pid_t parent_pid = getppid();
+
DEBUG(10,("set_domain_offline: called for domain %s\n",
domain->name ));
@@ -431,6 +433,15 @@ void set_domain_offline(struct winbindd_domain *domain)
DEBUG(10,("set_domain_offline: added event handler for domain %s\n",
domain->name ));
+ /* Send a message to the parent that the domain is offline. */
+ if (parent_pid > 1 && !domain->internal) {
+ messaging_send_buf(winbind_messaging_context(),
+ pid_to_procid(parent_pid),
+ MSG_WINBIND_DOMAIN_OFFLINE,
+ (uint8 *)domain->name,
+ strlen(domain->name) + 1);
+ }
+
/* Send an offline message to the idmap child when our
primary domain goes offline */
@@ -455,6 +466,8 @@ void set_domain_offline(struct winbindd_domain *domain)
static void set_domain_online(struct winbindd_domain *domain)
{
+ pid_t parent_pid = getppid();
+
DEBUG(10,("set_domain_online: called for domain %s\n",
domain->name ));
@@ -506,6 +519,15 @@ static void set_domain_online(struct winbindd_domain *domain)
domain->online = True;
+ /* Send a message to the parent that the domain is online. */
+ if (parent_pid > 1 && !domain->internal) {
+ messaging_send_buf(winbind_messaging_context(),
+ pid_to_procid(parent_pid),
+ MSG_WINBIND_DOMAIN_ONLINE,
+ (uint8 *)domain->name,
+ strlen(domain->name) + 1);
+ }
+
/* Send an online message to the idmap child when our
primary domain comes online */