r24778: Make sure krb5 locator requests go to a separate locator winbind child.
authorGünther Deschner <gd@samba.org>
Wed, 29 Aug 2007 12:43:23 +0000 (12:43 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:30:20 +0000 (12:30 -0500)
Guenther
(This used to be commit fb9228b8d167552f0a046ab674f66d4e5b73f5b6)

source3/nsswitch/winbindd.c
source3/nsswitch/winbindd_dual.c
source3/nsswitch/winbindd_misc.c
source3/nsswitch/winbindd_util.c

index 3bf054eb4fff4d884558724d338516ecc653423d..ecc30e140a160c4f412e2375822b0c90ad00637f 100644 (file)
@@ -1184,6 +1184,7 @@ int main(int argc, char **argv, char **envp)
        }
 
        init_idmap_child();
+       init_locator_child();
 
        smb_nscd_flush_user_cache();
        smb_nscd_flush_group_cache();
index c6cafe79ec1fe5244c3642d340bf72e444a5e1d1..b79445ee865b56c55e8d7aaf26913162dab3631d 100644 (file)
@@ -579,9 +579,9 @@ void winbind_msg_offline(struct messaging_context *msg_ctx,
        }
 
        for (child = children; child != NULL; child = child->next) {
-               /* Don't send message to idmap child.  We've already
+               /* Don't send message to internal childs.  We've already
                   done so above. */
-               if (!child->domain || (child == idmap_child())) {
+               if (!child->domain || winbindd_internal_child(child)) {
                        continue;
                }
 
@@ -655,8 +655,8 @@ void winbind_msg_online(struct messaging_context *msg_ctx,
        }
 
        for (child = children; child != NULL; child = child->next) {
-               /* Don't send message to idmap child. */
-               if (!child->domain || (child == idmap_child())) {
+               /* Don't send message to internal childs. */
+               if (!child->domain || winbindd_internal_child(child)) {
                        continue;
                }
 
index 8f1e6536196a94e0f0c7d13c28ce441b0f1a3ec3..c32f052e3c9dc281949f29cbc55ded6adb8e2e76 100644 (file)
@@ -270,6 +270,18 @@ enum winbindd_result winbindd_dual_getdcname(struct winbindd_domain *domain,
        return WINBINDD_OK;
 }
 
+static struct winbindd_child static_locator_child;
+
+void init_locator_child(void)
+{
+       setup_domain_child(NULL, &static_locator_child, "locator");
+}
+
+struct winbindd_child *locator_child(void)
+{
+       return &static_locator_child;
+}
+
 void winbindd_dsgetdcname(struct winbindd_cli_state *state)
 {
        state->request.domain_name
@@ -278,7 +290,7 @@ void winbindd_dsgetdcname(struct winbindd_cli_state *state)
        DEBUG(3, ("[%5lu]: DsGetDcName for %s\n", (unsigned long)state->pid,
                  state->request.domain_name));
 
-       sendto_domain(state, find_our_domain());
+       sendto_child(state, locator_child());
 }
 
 enum winbindd_result winbindd_dual_dsgetdcname(struct winbindd_domain *domain,
@@ -603,3 +615,4 @@ void winbindd_priv_pipe_dir(struct winbindd_cli_state *state)
 
        request_ok(state);
 }
+
index 591d2355d96f89f98992bf73615a9a5c939b391b..e8831b365394e392a019b2bc31e9df548ab08a44 100644 (file)
@@ -1353,3 +1353,15 @@ BOOL winbindd_can_contact_domain( struct winbindd_domain *domain )
        
        return True;    
 }
+
+/*********************************************************************
+ ********************************************************************/
+
+BOOL winbindd_internal_child(struct winbindd_child *child)
+{
+       if (child == idmap_child() || child == locator_child()) {
+               return True;
+       }
+
+       return False;
+}