The branch, v3-5-test has been updated
       via  45eb237... s3: Shrink winbindd_proto.h a bit
       via  9a4bba3... s3: Fix some nonempty blank lines
       via  8787863... s3: Remove unused get_sam_group_entries
       via  7c309bc... s3: Remove unused winbindd_dual_getsidaliases
       via  013fada... s3: Remove an unused struct definition
       via  fe02517... s3: Remove unused winbindd_dual_getuserdomgroups
       via  2c6905d... s3: Remove unused winbindd_dual_getdcname
       via  79ff187... s3: Remove unused winbindd_dual_lookupname
       via  a17b245... s3: Remove unused winbindd_dual_lookupsid
       via  55478de... s3: Remove unused winbindd_dual_userinfo
       via  92b8aa1... s3: Remove some unused dual functions
       via  a575b44... s3: Remove unused do_async
       via  83dac5e... s3: Remove unused winbindd_gid2sid_async
       via  0e547f5... s3: Remove unused winbindd_uid2sid_async
       via  9cd4a58... s3: Remove unused winbindd_sid2gid_async
       via  810f4f5... s3: Remove unused winbindd_sid2uid_async
       via  21a6a95... s3: Remove unused do_async_domain
       via  8a51dc0... s3: Remove unused query_user_async
       via  ebecce9... s3: Remove unused winbindd_getsidaliases_async
       via  038c852... s3: Remove unused winbindd_lookupname_async
       via  9c3c632... s3: Remove unused winbindd_lookupsid_async
       via  1a786b3... s3:winbind: use wb_fill_pwent in wb_getpwsid
       via  a30f489... s3:winbind: Move fillup_pw_field() as static to 
wb_fill_pwent.c
      from  350e7db... WHATSNEW: Update changes since 3.5.0pre2.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-5-test


- Log -----------------------------------------------------------------
commit 45eb2372ce7e69428d53ef58b3a216a5bfadbd0c
Author: Volker Lendecke <[email protected]>
Date:   Mon Dec 21 15:27:39 2009 +0100

    s3: Shrink winbindd_proto.h a bit

commit 9a4bba3fd7045268de444105b95b702e57df39e9
Author: Volker Lendecke <[email protected]>
Date:   Mon Dec 21 15:11:55 2009 +0100

    s3: Fix some nonempty blank lines

commit 8787863172d26ee6f4f59b4b099491cd9898d475
Author: Volker Lendecke <[email protected]>
Date:   Mon Dec 21 15:02:56 2009 +0100

    s3: Remove unused get_sam_group_entries

commit 7c309bcba0034a4e6b165ce9d542cb020e2c0e02
Author: Volker Lendecke <[email protected]>
Date:   Mon Dec 21 15:01:44 2009 +0100

    s3: Remove unused winbindd_dual_getsidaliases

commit 013fada66aa9df4cc505f7ed6a2033969b46282a
Author: Volker Lendecke <[email protected]>
Date:   Mon Dec 21 14:59:11 2009 +0100

    s3: Remove an unused struct definition

commit fe02517e8a622e5b2f9d55f1a18392e91d776a45
Author: Volker Lendecke <[email protected]>
Date:   Mon Dec 21 14:58:21 2009 +0100

    s3: Remove unused winbindd_dual_getuserdomgroups

commit 2c6905d0bcf0b60ec9bb98c84ac778dfe8b4ea86
Author: Volker Lendecke <[email protected]>
Date:   Mon Dec 21 14:57:03 2009 +0100

    s3: Remove unused winbindd_dual_getdcname

commit 79ff1876b989ba0eb9de2e348b87a8721b61c7b6
Author: Volker Lendecke <[email protected]>
Date:   Mon Dec 21 14:55:02 2009 +0100

    s3: Remove unused winbindd_dual_lookupname

commit a17b245a9c6d9f2f954db5b3ff31295917e0f862
Author: Volker Lendecke <[email protected]>
Date:   Mon Dec 21 14:54:15 2009 +0100

    s3: Remove unused winbindd_dual_lookupsid

commit 55478de7b54cc940324fd76ea2ec05025dbeeccd
Author: Volker Lendecke <[email protected]>
Date:   Mon Dec 21 14:49:48 2009 +0100

    s3: Remove unused winbindd_dual_userinfo

