auth/credentials: don't ignore "client use kerberos" and --use-kerberos for machine...
[samba.git] / source3 / winbindd / winbindd_proto.h
index 8ebe19f0f9ee37e1faf2d796eb75a9a03986cc8c..acfbc0543fa34e9d609d4cc4dc525523783d4593 100644 (file)
@@ -34,6 +34,12 @@ bool winbindd_use_cache(void);
 void winbindd_set_use_cache(bool use_cache);
 char *get_winbind_priv_pipe_dir(void);
 void winbindd_flush_caches(void);
+void winbind_debug_call_depth_setup(size_t *depth);
+void winbind_call_flow(void *private_data,
+                      enum tevent_thread_call_depth_cmd cmd,
+                      struct tevent_req *req,
+                      size_t depth,
+                      const char *fname);
 bool winbindd_reload_services_file(const char *lfile);
 
 /* The following definitions come from winbindd/winbindd_ads.c  */
@@ -201,6 +207,13 @@ void winbind_msg_domain_online(struct messaging_context *msg_ctx,
 void set_domain_offline(struct winbindd_domain *domain);
 void set_domain_online_request(struct winbindd_domain *domain);
 
+struct cli_credentials;
+NTSTATUS winbindd_get_trust_credentials(struct winbindd_domain *domain,
+                                       TALLOC_CTX *mem_ctx,
+                                       bool netlogon,
+                                       bool allow_ipc_fallback,
+                                       struct cli_credentials **_creds);
+
 struct ndr_interface_table;
 NTSTATUS wb_open_internal_pipe(TALLOC_CTX *mem_ctx,
                               const struct ndr_interface_table *table,
@@ -359,6 +372,7 @@ void winbindd_msg_reload_services_parent(struct messaging_context *msg,
 NTSTATUS winbindd_reinit_after_fork(const struct winbindd_child *myself,
                                    const char *logfilename);
 struct winbindd_domain *wb_child_domain(void);
+bool add_trusted_domains_dc(void);
 
 /* The following definitions come from winbindd/winbindd_group.c  */
 bool fill_grent(TALLOC_CTX *mem_ctx, struct winbindd_gr *gr,
@@ -377,7 +391,7 @@ struct tevent_req *wb_parent_idmap_setup_send(TALLOC_CTX *mem_ctx,
 NTSTATUS wb_parent_idmap_setup_recv(struct tevent_req *req,
                                    const struct wb_parent_idmap_config **_cfg);
 
-void init_idmap_child(void);
+NTSTATUS init_idmap_child(TALLOC_CTX *mem_ctx);
 struct winbindd_child *idmap_child(void);
 bool is_idmap_child(const struct winbindd_child *child);
 pid_t idmap_child_pid(void);
@@ -398,7 +412,7 @@ bool lp_scan_idmap_domains(bool (*fn)(const char *domname,
 
 /* The following definitions come from winbindd/winbindd_locator.c  */
 
-void init_locator_child(void);
+NTSTATUS init_locator_child(TALLOC_CTX *mem_ctx);
 struct winbindd_child *locator_child(void);
 struct dcerpc_binding_handle *locator_child_handle(void);
 
@@ -510,14 +524,48 @@ struct winbindd_domain *find_our_domain(void);
 struct winbindd_domain *find_default_route_domain(void);
 struct winbindd_domain *find_lookup_domain_from_sid(const struct dom_sid *sid);
 struct winbindd_domain *find_lookup_domain_from_name(const char *domain_name);
-bool parse_domain_user(const char *domuser,
-                      fstring namespace,
-                      fstring domain,
-                      fstring user);
-bool canonicalize_username(fstring username_inout,
-                          fstring namespace,
-                          fstring domain,
-                          fstring user);
+/**
+ * Parse a DOMAIN\user or UPN string into a domain, namespace and a user
+ *
+ * @param[in] ctx talloc context
+ * @param[in] domuser  a DOMAIN\user or UPN string
+ * @param[out] namespace
+ * @param[out] domain
+ * @param[out] user
+ * @return bool indicating success or failure
+ */
+bool parse_domain_user(TALLOC_CTX *ctx,
+                      const char *domuser,
+                      char **namespace,
+                      char **domain,
+                      char **user);
+/**
+ * Ensure an incoming username from NSS is fully qualified. Replace the
+ * incoming username with DOMAIN <separator> user. Additionally returns
+ * the same values as parse_domain_user() as out params.
+ * Used to ensure all names are fully qualified within winbindd.
+ * Used by the NSS protocols of auth, chauthtok, logoff and ccache_ntlm_auth.
+ * The protocol definitions of auth_crap, chng_pswd_auth_crap
+ * really should be changed to use this instead of doing things
+ * by hand. JRA.
+ *
+ * @param[in] mem_ctx talloc context
+ * @param[in,out] username_inout populated with fully qualified name
+                 with format 'DOMAIN <separator> user' where DOMAIN and
+                 user are determined by the output of parse_domain_user()
+ * @param[out] namespace populated with namespace returned from
+               parse_domain_user()
+ * @param[out] domain populated with domain returned from
+               parse_domain_user()
+ * @param[out] populated with user returned from
+               parse_domain_user()
+ * @return bool indicating success or failure
+ */
+bool canonicalize_username(TALLOC_CTX *mem_ctx,
+                          char **username_inout,
+                          char **namespace,
+                          char **domain,
+                          char **user);
 char *fill_domain_username_talloc(TALLOC_CTX *ctx,
                                  const char *domain,
                                  const char *user,
@@ -702,7 +750,7 @@ struct tevent_req *wb_seqnums_send(TALLOC_CTX *mem_ctx,
                                   struct tevent_context *ev);
 NTSTATUS wb_seqnums_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
                         int *num_domains, struct winbindd_domain ***domains,
-                        NTSTATUS **stati, uint32_t **seqnums);
+                        NTSTATUS **statuses, uint32_t **seqnums);
 
 struct tevent_req *winbindd_show_sequence_send(TALLOC_CTX *mem_ctx,
                                               struct tevent_context *ev,
@@ -714,7 +762,8 @@ NTSTATUS winbindd_show_sequence_recv(struct tevent_req *req,
 struct tevent_req *wb_group_members_send(TALLOC_CTX *mem_ctx,
                                         struct tevent_context *ev,
                                         const struct dom_sid *sid,
-                                        enum lsa_SidType type,
+                                        uint32_t num_sids,
+                                        enum lsa_SidType *type,
                                         int max_depth);
 NTSTATUS wb_group_members_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
                               struct db_context **members);