#ifndef _WINBINDD_PROTO_H_
#define _WINBINDD_PROTO_H_
-#include "ads.h"
-
/* The following definitions come from winbindd/winbindd.c */
-struct messaging_context *winbind_messaging_context(void);
struct imessaging_context *winbind_imessaging_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);
char *get_winbind_priv_pipe_dir(void);
-struct tevent_context *winbind_event_context(void);
+void winbindd_flush_caches(void);
+bool winbindd_reload_services_file(const char *lfile);
/* The following definitions come from winbindd/winbindd_ads.c */
NTSTATUS wb_cache_query_user_list(struct winbindd_domain *domain,
TALLOC_CTX *mem_ctx,
- uint32_t *num_entries,
- struct wbint_userinfo **info);
+ uint32_t **prids);
NTSTATUS wb_cache_enum_dom_groups(struct winbindd_domain *domain,
TALLOC_CTX *mem_ctx,
uint32_t *num_entries,
const struct dom_sid *user_sid);
bool wcache_invalidate_cache(void);
bool wcache_invalidate_cache_noinit(void);
-bool init_wcache(void);
bool initialize_winbindd_cache(void);
void close_winbindd_cache(void);
-NTSTATUS wcache_lookup_groupmem(struct winbindd_domain *domain,
- TALLOC_CTX *mem_ctx,
- const struct dom_sid *group_sid,
- uint32_t *num_names,
- struct dom_sid **sid_mem, char ***names,
- uint32_t **name_types);
bool lookup_cached_sid(TALLOC_CTX *mem_ctx, const struct dom_sid *sid,
char **domain_name, char **name,
enum lsa_SidType *type);
-bool lookup_cached_name(const char *domain_name,
+bool lookup_cached_name(const char *namespace,
+ const char *domain_name,
const char *name,
struct dom_sid *sid,
enum lsa_SidType *type);
void cache_name2sid(struct winbindd_domain *domain,
const char *domain_name, const char *name,
enum lsa_SidType type, const struct dom_sid *sid);
-NTSTATUS wcache_name_to_sid(struct winbindd_domain *domain,
- const char *domain_name,
- const char *name,
- struct dom_sid *sid,
- enum lsa_SidType *type);
-NTSTATUS wcache_query_user(struct winbindd_domain *domain,
- TALLOC_CTX *mem_ctx,
- const struct dom_sid *user_sid,
- struct wbint_userinfo *info);
NTSTATUS wcache_query_user_fullname(struct winbindd_domain *domain,
TALLOC_CTX *mem_ctx,
const struct dom_sid *user_sid,
const char **full_name);
-NTSTATUS wcache_lookup_useraliases(struct winbindd_domain *domain,
- TALLOC_CTX *mem_ctx,
- uint32_t num_sids, const struct dom_sid *sids,
- uint32_t *pnum_aliases, uint32_t **paliases);
-NTSTATUS wcache_lookup_usergroups(struct winbindd_domain *domain,
- TALLOC_CTX *mem_ctx,
- const struct dom_sid *user_sid,
- uint32_t *pnum_sids,
- struct dom_sid **psids);
-void wcache_flush_cache(void);
NTSTATUS wcache_count_cached_creds(struct winbindd_domain *domain, int *count);
NTSTATUS wcache_remove_oldest_cached_creds(struct winbindd_domain *domain, const struct dom_sid *sid) ;
bool set_global_winbindd_state_offline(void);
bool wcache_tdc_fetch_list( struct winbindd_tdc_domain **domains, size_t *num_domains );
bool wcache_tdc_add_domain( struct winbindd_domain *domain );
struct winbindd_tdc_domain * wcache_tdc_fetch_domain( TALLOC_CTX *ctx, const char *name );
-struct winbindd_tdc_domain* wcache_tdc_fetch_domainbysid(TALLOC_CTX *ctx, const struct dom_sid *sid);
void wcache_tdc_clear( void );
-#ifdef HAVE_ADS
-struct ads_struct;
-NTSTATUS nss_get_info_cached( struct winbindd_domain *domain,
- const struct dom_sid *user_sid,
- TALLOC_CTX *ctx,
- const char **homedir, const char **shell,
- const char **gecos, gid_t *p_gid);
-#endif
bool wcache_store_seqnum(const char *domain_name, uint32_t seqnum,
time_t last_seq_check);
bool wcache_fetch_ndr(TALLOC_CTX *mem_ctx, struct winbindd_domain *domain,
/* The following definitions come from winbindd/winbindd_ccache_access.c */
-void winbindd_ccache_ntlm_auth(struct winbindd_cli_state *state);
+bool winbindd_ccache_ntlm_auth(struct winbindd_cli_state *state);
enum winbindd_result winbindd_dual_ccache_ntlm_auth(struct winbindd_domain *domain,
struct winbindd_cli_state *state);
-void winbindd_ccache_save(struct winbindd_cli_state *state);
+bool winbindd_ccache_save(struct winbindd_cli_state *state);
/* The following definitions come from winbindd/winbindd_cm.c */
void winbind_msg_domain_offline(struct messaging_context *msg_ctx,
struct policy_handle *lsa_policy);
NTSTATUS cm_connect_netlogon(struct winbindd_domain *domain,
struct rpc_pipe_client **cli);
+NTSTATUS cm_connect_netlogon_secure(struct winbindd_domain *domain,
+ struct rpc_pipe_client **cli,
+ struct netlogon_creds_cli_context **ppdc);
bool fetch_current_dc_from_gencache(TALLOC_CTX *mem_ctx,
const char *domain_name,
char **p_dc_name, char **p_dc_ip);
/* The following definitions come from winbindd/winbindd_dual.c */
struct dcerpc_binding_handle *dom_child_handle(struct winbindd_domain *domain);
-struct winbindd_child *choose_domain_child(struct winbindd_domain *domain);
struct tevent_req *wb_child_request_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
uint32_t msg_type,
struct server_id server_id,
DATA_BLOB *data);
+void winbind_disconnect_dc_parent(struct messaging_context *msg_ctx,
+ void *private_data,
+ uint32_t msg_type,
+ struct server_id server_id,
+ DATA_BLOB *data);
void winbind_msg_offline(struct messaging_context *msg_ctx,
void *private_data,
uint32_t msg_type,
uint32_t msg_type,
struct server_id server_id,
DATA_BLOB *data);
+void winbind_msg_disconnect_dc(struct messaging_context *msg_ctx,
+ void *private_data,
+ uint32_t msg_type,
+ struct server_id server_id,
+ DATA_BLOB *data);
void winbind_msg_ip_dropped_parent(struct messaging_context *msg_ctx,
void *private_data,
uint32_t msg_type,
struct server_id server_id,
DATA_BLOB *data);
+void winbindd_msg_reload_services_parent(struct messaging_context *msg,
+ void *private_data,
+ uint32_t msg_type,
+ struct server_id server_id,
+ DATA_BLOB *data);
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 */
bool fill_grent(TALLOC_CTX *mem_ctx, struct winbindd_gr *gr,
const char *dom_name, const char *gr_name, gid_t unix_gid);
-NTSTATUS winbindd_print_groupmembers(struct talloc_dict *members,
+
+struct db_context;
+NTSTATUS winbindd_print_groupmembers(struct db_context *members,
TALLOC_CTX *mem_ctx,
int *num_members, char **result);
/* The following definitions come from winbindd/winbindd_idmap.c */
+struct tevent_req *wb_parent_idmap_setup_send(TALLOC_CTX *mem_ctx,
+ struct tevent_context *ev);
+NTSTATUS wb_parent_idmap_setup_recv(struct tevent_req *req,
+ const struct wb_parent_idmap_config **_cfg);
+
void init_idmap_child(void);
struct winbindd_child *idmap_child(void);
+bool is_idmap_child(const struct winbindd_child *child);
+pid_t idmap_child_pid(void);
+struct dcerpc_binding_handle *idmap_child_handle(void);
struct idmap_domain *idmap_find_domain_with_sid(const char *domname,
const struct dom_sid *sid);
+const char *idmap_config_const_string(const char *domname, const char *option,
+ const char *def);
+bool idmap_config_bool(const char *domname, const char *option, bool def);
+int idmap_config_int(const char *domname, const char *option, int def);
bool domain_has_idmap_config(const char *domname);
bool lp_scan_idmap_domains(bool (*fn)(const char *domname,
void *private_data),
void init_locator_child(void);
struct winbindd_child *locator_child(void);
+struct dcerpc_binding_handle *locator_child_handle(void);
/* The following definitions come from winbindd/winbindd_misc.c */
-void winbindd_list_trusted_domains(struct winbindd_cli_state *state);
+bool winbindd_list_trusted_domains(struct winbindd_cli_state *state);
enum winbindd_result winbindd_dual_list_trusted_domains(struct winbindd_domain *domain,
struct winbindd_cli_state *state);
-void winbindd_show_sequence(struct winbindd_cli_state *state);
-void winbindd_domain_info(struct winbindd_cli_state *state);
-void winbindd_dc_info(struct winbindd_cli_state *state);
-void winbindd_ping(struct winbindd_cli_state *state);
-void winbindd_info(struct winbindd_cli_state *state);
-void winbindd_interface_version(struct winbindd_cli_state *state);
-void winbindd_domain_name(struct winbindd_cli_state *state);
-void winbindd_netbios_name(struct winbindd_cli_state *state);
-void winbindd_priv_pipe_dir(struct winbindd_cli_state *state);
+bool winbindd_dc_info(struct winbindd_cli_state *state);
+bool winbindd_ping(struct winbindd_cli_state *state);
+bool winbindd_info(struct winbindd_cli_state *state);
+bool winbindd_interface_version(struct winbindd_cli_state *state);
+bool winbindd_domain_name(struct winbindd_cli_state *state);
+bool winbindd_netbios_name(struct winbindd_cli_state *state);
+bool winbindd_priv_pipe_dir(struct winbindd_cli_state *state);
/* The following definitions come from winbindd/winbindd_ndr.c */
struct ndr_print;
NTSTATUS append_auth_data(TALLOC_CTX *mem_ctx,
struct winbindd_response *resp,
uint32_t request_flags,
- struct netr_SamInfo3 *info3,
+ uint16_t validation_level,
+ union netr_Validation *validation,
const char *name_domain,
const char *name_user);
uid_t get_uid_from_request(struct winbindd_request *request);
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);
+NTSTATUS winbindd_pam_auth_pac_verify(struct winbindd_cli_state *state,
+ bool *p_is_trusted,
+ uint16_t *p_validation_level,
+ union netr_Validation **p_validation);
NTSTATUS winbind_dual_SamLogon(struct winbindd_domain *domain,
TALLOC_CTX *mem_ctx,
+ bool interactive,
uint32_t logon_parameters,
const char *name_user,
const char *name_domain,
const char *workstation,
+ const uint64_t logon_id,
+ const char *client_name,
+ const int pid,
const uint8_t chal[8],
DATA_BLOB lm_response,
DATA_BLOB nt_response,
- struct netr_SamInfo3 **info3);
+ const struct tsocket_address *remote,
+ const struct tsocket_address *local,
+ uint8_t *authoritative,
+ bool skip_sam,
+ uint32_t *flags,
+ uint16_t *_validation_level,
+ union netr_Validation **_validation);
/* The following definitions come from winbindd/winbindd_util.c */
struct winbindd_domain *domain_list(void);
struct winbindd_domain *wb_next_domain(struct winbindd_domain *domain);
+bool set_routing_domain(struct winbindd_domain *domain,
+ struct winbindd_domain *routing_domain);
+bool add_trusted_domain_from_auth(uint16_t validation_level,
+ struct info3_text *info3,
+ struct info6_text *info6);
bool domain_is_forest_root(const struct winbindd_domain *domain);
void rescan_trusted_domains(struct tevent_context *ev, struct tevent_timer *te,
struct timeval now, void *private_data);
struct winbindd_cli_state *state);
bool init_domain_list(void);
struct winbindd_domain *find_domain_from_name_noinit(const char *domain_name);
+struct winbindd_domain *find_trust_from_name_noinit(const char *domain_name);
struct winbindd_domain *find_domain_from_name(const char *domain_name);
struct winbindd_domain *find_domain_from_sid_noinit(const struct dom_sid *sid);
+struct winbindd_domain *find_trust_from_sid_noinit(const struct dom_sid *sid);
struct winbindd_domain *find_domain_from_sid(const struct dom_sid *sid);
struct winbindd_domain *find_our_domain(void);
-struct winbindd_domain *find_root_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 domain, fstring user);
-bool parse_domain_user_talloc(TALLOC_CTX *mem_ctx, const char *domuser,
- char **domain, char **user);
-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);
+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);
char *fill_domain_username_talloc(TALLOC_CTX *ctx,
const char *domain,
const char *user,
uint32_t *p_num_groups, struct dom_sid **user_sids);
NTSTATUS normalize_name_map(TALLOC_CTX *mem_ctx,
- struct winbindd_domain *domain,
+ const char *domain_name,
const char *name,
char **normalized);
NTSTATUS normalize_name_unmap(TALLOC_CTX *mem_ctx,
const char *alias, char **name);
bool winbindd_can_contact_domain(struct winbindd_domain *domain);
-bool winbindd_internal_child(struct winbindd_child *child);
void winbindd_set_locator_kdc_envs(const struct winbindd_domain *domain);
void winbindd_unset_locator_kdc_env(const struct winbindd_domain *domain);
void winbindd_set_locator_kdc_envs(const struct winbindd_domain *domain);
void winbindd_wins_byname(struct winbindd_cli_state *state);
-struct tevent_req *wb_ping_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
- struct winbindd_cli_state *cli,
- struct winbindd_request *request);
-NTSTATUS wb_ping_recv(struct tevent_req *req,
- struct winbindd_response *resp);
-
enum winbindd_result winbindd_dual_ping(struct winbindd_domain *domain,
struct winbindd_cli_state *state);
struct tevent_req *wb_lookupname_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
- const char *dom_name, const char *name,
+ const char *namespace,
+ const char *dom_name,
+ const char *name,
uint32_t flags);
NTSTATUS wb_lookupname_recv(struct tevent_req *req, struct dom_sid *sid,
enum lsa_SidType *type);
NTSTATUS winbindd_lookupname_recv(struct tevent_req *req,
struct winbindd_response *response);
-struct tevent_req *winbindd_sid_to_uid_send(TALLOC_CTX *mem_ctx,
- struct tevent_context *ev,
- struct winbindd_cli_state *cli,
- struct winbindd_request *request);
-NTSTATUS winbindd_sid_to_uid_recv(struct tevent_req *req,
- struct winbindd_response *response);
-
-struct tevent_req *winbindd_sid_to_gid_send(TALLOC_CTX *mem_ctx,
- struct tevent_context *ev,
- struct winbindd_cli_state *cli,
- struct winbindd_request *request);
-NTSTATUS winbindd_sid_to_gid_recv(struct tevent_req *req,
- struct winbindd_response *response);
-
-struct tevent_req *winbindd_uid_to_sid_send(TALLOC_CTX *mem_ctx,
- struct tevent_context *ev,
- struct winbindd_cli_state *cli,
- struct winbindd_request *request);
-NTSTATUS winbindd_uid_to_sid_recv(struct tevent_req *req,
- struct winbindd_response *response);
-
-struct tevent_req *winbindd_gid_to_sid_send(TALLOC_CTX *mem_ctx,
- struct tevent_context *ev,
- struct winbindd_cli_state *cli,
- struct winbindd_request *request);
-NTSTATUS winbindd_gid_to_sid_recv(struct tevent_req *req,
- struct winbindd_response *response);
-
struct tevent_req *winbindd_allocate_uid_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
struct winbindd_cli_state *cli,
struct winbindd_request *request);
NTSTATUS winbindd_getsidaliases_recv(struct tevent_req *req,
struct winbindd_response *response);
+struct tevent_req *wb_lookupusergroups_send(TALLOC_CTX *mem_ctx,
+ struct tevent_context *ev,
+ const struct dom_sid *sid);
+NTSTATUS wb_lookupusergroups_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
+ int *num_sids, struct dom_sid **sids);
struct tevent_req *winbindd_getuserdomgroups_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
enum lsa_SidType type,
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 db_context **members);
+NTSTATUS add_member_to_db(struct db_context *db, struct dom_sid *sid,
+ const char *name);
struct tevent_req *wb_getgrsid_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
int max_nesting);
NTSTATUS wb_getgrsid_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
const char **domname, const char **name, gid_t *gid,
- struct talloc_dict **members);
+ struct db_context **members);
struct tevent_req *winbindd_getgrgid_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
struct tevent_context *ev,
struct winbindd_domain *domain);
NTSTATUS wb_query_user_list_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
- int *num_users,
- struct wbint_userinfo **users);
+ char **users);
struct tevent_req *wb_query_group_list_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
struct getgrent_state *gstate,
struct winbindd_gr *gr);
NTSTATUS wb_next_grent_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
- struct talloc_dict **members);
+ struct db_context **members);
struct tevent_req *winbindd_setgrent_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
struct winbindd_response *response);
struct tevent_req *wb_xids2sids_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
- struct unixid *xids,
+ const struct unixid *xids,
uint32_t num_xids);
NTSTATUS wb_xids2sids_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
struct dom_sid **sids);
struct winbindd_request *request);
NTSTATUS winbindd_wins_byname_recv(struct tevent_req *req,
struct winbindd_response *presp);
-
+struct tevent_req *winbindd_domain_info_send(
+ TALLOC_CTX *mem_ctx,
+ struct tevent_context *ev,
+ struct winbindd_cli_state *cli,
+ struct winbindd_request *request);
+NTSTATUS winbindd_domain_info_recv(struct tevent_req *req,
+ struct winbindd_response *response);
/* The following definitions come from winbindd/winbindd_samr.c */
struct rpc_pipe_client **lsa_pipe,
struct policy_handle *lsa_hnd);
-/* The following definitions come from winbindd/winbindd_ads.c */
-ADS_STATUS ads_idmap_cached_connection(ADS_STRUCT **adsp, const char *dom_name);
-
/* The following definitions come from winbindd/winbindd_irpc.c */
NTSTATUS wb_irpc_register(void);
/* The following definitions come from winbindd/winbindd_reconnect.c */
bool reconnect_need_retry(NTSTATUS status, struct winbindd_domain *domain);
+/* The following definitions come from winbindd/winbindd_gpupdate.c */
+void gpupdate_init(void);
+
+/* The following comes from winbindd/winbindd_dual_srv.c */
+bool reset_cm_connection_on_error(struct winbindd_domain *domain,
+ struct dcerpc_binding_handle *b,
+ NTSTATUS status);
+
#endif /* _WINBINDD_PROTO_H_ */