commit 92b8aa1fd6676fde028c8770fb943a3e36f90329
Author: Volker Lendecke <[email protected]>
Date:   Mon Dec 21 14:47:57 2009 +0100

    s3: Remove some unused dual functions

commit a575b4434056a46bb936ec395d3c615098b548f9
Author: Volker Lendecke <[email protected]>
Date:   Mon Dec 21 14:42:18 2009 +0100

    s3: Remove unused do_async

commit 83dac5e827eb5002e581f50662b23b3167a03bd0
Author: Volker Lendecke <[email protected]>
Date:   Mon Dec 21 14:40:09 2009 +0100

    s3: Remove unused winbindd_gid2sid_async

commit 0e547f5ff62828887cd3796e1dd3d52db9282be3
Author: Volker Lendecke <[email protected]>
Date:   Mon Dec 21 14:39:36 2009 +0100

    s3: Remove unused winbindd_uid2sid_async

commit 9cd4a58f2c8efd019d95f0cffbcbc51aaec89bf4
Author: Volker Lendecke <[email protected]>
Date:   Mon Dec 21 14:38:31 2009 +0100

    s3: Remove unused winbindd_sid2gid_async

commit 810f4f5e19534ac6cb3b37ab456804a27c24fdb0
Author: Volker Lendecke <[email protected]>
Date:   Mon Dec 21 14:37:54 2009 +0100

    s3: Remove unused winbindd_sid2uid_async

commit 21a6a950ed182e14095f2d48dfd9c4bb17ed95b3
Author: Volker Lendecke <[email protected]>
Date:   Mon Dec 21 14:36:24 2009 +0100

    s3: Remove unused do_async_domain

commit 8a51dc029bfd06ecac09b3e9abed35513b4db386
Author: Volker Lendecke <[email protected]>
Date:   Mon Dec 21 14:34:15 2009 +0100

    s3: Remove unused query_user_async

commit ebecce92ab90b9e9acf7dbfd200d4e5a9330cf35
Author: Volker Lendecke <[email protected]>
Date:   Mon Dec 21 14:33:26 2009 +0100

    s3: Remove unused winbindd_getsidaliases_async

commit 038c85202463d79d8c9b01d283706bd9dbc0b057
Author: Volker Lendecke <[email protected]>
Date:   Mon Dec 21 14:32:34 2009 +0100

    s3: Remove unused winbindd_lookupname_async

commit 9c3c632464115bb21db068f586eee578979a1343
Author: Volker Lendecke <[email protected]>
Date:   Mon Dec 21 14:31:31 2009 +0100

    s3: Remove unused winbindd_lookupsid_async

commit 1a786b31b672cd2e6486433d273e5475d6243f42
Author: Volker Lendecke <[email protected]>
Date:   Sat Oct 3 17:10:53 2009 +0200

    s3:winbind: use wb_fill_pwent in wb_getpwsid

commit a30f489fa5aae359c3775869e3a26386ef306739
Author: Volker Lendecke <[email protected]>
Date:   Sat Oct 17 17:00:13 2009 +0200

    s3:winbind: Move fillup_pw_field() as static to wb_fill_pwent.c

-----------------------------------------------------------------------

Summary of changes:
 source3/Makefile.in                       |    1 -
 source3/winbindd/wb_fill_pwent.c          |   47 +++
 source3/winbindd/wb_getpwsid.c            |   89 +----
 source3/winbindd/winbindd_async.c         |  549 -----------------------------
 source3/winbindd/winbindd_ccache_access.c |    8 +-
 source3/winbindd/winbindd_domain.c        |   28 --
 source3/winbindd/winbindd_group.c         |  284 ---------------
 source3/winbindd/winbindd_idmap.c         |  321 -----------------
 source3/winbindd/winbindd_misc.c          |   92 +-----
 source3/winbindd/winbindd_proto.h         |  147 --------
 source3/winbindd/winbindd_user.c          |  112 ------
 11 files changed, 71 insertions(+), 1607 deletions(-)
 delete mode 100644 source3/winbindd/winbindd_user.c


Changeset truncated at 500 lines:

