s3:winbindd: factor add_wbint_Principal_to_dict() out of wb_group_members_done()
[metze/samba/wip.git] / source3 / winbindd / winbindd_proto.h
index 389f8dfb673d311dc30176b962ffe5fd2e64b6f5..00b7c321949bbe1c5a239c90f3d7e5f372d45616 100644 (file)
@@ -28,12 +28,13 @@ struct messaging_context *winbind_messaging_context(void);
 void request_error(struct winbindd_cli_state *state);
 void request_ok(struct winbindd_cli_state *state);
 bool winbindd_setup_sig_term_handler(bool parent);
+bool winbindd_setup_stdin_handler(bool parent, bool foreground);
 bool winbindd_setup_sig_hup_handler(const char *lfile);
 bool winbindd_use_idmap_cache(void);
 bool winbindd_use_cache(void);
-void winbindd_register_handlers(void);
 const char *get_winbind_pipe_dir(void);
 char *get_winbind_priv_pipe_dir(void);
+struct tevent_context *winbind_event_context(void);
 int main(int argc, char **argv, char **envp);
 
 /* The following definitions come from winbindd/winbindd_ads.c  */
@@ -47,13 +48,6 @@ NTSTATUS winbindd_lookup_sids(TALLOC_CTX *mem_ctx,
                              char ***domains,
                              char ***names,
                              enum lsa_SidType **types);
