s3: Remove some unused code
authorVolker Lendecke <vl@samba.org>
Wed, 23 Dec 2009 10:48:33 +0000 (11:48 +0100)
committerVolker Lendecke <vl@samba.org>
Wed, 23 Dec 2009 11:02:19 +0000 (12:02 +0100)
source3/winbindd/winbindd.h
source3/winbindd/winbindd_dual.c
source3/winbindd/winbindd_proto.h
source3/winbindd/winbindd_util.c

index 2e7d09f4424986c177eead585be49d95324af750..e58230225bee52d4c08ffd0987fd6977298c3805 100644 (file)
@@ -121,8 +121,6 @@ struct winbindd_cm_conn {
        struct rpc_pipe_client *netlogon_pipe;
 };
 
-struct winbindd_async_request;
-
 /* Async child */
 
 struct winbindd_domain;
index 4d22ec868f59e0a9b3bc25829598ee0102316451..a852727692b2e1f649d6ee957b9cbbedc200022a 100644 (file)
@@ -367,85 +367,6 @@ int wb_domain_request_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
        return 0;
 }
 
-/*
- * Machinery for async requests sent to children. You set up a
- * winbindd_request, select a child to query, and issue a async_request
- * call. When the request is completed, the callback function you specified is
- * called back with the private pointer you gave to async_request.
- */
-
-struct winbindd_async_request {
-       struct winbindd_async_request *next, *prev;
-       TALLOC_CTX *mem_ctx;
-       struct winbindd_child *child;
-       struct winbindd_response *response;
-       void (*continuation)(void *private_data, bool success);
-       struct timed_event *reply_timeout_event;
-       pid_t child_pid; /* pid of the child we're waiting on. Used to detect
-                           a restart of the child (child->pid != child_pid). */
-       void *private_data;
-};
-
-static void async_request_done(struct tevent_req *req);
-
-void async_request(TALLOC_CTX *mem_ctx, struct winbindd_child *child,
-                  struct winbindd_request *request,
-                  struct winbindd_response *response,
-                  void (*continuation)(void *private_data, bool success),
-                  void *private_data)
-{
-       struct winbindd_async_request *state;
-       struct tevent_req *req;
-
-       DEBUG(10, ("Sending request to child pid %d (domain=%s)\n",
-                  (int)child->pid,
-                  (child->domain != NULL) ? child->domain->name : "''"));
-
-       state = talloc(mem_ctx, struct winbindd_async_request);
-       if (state == NULL) {
-               DEBUG(0, ("talloc failed\n"));
-               continuation(private_data, False);
-               return;
-       }
-
-       state->mem_ctx = mem_ctx;
-       state->child = child;
-       state->reply_timeout_event = NULL;
-       state->response = response;
-       state->continuation = continuation;
-       state->private_data = private_data;
-
-       request->pid = child->pid;
-
-       req = wb_child_request_send(state, winbind_event_context(),
-                                          child, request);
-       if (req == NULL) {
-               DEBUG(0, ("wb_child_request_send failed\n"));
-                continuation(private_data, false);
-               return;
-        }
-       tevent_req_set_callback(req, async_request_done, state);
-}
-
-static void async_request_done(struct tevent_req *req)
-{
-       struct winbindd_async_request *state = tevent_req_callback_data(
-               req, struct winbindd_async_request);
-       struct winbindd_response *response;
-       int ret, err;
-
-       ret = wb_child_request_recv(req, state, &response, &err);
-       TALLOC_FREE(req);
-       if (ret == -1) {
-               DEBUG(2, ("wb_child_request_recv failed: %s\n",
-                         strerror(err)));
-               state->continuation(state->private_data, false);
-               return;
-       }
-       *state->response = *response;
-       state->continuation(state->private_data, true);
-}
-
 struct domain_request_state {
        struct winbindd_domain *domain;
        struct winbindd_request *request;
index ce1789e7fb0ad816b0a83bf32e630966dacf94b2..cb3e84184c84b2c8b985d3d6b5de6c0e3d13fe16 100644 (file)
@@ -276,11 +276,6 @@ struct tevent_req *wb_domain_request_send(TALLOC_CTX *mem_ctx,
 int wb_domain_request_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
                           struct winbindd_response **presponse, int *err);
 
-void async_request(TALLOC_CTX *mem_ctx, struct winbindd_child *child,
-                  struct winbindd_request *request,
-                  struct winbindd_response *response,
-                  void (*continuation)(void *private_data, bool success),
-                  void *private_data);
 void async_domain_request(TALLOC_CTX *mem_ctx,
                          struct winbindd_domain *domain,
                          struct winbindd_request *request,
@@ -433,18 +428,6 @@ struct winbindd_domain *find_root_domain(void);
 struct winbindd_domain *find_builtin_domain(void);
 struct winbindd_domain *find_lookup_domain_from_sid(const DOM_SID *sid);
 struct winbindd_domain *find_lookup_domain_from_name(const char *domain_name);
-bool winbindd_lookup_sid_by_name(TALLOC_CTX *mem_ctx,
-                                enum winbindd_cmd orig_cmd,
-                                struct winbindd_domain *domain, 
-                                const char *domain_name,
-                                const char *name, DOM_SID *sid, 
-                                enum lsa_SidType *type);
-bool winbindd_lookup_name_by_sid(TALLOC_CTX *mem_ctx,
-                                struct winbindd_domain *domain,
-                                DOM_SID *sid,
-                                char **dom_name,
-                                char **name,
-                                enum lsa_SidType *type);
 void free_getent_state(struct getent_state *state);
 bool parse_domain_user(const char *domuser, fstring domain, fstring user);
 bool parse_domain_user_talloc(TALLOC_CTX *mem_ctx, const char *domuser,
index ff8c101b37a4bea3a90eab306804c15edfd95d62..c92e11aba3c9d2c27ee3f63249c55f67bb59285b 100644 (file)
@@ -868,72 +868,6 @@ struct winbindd_domain *find_lookup_domain_from_name(const char *domain_name)
        return find_our_domain();
 }
 
-/* Lookup a sid in a domain from a name */
-
-bool winbindd_lookup_sid_by_name(TALLOC_CTX *mem_ctx,
-                                enum winbindd_cmd orig_cmd,
-                                struct winbindd_domain *domain,
-                                const char *domain_name,
-                                const char *name, DOM_SID *sid,
-                                enum lsa_SidType *type)
-{
-       NTSTATUS result;
-
-       /*
-        * For all but LOOKUPNAME we have to avoid nss calls to avoid
-        * recursion
-        */
-       result = domain->methods->name_to_sid(
-               domain, mem_ctx, domain_name, name,
-               orig_cmd == WINBINDD_LOOKUPNAME ? 0 : LOOKUP_NAME_NO_NSS,
-               sid, type);
-
-       /* Return sid and type if lookup successful */
-       if (!NT_STATUS_IS_OK(result)) {
-               *type = SID_NAME_UNKNOWN;
-       }
-
-       return NT_STATUS_IS_OK(result);
-}
-
-/**
- * @brief Lookup a name in a domain from a sid.
- *
- * @param sid Security ID you want to look up.
- * @param name On success, set to the name corresponding to @p sid.
- * @param dom_name On success, set to the 'domain name' corresponding to @p sid.
- * @param type On success, contains the type of name: alias, group or
- * user.
- * @retval True if the name exists, in which case @p name and @p type
- * are set, otherwise False.
- **/
-bool winbindd_lookup_name_by_sid(TALLOC_CTX *mem_ctx,
-                                struct winbindd_domain *domain,
-                                DOM_SID *sid,
-                                char **dom_name,
-                                char **name,
-                                enum lsa_SidType *type)
-{
-       NTSTATUS result;
-
-       *dom_name = NULL;
-       *name = NULL;
-
-       /* Lookup name */
-
-       result = domain->methods->sid_to_name(domain, mem_ctx, sid, dom_name, name, type);
-
-       /* Return name and type if successful */
-
-       if (NT_STATUS_IS_OK(result)) {
-               return True;
-       }
-
-       *type = SID_NAME_UNKNOWN;
-
-       return False;
-}
-
 /* Free state information held for {set,get,end}{pw,gr}ent() functions */
 
 void free_getent_state(struct getent_state *state)