diff --git a/source3/Makefile.in b/source3/Makefile.in
index 3fcc486..304d432 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -1146,7 +1146,6 @@ IDMAP_ADEX_OBJ = \
 
 WINBINDD_OBJ1 = \
                winbindd/winbindd.o       \
-               winbindd/winbindd_user.o  \
                winbindd/winbindd_group.o \
                winbindd/winbindd_util.o  \
                winbindd/winbindd_cache.o \
diff --git a/source3/winbindd/wb_fill_pwent.c b/source3/winbindd/wb_fill_pwent.c
index 4f4819c..8998bf9 100644
--- a/source3/winbindd/wb_fill_pwent.c
+++ b/source3/winbindd/wb_fill_pwent.c
@@ -27,6 +27,14 @@ struct wb_fill_pwent_state {
        struct winbindd_pw *pw;
 };
 
+static bool fillup_pw_field(const char *lp_template,
+                           const char *username,
+                           const char *domname,
+                           uid_t uid,
+                           gid_t gid,
+                           const char *in,
+                           fstring out);
+
 static void wb_fill_pwent_sid2uid_done(struct tevent_req *subreq);
 static void wb_fill_pwent_sid2gid_done(struct tevent_req *subreq);
 
@@ -153,3 +161,42 @@ NTSTATUS wb_fill_pwent_recv(struct tevent_req *req)
 {
        return tevent_req_simple_recv_ntstatus(req);
 }
+
+static bool fillup_pw_field(const char *lp_template,
+                           const char *username,
+                           const char *domname,
+                           uid_t uid,
+                           gid_t gid,
+                           const char *in,
+                           fstring out)
+{
+       char *templ;
+
+       if (out == NULL)
+               return False;
+
+       /* The substitution of %U and %D in the 'template
+          homedir' is done by talloc_sub_specified() below.
+          If we have an in string (which means the value has already
+          been set in the nss_info backend), then use that.
+          Otherwise use the template value passed in. */
+
+       if ((in != NULL) && (in[0] != '\0') && (lp_security() == SEC_ADS)) {
+               templ = talloc_sub_specified(talloc_tos(), in,
+                                            username, domname,
+                                            uid, gid);
+       } else {
+               templ = talloc_sub_specified(talloc_tos(), lp_template,
+                                            username, domname,
+                                            uid, gid);
+       }
+
+       if (!templ)
+               return False;
+
+       safe_strcpy(out, templ, sizeof(fstring) - 1);
+       TALLOC_FREE(templ);
+
+       return True;
+
+}
diff --git a/source3/winbindd/wb_getpwsid.c b/source3/winbindd/wb_getpwsid.c
index 1295d5b..4ccc51a 100644
--- a/source3/winbindd/wb_getpwsid.c
+++ b/source3/winbindd/wb_getpwsid.c
@@ -31,8 +31,7 @@ struct wb_getpwsid_state {
 
 static void wb_getpwsid_queryuser_done(struct tevent_req *subreq);
 static void wb_getpwsid_lookupsid_done(struct tevent_req *subreq);
-static void wb_getpwsid_sid2uid_done(struct tevent_req *subreq);
-static void wb_getpwsid_sid2gid_done(struct tevent_req *subreq);
+static void wb_getpwsid_done(struct tevent_req *subreq);
 
 struct tevent_req *wb_getpwsid_send(TALLOC_CTX *mem_ctx,
                                    struct tevent_context *ev,
@@ -83,14 +82,14 @@ static void wb_getpwsid_queryuser_done(struct tevent_req 
*subreq)
            && (state->userinfo->acct_name[0] != '\0')) {
                /*
                 * QueryUser got us a name, let's got directly to the
-                * sid2uid step
+                * fill_pwent step
                 */
-               subreq = wb_sid2uid_send(state, state->ev,
-                                        &state->userinfo->user_sid);
+               subreq = wb_fill_pwent_send(state, state->ev, state->userinfo,
+                                           state->pw);
                if (tevent_req_nomem(subreq, req)) {
                        return;
                }
-               tevent_req_set_callback(subreq, wb_getpwsid_sid2uid_done, req);
+               tevent_req_set_callback(subreq, wb_getpwsid_done, req);
                return;
        }
 
@@ -122,93 +121,25 @@ static void wb_getpwsid_lookupsid_done(struct tevent_req 
*subreq)
                tevent_req_nterror(req, status);
                return;
        }
