summaryrefslogtreecommitdiffstats
path: root/source3/winbindd/winbindd_async.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-12-21 14:32:34 +0100
committerVolker Lendecke <vl@samba.org>2009-12-21 16:27:18 +0100
commit0c3e3b7ab09eee927f8fbe8cabc1819ddde7c215 (patch)
tree115978c7057c31e3cd2835b70997be86501b6548 /source3/winbindd/winbindd_async.c
parentebcb28ca73eb17d1dcdc8c5a3f9ffca28ad348fb (diff)
downloadsamba-0c3e3b7ab09eee927f8fbe8cabc1819ddde7c215.tar.gz
samba-0c3e3b7ab09eee927f8fbe8cabc1819ddde7c215.tar.xz
samba-0c3e3b7ab09eee927f8fbe8cabc1819ddde7c215.zip
s3: Remove unused winbindd_lookupname_async
Diffstat (limited to 'source3/winbindd/winbindd_async.c')
-rw-r--r--source3/winbindd/winbindd_async.c150
1 files changed, 0 insertions, 150 deletions
diff --git a/source3/winbindd/winbindd_async.c b/source3/winbindd/winbindd_async.c
index bd1697e1504..efdcbc1281d 100644
--- a/source3/winbindd/winbindd_async.c
+++ b/source3/winbindd/winbindd_async.c
@@ -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)
{