s3: Remove unused winbindd_lookupname_async
authorVolker Lendecke <vl@samba.org>
Mon, 21 Dec 2009 13:32:34 +0000 (14:32 +0100)
committerVolker Lendecke <vl@samba.org>
Mon, 21 Dec 2009 15:28:27 +0000 (16:28 +0100)
source3/winbindd/winbindd_async.c
source3/winbindd/winbindd_proto.h

index bd1697e1504b97c2ea2f4cd238c387aef773f754..efdcbc1281d77efb38d5d8f3e84fc594b8a21b6d 100644 (file)
@@ -151,156 +151,6 @@ enum winbindd_result winbindd_dual_lookupsid(struct winbindd_domain *domain,
        return WINBINDD_OK;
 }
 
-/********************************************************************
- This is the second callback after contacting the forest root
-********************************************************************/
-
-struct lookupname_state {
-       char *dom_name;
-       char *name;
-       void *caller_private_data;
-};
-
-
-static void lookupname_recv2(TALLOC_CTX *mem_ctx, bool success,
-                           struct winbindd_response *response,
-                           void *c, void *private_data)
-{
-       void (*cont)(void *priv, bool succ, const DOM_SID *sid,
-                    enum lsa_SidType type) =
-               (void (*)(void *, bool, const DOM_SID *, enum lsa_SidType))c;
-       DOM_SID sid;
-       struct lookupname_state *s = talloc_get_type_abort( private_data,
-                                                           struct lookupname_state );
-
-       if (!success) {
-               DEBUG(5, ("Could not trigger lookup_name\n"));
-               cont(s->caller_private_data, False, NULL, SID_NAME_UNKNOWN);
-               return;
-       }
-
-       if (response->result != WINBINDD_OK) {
-               DEBUG(5, ("lookup_name returned an error\n"));
-               cont(s->caller_private_data, False, NULL, SID_NAME_UNKNOWN);
-               return;
-       }
-
-       if (!string_to_sid(&sid, response->data.sid.sid)) {
-               DEBUG(0, ("Could not convert string %s to sid\n",
-                         response->data.sid.sid));
-               cont(s->caller_private_data, False, NULL, SID_NAME_UNKNOWN);
-               return;
-       }
-
-       cont(s->caller_private_data, True, &sid,
-            (enum lsa_SidType)response->data.sid.type);
-}
-
-/********************************************************************
- This is the first callback after contacting our own domain
-********************************************************************/
-
-static void lookupname_recv(TALLOC_CTX *mem_ctx, bool success,
-                           struct winbindd_response *response,
-                           void *c, void *private_data)
-{
-       void (*cont)(void *priv, bool succ, const DOM_SID *sid,
-                    enum lsa_SidType type) =
-               (void (*)(void *, bool, const DOM_SID *, enum lsa_SidType))c;
-       DOM_SID sid;
-       struct lookupname_state *s = talloc_get_type_abort( private_data,
-                                                           struct lookupname_state );  
-
-       if (!success) {
-               DEBUG(5, ("lookupname_recv: lookup_name() failed!\n"));
-               cont(s->caller_private_data, False, NULL, SID_NAME_UNKNOWN);
-               return;
-       }
-
-       if (response->result != WINBINDD_OK) {
-               /* Try again using the forest root */
-               struct winbindd_domain *root_domain = find_root_domain();
-               struct winbindd_request request;
-
-               if ( !root_domain ) {
-                       DEBUG(5,("lookupname_recv: unable to determine forest root\n"));
-                       cont(s->caller_private_data, False, NULL, SID_NAME_UNKNOWN);
-                       return;
-               }
-
-               ZERO_STRUCT(request);
-               request.cmd = WINBINDD_LOOKUPNAME;
-
-               fstrcpy( request.data.name.dom_name, s->dom_name );
-               fstrcpy( request.data.name.name, s->name );
-
-               do_async_domain(mem_ctx, root_domain, &request, lookupname_recv2,
-                               (void *)cont, s);
-
-               return;
-       }
-
-       if (!string_to_sid(&sid, response->data.sid.sid)) {
-               DEBUG(0, ("Could not convert string %s to sid\n",
-                         response->data.sid.sid));
-               cont(s->caller_private_data, False, NULL, SID_NAME_UNKNOWN);
-               return;
-       }
-
-       cont(s->caller_private_data, True, &sid,
-            (enum lsa_SidType)response->data.sid.type);
-}
-
-/********************************************************************
- The lookup name call first contacts a DC in its own domain
- and fallbacks to contact a DC if the forest in our domain doesn't
- know the name.
-********************************************************************/
-
-void winbindd_lookupname_async(TALLOC_CTX *mem_ctx,
-                              const char *dom_name, const char *name,
-                              void (*cont)(void *private_data, bool success,
-                                           const DOM_SID *sid,
-                                           enum lsa_SidType type),
-                              enum winbindd_cmd orig_cmd,
-                              void *private_data)
-{
-       struct winbindd_request request;
-       struct winbindd_domain *domain;
-       struct lookupname_state *s;
-
-       domain = find_lookup_domain_from_name(dom_name);
-       if (domain == NULL) {
-               DEBUG(5, ("Could not find domain for name '%s'\n", dom_name));
-               cont(private_data, False, NULL, SID_NAME_UNKNOWN);
-               return;
-       }
-
-       ZERO_STRUCT(request);
-       request.cmd = WINBINDD_LOOKUPNAME;
-       request.original_cmd = orig_cmd;
-       fstrcpy(request.data.name.dom_name, dom_name);
-       fstrcpy(request.data.name.name, name);
-
-       if ( (s = TALLOC_ZERO_P(mem_ctx, struct lookupname_state)) == NULL ) {
-               DEBUG(0, ("winbindd_lookupname_async: talloc failed\n"));
-               cont(private_data, False, NULL, SID_NAME_UNKNOWN);
-               return;
-       }
-
-       s->dom_name = talloc_strdup( s, dom_name );
-       s->name     = talloc_strdup( s, name );
-       if (!s->dom_name || !s->name) {
-               cont(private_data, False, NULL, SID_NAME_UNKNOWN);
-               return;
-       }
-
-       s->caller_private_data = private_data;
-
-       do_async_domain(mem_ctx, domain, &request, lookupname_recv,
-                       (void *)cont, s);
-}
-
 enum winbindd_result winbindd_dual_lookupname(struct winbindd_domain *domain,
                                              struct winbindd_cli_state *state)
 {
index 6cd1799d17cafac3ed776a1798c9803ea4de3e5f..69ce15116c8940722e896b4329c75b55fee84393 100644 (file)
@@ -90,13 +90,6 @@ void do_async(TALLOC_CTX *mem_ctx, struct winbindd_child *child,
              void *c, void *private_data);
 enum winbindd_result winbindd_dual_lookupsid(struct winbindd_domain *domain,
                                             struct winbindd_cli_state *state);
-void winbindd_lookupname_async(TALLOC_CTX *mem_ctx,
-                              const char *dom_name, const char *name,
-                              void (*cont)(void *private_data, bool success,
-                                           const DOM_SID *sid,
-                                           enum lsa_SidType type),
-                              enum winbindd_cmd orig_cmd,
-                              void *private_data);
 enum winbindd_result winbindd_dual_lookupname(struct winbindd_domain *domain,
                                              struct winbindd_cli_state *state);
 void winbindd_listent_async(TALLOC_CTX *mem_ctx,