-       subreq = wb_sid2uid_send(state, state->ev, &state->userinfo->user_sid);
+       subreq = wb_fill_pwent_send(state, state->ev, state->userinfo,
+                                   state->pw);
        if (tevent_req_nomem(subreq, req)) {
                return;
        }
-       tevent_req_set_callback(subreq, wb_getpwsid_sid2uid_done, req);
+       tevent_req_set_callback(subreq, wb_getpwsid_done, req);
 }
 
-static void wb_getpwsid_sid2uid_done(struct tevent_req *subreq)
+static void wb_getpwsid_done(struct tevent_req *subreq)
 {
        struct tevent_req *req = tevent_req_callback_data(
                subreq, struct tevent_req);
-       struct wb_getpwsid_state *state = tevent_req_data(
-               req, struct wb_getpwsid_state);
-       NTSTATUS status;
-
-       status = wb_sid2uid_recv(subreq, &state->pw->pw_uid);
-       TALLOC_FREE(subreq);
-       if (!NT_STATUS_IS_OK(status)) {
-               tevent_req_nterror(req, status);
-               return;
-       }
-       subreq = wb_sid2gid_send(state, state->ev,
-                                &state->userinfo->group_sid);
-       if (tevent_req_nomem(subreq, req)) {
-               return;
-       }
-       tevent_req_set_callback(subreq, wb_getpwsid_sid2gid_done, req);
-}
-
-static void wb_getpwsid_sid2gid_done(struct tevent_req *subreq)
-{
-       struct tevent_req *req = tevent_req_callback_data(
-               subreq, struct tevent_req);
-       struct wb_getpwsid_state *state = tevent_req_data(
-               req, struct wb_getpwsid_state);
        NTSTATUS status;
-       char *username;
-       char *mapped_name;
 
-       status = wb_sid2gid_recv(subreq, &state->pw->pw_gid);
-       TALLOC_FREE(subreq);
+       status = wb_fill_pwent_recv(subreq);
        if (!NT_STATUS_IS_OK(status)) {
                tevent_req_nterror(req, status);
                return;
        }
-
-       username = talloc_strdup_lower(state, state->userinfo->acct_name);
-       if (tevent_req_nomem(username, req)) {
-               return;
-       }
-
-       status = normalize_name_map(state, state->user_domain, username,
-                                   &mapped_name);
-
-       if (NT_STATUS_IS_OK(status)
-           || NT_STATUS_EQUAL(status, NT_STATUS_FILE_RENAMED)) {
-               /*
-                * normalize_name_map did something
-                */
-               fstrcpy(state->pw->pw_name, mapped_name);
-               TALLOC_FREE(mapped_name);
-       } else {
-               fill_domain_username(state->pw->pw_name,
-                                    state->user_domain->name,
-                                    username, True);
-       }
-       fstrcpy(state->pw->pw_passwd, "*");
-       fstrcpy(state->pw->pw_gecos, state->userinfo->full_name);
-
-       if (!fillup_pw_field(lp_template_homedir(), username,
-                            state->user_domain->name, state->pw->pw_uid,
-                            state->pw->pw_gid, state->userinfo->homedir,
-                            state->pw->pw_dir)) {
-               DEBUG(5, ("Could not compose homedir\n"));
-               tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
-               return;
-       }
-
-       if (!fillup_pw_field(lp_template_shell(), state->pw->pw_name,
-                            state->user_domain->name, state->pw->pw_uid,
-                            state->pw->pw_gid, state->userinfo->shell,
-                            state->pw->pw_shell)) {
-               DEBUG(5, ("Could not compose shell\n"));
-               tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
-               return;
-       }
-
        tevent_req_done(req);
 }
 
diff --git a/source3/winbindd/winbindd_async.c 
b/source3/winbindd/winbindd_async.c
index 6c5d92e..5a350b9 100644
--- a/source3/winbindd/winbindd_async.c
+++ b/source3/winbindd/winbindd_async.c
@@ -6,17 +6,6 @@
    Copyright (C) Volker Lendecke 2005
    Copyright (C) Gerald Carter 2006
 