-NTSTATUS winbindd_lookup_names(TALLOC_CTX *mem_ctx,
-                              struct winbindd_domain *domain,
-                              uint32_t num_names,
-                              const char **names,
-                              const char ***domains,
-                              struct dom_sid **sids,
-                              enum lsa_SidType **types);
 NTSTATUS rpc_lookup_sids(TALLOC_CTX *mem_ctx,
                         struct winbindd_domain *domain,
                         struct lsa_SidArray *sids,
@@ -170,6 +164,10 @@ NTSTATUS cm_connect_lsa(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx,
 NTSTATUS cm_connect_lsa_tcp(struct winbindd_domain *domain,
                            TALLOC_CTX *mem_ctx,
                            struct rpc_pipe_client **cli);
+NTSTATUS cm_connect_lsat(struct winbindd_domain *domain,
+                        TALLOC_CTX *mem_ctx,
+                        struct rpc_pipe_client **cli,
+                        struct policy_handle *lsa_policy);
 NTSTATUS cm_connect_netlogon(struct winbindd_domain *domain,
                             struct rpc_pipe_client **cli);
 bool fetch_current_dc_from_gencache(TALLOC_CTX *mem_ctx,
@@ -188,6 +186,7 @@ NTSTATUS add_ccache_to_list(const char *princ_name,
                            const char *ccname,
                            const char *service,
                            const char *username,
+                           const char *password,
                            const char *realm,
                            uid_t uid,
                            time_t create_time,
@@ -291,7 +290,8 @@ void winbind_msg_ip_dropped_parent(struct messaging_context *msg_ctx,
                                   uint32_t msg_type,
                                   struct server_id server_id,
                                   DATA_BLOB *data);
-bool winbindd_reinit_after_fork(const char *logfilename);
+NTSTATUS winbindd_reinit_after_fork(const struct winbindd_child *myself,
+                                   const char *logfilename);
 struct winbindd_domain *wb_child_domain(void);
 
 /* The following definitions come from winbindd/winbindd_group.c  */
@@ -317,6 +317,8 @@ NTSTATUS winbindd_print_groupmembers(struct talloc_dict *members,
 
 void init_idmap_child(void);
 struct winbindd_child *idmap_child(void);
+struct idmap_domain *idmap_find_domain_with_sid(const char *domname,
+                                               const struct dom_sid *sid);
 
 /* The following definitions come from winbindd/winbindd_locator.c  */
 
@@ -356,6 +358,12 @@ void ndr_print_winbindd_domain(struct ndr_print *ndr,
 /* The following definitions come from winbindd/winbindd_pam.c  */
 
 bool check_request_flags(uint32_t flags);
+NTSTATUS append_auth_data(TALLOC_CTX *mem_ctx,
+                         struct winbindd_response *resp,
+                         uint32_t request_flags,
+                         struct netr_SamInfo3 *info3,
+                         const char *name_domain,
+                         const char *name_user);
 uid_t get_uid_from_request(struct winbindd_request *request);
 struct winbindd_domain *find_auth_domain(uint8_t flags,
                                         const char *domain_name);
@@ -368,6 +376,8 @@ enum winbindd_result winbindd_dual_pam_chauthtok(struct winbindd_domain *contact
 enum winbindd_result winbindd_dual_pam_logoff(struct winbindd_domain *domain,
                                              struct winbindd_cli_state *state) ;
 enum winbindd_result winbindd_dual_pam_chng_pswd_auth_crap(struct winbindd_domain *domainSt, struct winbindd_cli_state *state);
+NTSTATUS winbindd_pam_auth_pac_send(struct winbindd_cli_state *state,
+                                   struct netr_SamInfo3 **info3);
 
 /* The following definitions come from winbindd/winbindd_util.c  */
 
@@ -390,7 +400,6 @@ struct winbindd_domain *find_lookup_domain_from_name(const char *domain_name);
 bool parse_domain_user(const char *domuser, fstring domain, fstring user);
 bool parse_domain_user_talloc(TALLOC_CTX *mem_ctx, const char *domuser,
                              char **domain, char **user);
-void parse_add_domuser(void *buf, char *domuser, int *len);
 bool canonicalize_username(fstring username_inout, fstring domain, fstring user);
 void fill_domain_username(fstring name, const char *domain, const char *user, bool can_assume);
 char *fill_domain_username_talloc(TALLOC_CTX *ctx,
@@ -429,12 +438,12 @@ void winbindd_set_locator_kdc_envs(const struct winbindd_domain *domain);
 void winbindd_unset_locator_kdc_env(const struct winbindd_domain *domain);
 void set_auth_errors(struct winbindd_response *resp, NTSTATUS result);
 bool is_domain_offline(const struct winbindd_domain *domain);
+bool is_domain_online(const struct winbindd_domain *domain);
 bool parse_sidlist(TALLOC_CTX *mem_ctx, const char *sidstr,
                   struct dom_sid **sids, uint32_t *num_sids);
 
 /* The following definitions come from winbindd/winbindd_wins.c  */
 
-void winbindd_wins_byip(struct winbindd_cli_state *state);
 void winbindd_wins_byname(struct winbindd_cli_state *state);
 
 struct tevent_req *wb_ping_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
@@ -466,6 +475,13 @@ struct tevent_req *winbindd_lookupsid_send(TALLOC_CTX *mem_ctx,
 NTSTATUS winbindd_lookupsid_recv(struct tevent_req *req,
                                 struct winbindd_response *response);
 
+struct tevent_req *winbindd_lookupsids_send(TALLOC_CTX *mem_ctx,
+                                           struct tevent_context *ev,
+                                           struct winbindd_cli_state *cli,
+                                           struct winbindd_request *request);
+NTSTATUS winbindd_lookupsids_recv(struct tevent_req *req,
+                                 struct winbindd_response *response);
+
 struct tevent_req *wb_lookupname_send(TALLOC_CTX *mem_ctx,
                                      struct tevent_context *ev,
                                      const char *dom_name, const char *name,
@@ -480,11 +496,6 @@ struct tevent_req *winbindd_lookupname_send(TALLOC_CTX *mem_ctx,
 NTSTATUS winbindd_lookupname_recv(struct tevent_req *req,
                                  struct winbindd_response *response);
 
-struct tevent_req *wb_sid2uid_send(TALLOC_CTX *mem_ctx,
-                                  struct tevent_context *ev,
-                                  const struct dom_sid *sid);
-NTSTATUS wb_sid2uid_recv(struct tevent_req *req, uid_t *uid);
-
 struct tevent_req *winbindd_sid_to_uid_send(TALLOC_CTX *mem_ctx,
                                            struct tevent_context *ev,
                                            struct winbindd_cli_state *cli,
@@ -492,11 +503,6 @@ struct tevent_req *winbindd_sid_to_uid_send(TALLOC_CTX *mem_ctx,
 NTSTATUS winbindd_sid_to_uid_recv(struct tevent_req *req,
                                  struct winbindd_response *response);
 
-struct tevent_req *wb_sid2gid_send(TALLOC_CTX *mem_ctx,
-                                  struct tevent_context *ev,
-                                  const struct dom_sid *sid);
-NTSTATUS wb_sid2gid_recv(struct tevent_req *req, gid_t *gid);
-
 struct tevent_req *winbindd_sid_to_gid_send(TALLOC_CTX *mem_ctx,
                                            struct tevent_context *ev,
                                            struct winbindd_cli_state *cli,
@@ -637,6 +643,11 @@ struct tevent_req *wb_group_members_send(TALLOC_CTX *mem_ctx,
                                         int max_depth);
 NTSTATUS wb_group_members_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
                               struct talloc_dict **members);
+NTSTATUS add_wbint_Principal_to_dict(TALLOC_CTX *mem_ctx,
+                                    struct dom_sid *sid,
+                                    const char **name,
+                                    enum lsa_SidType type,
+                                    struct talloc_dict *dict);
 
 struct tevent_req *wb_getgrsid_send(TALLOC_CTX *mem_ctx,
                                    struct tevent_context *ev,
@@ -846,6 +857,32 @@ NTSTATUS wb_lookupsids_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
                            struct lsa_RefDomainList **domains,
                            struct lsa_TransNameArray **names);
 
+struct tevent_req *wb_sids2xids_send(TALLOC_CTX *mem_ctx,
+                                    struct tevent_context *ev,
+                                    const struct dom_sid *sids,
+                                    const uint32_t num_sids);
+NTSTATUS wb_sids2xids_recv(struct tevent_req *req,
+                          struct unixid *xids);
+struct tevent_req *winbindd_sids_to_xids_send(TALLOC_CTX *mem_ctx,
+                                             struct tevent_context *ev,
+                                             struct winbindd_cli_state *cli,
+                                             struct winbindd_request *request);
+NTSTATUS winbindd_sids_to_xids_recv(struct tevent_req *req,
+                                   struct winbindd_response *response);
+struct tevent_req *winbindd_wins_byip_send(TALLOC_CTX *mem_ctx,
+                                          struct tevent_context *ev,
+                                          struct winbindd_cli_state *cli,
+                                          struct winbindd_request *request);
+NTSTATUS winbindd_wins_byip_recv(struct tevent_req *req,
+                                struct winbindd_response *presp);
+struct tevent_req *winbindd_wins_byname_send(TALLOC_CTX *mem_ctx,
+                                            struct tevent_context *ev,
+                                            struct winbindd_cli_state *cli,
+                                            struct winbindd_request *request);
+NTSTATUS winbindd_wins_byname_recv(struct tevent_req *req,
+                                  struct winbindd_response *presp);
+
+
 /* The following definitions come from winbindd/winbindd_samr.c  */
 
 NTSTATUS open_internal_samr_conn(TALLOC_CTX *mem_ctx,