-   The helpers always consist of three functions: 
-
-   * A request setup function that takes the necessary parameters together
-     with a continuation function that is to be called upon completion
-
-   * A private continuation function that is internal only. This is to be
-     called by the lower-level functions in do_async(). Its only task is to
-     properly call the continuation function named above.
-
-   * A worker function that is called inside the appropriate child process.
-
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 3 of the License, or
@@ -37,423 +26,6 @@
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_WINBIND
 
-struct do_async_state {
-       TALLOC_CTX *mem_ctx;
-       struct winbindd_request request;
-       struct winbindd_response response;
-       void (*cont)(TALLOC_CTX *mem_ctx,
-                    bool success,
-                    struct winbindd_response *response,
-                    void *c, void *private_data);
-       void *c, *private_data;
-};
-
-static void do_async_recv(void *private_data, bool success)
-{
-       struct do_async_state *state =
-               talloc_get_type_abort(private_data, struct do_async_state);
-
-       state->cont(state->mem_ctx, success, &state->response,
-                   state->c, state->private_data);
-}
-
-void do_async(TALLOC_CTX *mem_ctx, struct winbindd_child *child,
-             const struct winbindd_request *request,
-             void (*cont)(TALLOC_CTX *mem_ctx, bool success,
-                          struct winbindd_response *response,
-                          void *c, void *private_data),
-             void *c, void *private_data)
-{
-       struct do_async_state *state;
-
-       state = TALLOC_ZERO_P(mem_ctx, struct do_async_state);
-       if (state == NULL) {
-               DEBUG(0, ("talloc failed\n"));
-               cont(mem_ctx, False, NULL, c, private_data);
-               return;
-       }
-
-       state->mem_ctx = mem_ctx;
-       state->request = *request;
-       state->request.length = sizeof(state->request);
-       state->cont = cont;
-       state->c = c;
-       state->private_data = private_data;
-
-       async_request(mem_ctx, child, &state->request,
-                     &state->response, do_async_recv, state);
-}
-
-static void do_async_domain(TALLOC_CTX *mem_ctx, struct winbindd_domain 
*domain,
-                           const struct winbindd_request *request,
-                           void (*cont)(TALLOC_CTX *mem_ctx, bool success,
-                                        struct winbindd_response *response,
-                                        void *c, void *private_data),
-                           void *c, void *private_data)
-{
-       struct do_async_state *state;
-
-       state = TALLOC_ZERO_P(mem_ctx, struct do_async_state);
-       if (state == NULL) {
-               DEBUG(0, ("talloc failed\n"));
-               cont(mem_ctx, False, NULL, c, private_data);
-               return;
-       }
-
-       state->mem_ctx = mem_ctx;
-       state->request = *request;
-       state->request.length = sizeof(state->request);
-       state->cont = cont;
-       state->c = c;
-       state->private_data = private_data;
-
-       async_domain_request(mem_ctx, domain, &state->request,
-                            &state->response, do_async_recv, state);
-}
-
-struct lookupsid_state {
-       DOM_SID sid;    
-       void *caller_private_data;
-};
-
-
-static void lookupsid_recv2(TALLOC_CTX *mem_ctx, bool success,
-                          struct winbindd_response *response,
-                          void *c, void *private_data)
-{
-       void (*cont)(void *priv, bool succ, const char *dom_name,
-                    const char *name, enum lsa_SidType type) =
-               (void (*)(void *, bool, const char *, const char *,
-                         enum lsa_SidType))c;
-       struct lookupsid_state *s = talloc_get_type_abort(private_data, 
-                                                         struct 
lookupsid_state);
-
-       if (!success) {
-               DEBUG(5, ("Could not trigger lookupsid\n"));
-               cont(s->caller_private_data, False, NULL, NULL, 
SID_NAME_UNKNOWN);
-               return;
-       }
-
-       if (response->result != WINBINDD_OK) {
-               DEBUG(5, ("lookupsid (forest root) returned an error\n"));      
        
-               cont(s->caller_private_data, False, NULL, NULL, 
SID_NAME_UNKNOWN);
-               return;
-       }
-
-       cont(s->caller_private_data, True, response->data.name.dom_name,
-            response->data.name.name,
-            (enum lsa_SidType)response->data.name.type);
-}
-
-static void lookupsid_recv(TALLOC_CTX *mem_ctx, bool success,
-                          struct winbindd_response *response,
-                          void *c, void *private_data)
-{
-       void (*cont)(void *priv, bool succ, const char *dom_name,
-                    const char *name, enum lsa_SidType type) =
-               (void (*)(void *, bool, const char *, const char *,
-                         enum lsa_SidType))c;
-       struct lookupsid_state *s = talloc_get_type_abort(private_data, 
-                                                         struct 
lookupsid_state);
-
-       if (!success) {
-               DEBUG(5, ("Could not trigger lookupsid\n"));
-               cont(s->caller_private_data, False, NULL, 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,("lookupsid_recv: unable to determine forest 
root\n"));
-                       cont(s->caller_private_data, False, NULL, NULL, 
SID_NAME_UNKNOWN);
-                       return;
-               }
-
-               ZERO_STRUCT(request);
-               request.cmd = WINBINDD_LOOKUPSID;
-               sid_to_fstring(request.data.sid, &s->sid);
-
-               do_async_domain(mem_ctx, root_domain, &request, lookupsid_recv2,
-                               (void *)cont, s);
-
-               return;
-       }
-
-       cont(s->caller_private_data, True, response->data.name.dom_name,
-            response->data.name.name,
-            (enum lsa_SidType)response->data.name.type);
-}
-
-void winbindd_lookupsid_async(TALLOC_CTX *mem_ctx, const DOM_SID *sid,
-                             void (*cont)(void *private_data, bool success,
-                                          const char *dom_name,
-                                          const char *name,
-                                          enum lsa_SidType type),
-                             void *private_data)
-{
-       struct winbindd_domain *domain;
-       struct winbindd_request request;
-       struct lookupsid_state *s;      
-
-       domain = find_lookup_domain_from_sid(sid);
-       if (domain == NULL) {
-               DEBUG(5, ("Could not find domain for sid %s\n",
-                         sid_string_dbg(sid)));
-               cont(private_data, False, NULL, NULL, SID_NAME_UNKNOWN);
-               return;
-       }
-
-       ZERO_STRUCT(request);
-       request.cmd = WINBINDD_LOOKUPSID;
-       sid_to_fstring(request.data.sid, sid);
-
-       if ( (s = TALLOC_ZERO_P(mem_ctx, struct lookupsid_state)) == NULL ) {
-               DEBUG(0, ("winbindd_lookupsid_async: talloc failed\n"));
-               cont(private_data, False, NULL, NULL, SID_NAME_UNKNOWN);
-               return;
-       }
-
-       sid_copy( &s->sid, sid );       
-       s->caller_private_data = private_data;  
-
-       do_async_domain(mem_ctx, domain, &request, lookupsid_recv,
-                       (void *)cont, s);
-}
-
-enum winbindd_result winbindd_dual_lookupsid(struct winbindd_domain *domain,
-                                            struct winbindd_cli_state *state)
-{
-       enum lsa_SidType type;
-       DOM_SID sid;
-       char *name;
-       char *dom_name;
-
-       /* Ensure null termination */
-       state->request->data.sid[sizeof(state->request->data.sid)-1]='\0';
-
-       DEBUG(3, ("[%5lu]: lookupsid %s\n", (unsigned long)state->pid, 
-                 state->request->data.sid));
-
-       /* Lookup sid from PDC using lsa_lookup_sids() */
-
-       if (!string_to_sid(&sid, state->request->data.sid)) {
-               DEBUG(5, ("%s not a SID\n", state->request->data.sid));
-               return WINBINDD_ERROR;
-       }
-
-       /* Lookup the sid */
-
-       if (!winbindd_lookup_name_by_sid(state->mem_ctx, domain, &sid, 
-                                        &dom_name, &name, &type)) 
-       {
-               TALLOC_FREE(dom_name);
-               TALLOC_FREE(name);
-               return WINBINDD_ERROR;
-       }
-
-       fstrcpy(state->response->data.name.dom_name, dom_name);
-       fstrcpy(state->response->data.name.name, name);
-       state->response->data.name.type = type;
-
-       TALLOC_FREE(dom_name);
-       TALLOC_FREE(name);
-       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;
-       }
-


-- 
Samba Shared Repository

Reply via email to