2 * Unix SMB/CIFS implementation.
3 * collected prototypes header
5 * frozen from "make proto" in May 2008
7 * Copyright (C) Michael Adam 2008
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 3 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, see <http://www.gnu.org/licenses/>.
23 #ifndef _WINBINDD_PROTO_H_
24 #define _WINBINDD_PROTO_H_
26 /* The following definitions come from winbindd/winbindd.c */
27 struct imessaging_context
*winbind_imessaging_context(void);
28 void winbindd_terminate(bool is_parent
);
29 bool winbindd_setup_sig_term_handler(bool parent
);
30 bool winbindd_setup_stdin_handler(bool parent
, bool foreground
);
31 bool winbindd_setup_sig_hup_handler(const char *lfile
);
32 bool winbindd_use_idmap_cache(void);
33 bool winbindd_use_cache(void);
34 void winbindd_set_use_cache(bool use_cache
);
35 char *get_winbind_priv_pipe_dir(void);
36 void winbindd_flush_caches(void);
37 void winbind_debug_call_depth_setup(size_t *depth
);
38 void winbind_call_flow(void *private_data
,
39 enum tevent_thread_call_depth_cmd cmd
,
40 struct tevent_req
*req
,
43 bool winbindd_reload_services_file(const char *lfile
);
45 /* The following definitions come from winbindd/winbindd_ads.c */
47 /* The following definitions come from winbindd/winbindd_rpc.c */
49 NTSTATUS
winbindd_lookup_sids(TALLOC_CTX
*mem_ctx
,
50 struct winbindd_domain
*domain
,
52 const struct dom_sid
*sids
,
55 enum lsa_SidType
**types
);
56 NTSTATUS
rpc_lookup_sids(TALLOC_CTX
*mem_ctx
,
57 struct winbindd_domain
*domain
,
58 struct lsa_SidArray
*sids
,
59 struct lsa_RefDomainList
**pdomains
,
60 struct lsa_TransNameArray
**pnames
);
62 /* The following definitions come from winbindd/winbindd_cache.c */
64 NTSTATUS
wb_cache_query_user_list(struct winbindd_domain
*domain
,
67 NTSTATUS
wb_cache_enum_dom_groups(struct winbindd_domain
*domain
,
69 uint32_t *num_entries
,
70 struct wb_acct_info
**info
);
71 NTSTATUS
wb_cache_enum_local_groups(struct winbindd_domain
*domain
,
73 uint32_t *num_entries
,
74 struct wb_acct_info
**info
);
75 NTSTATUS
wb_cache_name_to_sid(struct winbindd_domain
*domain
,
77 const char *domain_name
,
81 enum lsa_SidType
*type
);
82 NTSTATUS
wb_cache_sid_to_name(struct winbindd_domain
*domain
,
84 const struct dom_sid
*sid
,
87 enum lsa_SidType
*type
);
88 NTSTATUS
wb_cache_rids_to_names(struct winbindd_domain
*domain
,
90 const struct dom_sid
*domain_sid
,
95 enum lsa_SidType
**types
);
96 NTSTATUS
wb_cache_lookup_usergroups(struct winbindd_domain
*domain
,
98 const struct dom_sid
*user_sid
,
100 struct dom_sid
**psids
);
101 NTSTATUS
wb_cache_lookup_useraliases(struct winbindd_domain
*domain
,
104 const struct dom_sid
*sids
,
105 uint32_t *num_aliases
,
106 uint32_t **alias_rids
);
107 NTSTATUS
wb_cache_lookup_groupmem(struct winbindd_domain
*domain
,
109 const struct dom_sid
*group_sid
,
110 enum lsa_SidType type
,
112 struct dom_sid
**sid_mem
,
114 uint32_t **name_types
);
115 NTSTATUS
wb_cache_lookup_aliasmem(struct winbindd_domain
*domain
,
117 const struct dom_sid
*group_sid
,
118 enum lsa_SidType type
,
120 struct dom_sid
**sid_mem
);
121 NTSTATUS
wb_cache_sequence_number(struct winbindd_domain
*domain
,
123 NTSTATUS
wb_cache_lockout_policy(struct winbindd_domain
*domain
,
125 struct samr_DomInfo12
*policy
);
126 NTSTATUS
wb_cache_password_policy(struct winbindd_domain
*domain
,
128 struct samr_DomInfo1
*policy
);
129 NTSTATUS
wb_cache_trusted_domains(struct winbindd_domain
*domain
,
131 struct netr_DomainTrustList
*trusts
);
133 NTSTATUS
wcache_cached_creds_exist(struct winbindd_domain
*domain
, const struct dom_sid
*sid
);
134 NTSTATUS
wcache_get_creds(struct winbindd_domain
*domain
,
136 const struct dom_sid
*sid
,
137 const uint8_t **cached_nt_pass
,
138 const uint8_t **cached_salt
);
139 NTSTATUS
wcache_save_creds(struct winbindd_domain
*domain
,
140 const struct dom_sid
*sid
,
141 const uint8_t nt_pass
[NT_HASH_LEN
]);
142 void wcache_invalidate_samlogon(struct winbindd_domain
*domain
,
143 const struct dom_sid
*user_sid
);
144 bool wcache_invalidate_cache(void);
145 bool wcache_invalidate_cache_noinit(void);
146 bool initialize_winbindd_cache(void);
147 void close_winbindd_cache(void);
148 bool lookup_cached_sid(TALLOC_CTX
*mem_ctx
, const struct dom_sid
*sid
,
149 char **domain_name
, char **name
,
150 enum lsa_SidType
*type
);
151 bool lookup_cached_name(const char *namespace,
152 const char *domain_name
,
155 enum lsa_SidType
*type
);
156 void cache_name2sid_trusted(struct winbindd_domain
*domain
,
157 const char *domain_name
,
159 enum lsa_SidType type
,
160 const struct dom_sid
*sid
);
161 void cache_name2sid(struct winbindd_domain
*domain
,
162 const char *domain_name
, const char *name
,
163 enum lsa_SidType type
, const struct dom_sid
*sid
);
164 NTSTATUS
wcache_query_user_fullname(struct winbindd_domain
*domain
,
166 const struct dom_sid
*user_sid
,
167 const char **full_name
);
169 NTSTATUS
wcache_count_cached_creds(struct winbindd_domain
*domain
, int *count
);
170 NTSTATUS
wcache_remove_oldest_cached_creds(struct winbindd_domain
*domain
, const struct dom_sid
*sid
) ;
171 bool set_global_winbindd_state_offline(void);
172 void set_global_winbindd_state_online(void);
173 bool get_global_winbindd_state_offline(void);
174 int winbindd_validate_cache(void);
175 int winbindd_validate_cache_nobackup(void);
176 bool winbindd_cache_validate_and_initialize(void);
177 bool wcache_tdc_fetch_list( struct winbindd_tdc_domain
**domains
, size_t *num_domains
);
178 bool wcache_tdc_add_domain( struct winbindd_domain
*domain
);
179 struct winbindd_tdc_domain
* wcache_tdc_fetch_domain( TALLOC_CTX
*ctx
, const char *name
);
180 void wcache_tdc_clear( void );
181 bool wcache_store_seqnum(const char *domain_name
, uint32_t seqnum
,
182 time_t last_seq_check
);
183 bool wcache_fetch_ndr(TALLOC_CTX
*mem_ctx
, struct winbindd_domain
*domain
,
184 uint32_t opnum
, const DATA_BLOB
*req
, DATA_BLOB
*resp
);
185 void wcache_store_ndr(struct winbindd_domain
*domain
, uint32_t opnum
,
186 const DATA_BLOB
*req
, const DATA_BLOB
*resp
);
188 /* The following definitions come from winbindd/winbindd_ccache_access.c */
190 bool winbindd_ccache_ntlm_auth(struct winbindd_cli_state
*state
);
191 enum winbindd_result
winbindd_dual_ccache_ntlm_auth(struct winbindd_domain
*domain
,
192 struct winbindd_cli_state
*state
);
193 bool winbindd_ccache_save(struct winbindd_cli_state
*state
);
195 /* The following definitions come from winbindd/winbindd_cm.c */
196 void winbind_msg_domain_offline(struct messaging_context
*msg_ctx
,
199 struct server_id server_id
,
201 void winbind_msg_domain_online(struct messaging_context
*msg_ctx
,
204 struct server_id server_id
,
207 void set_domain_offline(struct winbindd_domain
*domain
);
208 void set_domain_online_request(struct winbindd_domain
*domain
);
210 struct cli_credentials
;
211 NTSTATUS
winbindd_get_trust_credentials(struct winbindd_domain
*domain
,
214 bool allow_ipc_fallback
,
215 struct cli_credentials
**_creds
);
217 struct ndr_interface_table
;
218 NTSTATUS
wb_open_internal_pipe(TALLOC_CTX
*mem_ctx
,
219 const struct ndr_interface_table
*table
,
220 struct rpc_pipe_client
**ret_pipe
);
221 void invalidate_cm_connection(struct winbindd_domain
*domain
);
222 void close_conns_after_fork(void);
223 NTSTATUS
init_dc_connection(struct winbindd_domain
*domain
, bool need_rw_dc
);
224 NTSTATUS
cm_connect_sam(struct winbindd_domain
*domain
, TALLOC_CTX
*mem_ctx
,
226 struct rpc_pipe_client
**cli
, struct policy_handle
*sam_handle
);
227 NTSTATUS
cm_connect_lsa(struct winbindd_domain
*domain
, TALLOC_CTX
*mem_ctx
,
228 struct rpc_pipe_client
**cli
, struct policy_handle
*lsa_policy
);
229 NTSTATUS
cm_connect_lsat(struct winbindd_domain
*domain
,
231 struct rpc_pipe_client
**cli
,
232 struct policy_handle
*lsa_policy
);
233 NTSTATUS
cm_connect_netlogon(struct winbindd_domain
*domain
,
234 struct rpc_pipe_client
**cli
);
235 NTSTATUS
cm_connect_netlogon_secure(struct winbindd_domain
*domain
,
236 struct rpc_pipe_client
**cli
,
237 struct netlogon_creds_cli_context
**ppdc
);
238 bool fetch_current_dc_from_gencache(TALLOC_CTX
*mem_ctx
,
239 const char *domain_name
,
240 char **p_dc_name
, char **p_dc_ip
);
242 /* The following definitions come from winbindd/winbindd_cred_cache.c */
244 bool ccache_entry_exists(const char *username
);
245 bool ccache_entry_identical(const char *username
,
248 void ccache_remove_all_after_fork(void);
249 void ccache_regain_all_now(void);
250 NTSTATUS
add_ccache_to_list(const char *princ_name
,
252 const char *username
,
253 const char *password
,
259 bool postponed_request
,
260 const char *canon_principal
,
261 const char *canon_realm
);
262 NTSTATUS
remove_ccache(const char *username
);
263 struct WINBINDD_MEMORY_CREDS
*find_memory_creds_by_name(const char *username
);
264 NTSTATUS
winbindd_add_memory_creds(const char *username
,
267 NTSTATUS
winbindd_delete_memory_creds(const char *username
);
268 NTSTATUS
winbindd_replace_memory_creds(const char *username
,
271 /* The following definitions come from winbindd/winbindd_creds.c */
273 NTSTATUS
winbindd_get_creds(struct winbindd_domain
*domain
,
275 const struct dom_sid
*sid
,
276 struct netr_SamInfo3
**info3
,
277 const uint8_t **cached_nt_pass
,
278 const uint8_t **cred_salt
);
279 NTSTATUS
winbindd_store_creds(struct winbindd_domain
*domain
,
282 struct netr_SamInfo3
*info3
);
283 NTSTATUS
winbindd_update_creds_by_info3(struct winbindd_domain
*domain
,
286 struct netr_SamInfo3
*info3
);
287 NTSTATUS
winbindd_update_creds_by_name(struct winbindd_domain
*domain
,
291 /* The following definitions come from winbindd/winbindd_domain.c */
293 void setup_domain_child(struct winbindd_domain
*domain
);
295 /* The following definitions come from winbindd/winbindd_dual.c */
297 struct dcerpc_binding_handle
*dom_child_handle(struct winbindd_domain
*domain
);
299 struct tevent_req
*wb_child_request_send(TALLOC_CTX
*mem_ctx
,
300 struct tevent_context
*ev
,
301 struct winbindd_child
*child
,
302 struct winbindd_request
*request
);
303 int wb_child_request_recv(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
,
304 struct winbindd_response
**presponse
, int *err
);
305 struct tevent_req
*wb_domain_request_send(TALLOC_CTX
*mem_ctx
,
306 struct tevent_context
*ev
,
307 struct winbindd_domain
*domain
,
308 struct winbindd_request
*request
);
309 int wb_domain_request_recv(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
,
310 struct winbindd_response
**presponse
, int *err
);
312 void setup_child(struct winbindd_domain
*domain
, struct winbindd_child
*child
,
313 const char *logprefix
,
314 const char *logname
);
315 void winbind_child_died(pid_t pid
);
316 void winbindd_flush_negative_conn_cache(struct winbindd_domain
*domain
);
317 void winbind_msg_debug(struct messaging_context
*msg_ctx
,
320 struct server_id server_id
,
322 void winbind_disconnect_dc_parent(struct messaging_context
*msg_ctx
,
325 struct server_id server_id
,
327 void winbind_msg_offline(struct messaging_context
*msg_ctx
,
330 struct server_id server_id
,
332 void winbind_msg_online(struct messaging_context
*msg_ctx
,
335 struct server_id server_id
,
337 void winbind_msg_onlinestatus(struct messaging_context
*msg_ctx
,
340 struct server_id server_id
,
342 void winbind_msg_dump_event_list(struct messaging_context
*msg_ctx
,
345 struct server_id server_id
,
347 void winbind_msg_dump_domain_list(struct messaging_context
*msg_ctx
,
350 struct server_id server_id
,
352 void winbind_msg_ip_dropped(struct messaging_context
*msg_ctx
,
355 struct server_id server_id
,
357 void winbind_msg_disconnect_dc(struct messaging_context
*msg_ctx
,
360 struct server_id server_id
,
362 void winbind_msg_ip_dropped_parent(struct messaging_context
*msg_ctx
,
365 struct server_id server_id
,
367 void winbindd_msg_reload_services_parent(struct messaging_context
*msg
,
370 struct server_id server_id
,
372 NTSTATUS
winbindd_reinit_after_fork(const struct winbindd_child
*myself
,
373 const char *logfilename
);
374 struct winbindd_domain
*wb_child_domain(void);
375 bool add_trusted_domains_dc(void);
377 /* The following definitions come from winbindd/winbindd_group.c */
378 bool fill_grent(TALLOC_CTX
*mem_ctx
, struct winbindd_gr
*gr
,
379 const char *dom_name
, const char *gr_name
, gid_t unix_gid
);
382 NTSTATUS
winbindd_print_groupmembers(struct db_context
*members
,
384 int *num_members
, char **result
);
387 /* The following definitions come from winbindd/winbindd_idmap.c */
389 struct tevent_req
*wb_parent_idmap_setup_send(TALLOC_CTX
*mem_ctx
,
390 struct tevent_context
*ev
);
391 NTSTATUS
wb_parent_idmap_setup_recv(struct tevent_req
*req
,
392 const struct wb_parent_idmap_config
**_cfg
);
394 NTSTATUS
init_idmap_child(TALLOC_CTX
*mem_ctx
);
395 struct winbindd_child
*idmap_child(void);
396 bool is_idmap_child(const struct winbindd_child
*child
);
397 pid_t
idmap_child_pid(void);
398 struct dcerpc_binding_handle
*idmap_child_handle(void);
399 struct idmap_domain
*idmap_find_domain_with_sid(const char *domname
,
400 const struct dom_sid
*sid
);
401 const char *idmap_config_const_string(const char *domname
, const char *option
,
403 bool idmap_config_bool(const char *domname
, const char *option
, bool def
);
404 int idmap_config_int(const char *domname
, const char *option
, int def
);
405 const char **idmap_config_string_list(const char *domname
,
408 bool domain_has_idmap_config(const char *domname
);
409 bool lp_scan_idmap_domains(bool (*fn
)(const char *domname
,
413 /* The following definitions come from winbindd/winbindd_locator.c */
415 NTSTATUS
init_locator_child(TALLOC_CTX
*mem_ctx
);
416 struct winbindd_child
*locator_child(void);
417 struct dcerpc_binding_handle
*locator_child_handle(void);
419 /* The following definitions come from winbindd/winbindd_misc.c */
421 bool winbindd_list_trusted_domains(struct winbindd_cli_state
*state
);
422 bool winbindd_dc_info(struct winbindd_cli_state
*state
);
423 bool winbindd_ping(struct winbindd_cli_state
*state
);
424 bool winbindd_info(struct winbindd_cli_state
*state
);
425 bool winbindd_interface_version(struct winbindd_cli_state
*state
);
426 bool winbindd_domain_name(struct winbindd_cli_state
*state
);
427 bool winbindd_netbios_name(struct winbindd_cli_state
*state
);
428 bool winbindd_priv_pipe_dir(struct winbindd_cli_state
*state
);
430 /* The following definitions come from winbindd/winbindd_ndr.c */
432 void ndr_print_winbindd_child(struct ndr_print
*ndr
,
434 const struct winbindd_child
*r
);
435 void ndr_print_winbindd_cm_conn(struct ndr_print
*ndr
,
437 const struct winbindd_cm_conn
*r
);
438 void ndr_print_winbindd_methods(struct ndr_print
*ndr
,
440 const struct winbindd_methods
*r
);
441 void ndr_print_winbindd_domain(struct ndr_print
*ndr
,
443 const struct winbindd_domain
*r
);
445 /* The following definitions come from winbindd/winbindd_pam.c */
447 bool check_request_flags(uint32_t flags
);
448 NTSTATUS
append_auth_data(TALLOC_CTX
*mem_ctx
,
449 struct winbindd_response
*resp
,
450 uint32_t request_flags
,
451 uint16_t validation_level
,
452 union netr_Validation
*validation
,
453 const char *name_domain
,
454 const char *name_user
);
455 NTSTATUS
extra_data_to_sid_array(const char *group_sid
,
457 struct wbint_SidArray
**_sid_array
);
458 uid_t
get_uid_from_request(struct winbindd_request
*request
);
459 struct winbindd_domain
*find_auth_domain(uint8_t flags
,
460 const char *domain_name
);
462 struct wbint_PamAuth
;
463 NTSTATUS
_wbint_PamAuth(struct pipes_struct
*p
,
464 struct wbint_PamAuth
*r
);
465 NTSTATUS
_wbint_PamAuthCrap(struct pipes_struct
*p
,
466 struct wbint_PamAuthCrap
*r
);
467 NTSTATUS
_wbint_PamAuthChangePassword(struct pipes_struct
*p
,
468 struct wbint_PamAuthChangePassword
*r
);
469 NTSTATUS
_wbint_PamLogOff(struct pipes_struct
*p
,
470 struct wbint_PamLogOff
*r
);
471 NTSTATUS
_wbint_PamAuthCrapChangePassword(struct pipes_struct
*p
,
472 struct wbint_PamAuthCrapChangePassword
*r
);
473 NTSTATUS
winbindd_pam_auth_pac_verify(struct winbindd_cli_state
*state
,
476 uint16_t *p_validation_level
,
477 union netr_Validation
**p_validation
);
479 NTSTATUS
winbind_dual_SamLogon(struct winbindd_domain
*domain
,
482 uint32_t logon_parameters
,
483 const char *name_user
,
484 const char *name_domain
,
485 const char *workstation
,
486 const uint64_t logon_id
,
487 const char *client_name
,
490 DATA_BLOB lm_response
,
491 DATA_BLOB nt_response
,
492 const struct tsocket_address
*remote
,
493 const struct tsocket_address
*local
,
494 uint8_t *authoritative
,
497 uint16_t *_validation_level
,
498 union netr_Validation
**_validation
);
500 /* The following definitions come from winbindd/winbindd_util.c */
502 struct winbindd_domain
*domain_list(void);
503 struct winbindd_domain
*wb_next_domain(struct winbindd_domain
*domain
);
504 bool set_routing_domain(struct winbindd_domain
*domain
,
505 struct winbindd_domain
*routing_domain
);
506 bool add_trusted_domain_from_auth(uint16_t validation_level
,
507 struct info3_text
*info3
,
508 struct info6_text
*info6
);
509 bool domain_is_forest_root(const struct winbindd_domain
*domain
);
510 void rescan_trusted_domains(struct tevent_context
*ev
, struct tevent_timer
*te
,
511 struct timeval now
, void *private_data
);
512 void winbindd_ping_offline_domains(struct tevent_context
*ev
,
513 struct tevent_timer
*te
,
516 bool init_domain_list(void);
517 struct winbindd_domain
*find_domain_from_name_noinit(const char *domain_name
);
518 struct winbindd_domain
*find_trust_from_name_noinit(const char *domain_name
);
519 struct winbindd_domain
*find_domain_from_name(const char *domain_name
);
520 struct winbindd_domain
*find_domain_from_sid_noinit(const struct dom_sid
*sid
);
521 struct winbindd_domain
*find_trust_from_sid_noinit(const struct dom_sid
*sid
);
522 struct winbindd_domain
*find_domain_from_sid(const struct dom_sid
*sid
);
523 struct winbindd_domain
*find_our_domain(void);
524 struct winbindd_domain
*find_default_route_domain(void);
525 struct winbindd_domain
*find_lookup_domain_from_sid(const struct dom_sid
*sid
);
526 struct winbindd_domain
*find_lookup_domain_from_name(const char *domain_name
);
528 * Parse a DOMAIN\user or UPN string into a domain, namespace and a user
530 * @param[in] ctx talloc context
531 * @param[in] domuser a DOMAIN\user or UPN string
532 * @param[out] namespace
535 * @return bool indicating success or failure
537 bool parse_domain_user(TALLOC_CTX
*ctx
,
543 * Ensure an incoming username from NSS is fully qualified. Replace the
544 * incoming username with DOMAIN <separator> user. Additionally returns
545 * the same values as parse_domain_user() as out params.
546 * Used to ensure all names are fully qualified within winbindd.
547 * Used by the NSS protocols of auth, chauthtok, logoff and ccache_ntlm_auth.
548 * The protocol definitions of auth_crap, chng_pswd_auth_crap
549 * really should be changed to use this instead of doing things
552 * @param[in] mem_ctx talloc context
553 * @param[in,out] username_inout populated with fully qualified name
554 with format 'DOMAIN <separator> user' where DOMAIN and
555 user are determined by the output of parse_domain_user()
556 * @param[out] namespace populated with namespace returned from
558 * @param[out] domain populated with domain returned from
560 * @param[out] populated with user returned from
562 * @return bool indicating success or failure
564 bool canonicalize_username(TALLOC_CTX
*mem_ctx
,
565 char **username_inout
,
569 char *fill_domain_username_talloc(TALLOC_CTX
*ctx
,
573 struct winbindd_cli_state
*winbindd_client_list(void);
574 struct winbindd_cli_state
*winbindd_client_list_tail(void);
575 struct winbindd_cli_state
*
576 winbindd_client_list_prev(struct winbindd_cli_state
*cli
);
577 void winbindd_add_client(struct winbindd_cli_state
*cli
);
578 void winbindd_remove_client(struct winbindd_cli_state
*cli
);
579 void winbindd_promote_client(struct winbindd_cli_state
*cli
);
580 int winbindd_num_clients(void);
581 NTSTATUS
lookup_usergroups_cached(TALLOC_CTX
*mem_ctx
,
582 const struct dom_sid
*user_sid
,
583 uint32_t *p_num_groups
, struct dom_sid
**user_sids
);
585 NTSTATUS
normalize_name_map(TALLOC_CTX
*mem_ctx
,
586 const char *domain_name
,
589 NTSTATUS
normalize_name_unmap(TALLOC_CTX
*mem_ctx
,
593 NTSTATUS
resolve_username_to_alias(TALLOC_CTX
*mem_ctx
,
594 struct winbindd_domain
*domain
,
595 const char *name
, char **alias
);
596 NTSTATUS
resolve_alias_to_username(TALLOC_CTX
*mem_ctx
,
597 struct winbindd_domain
*domain
,
598 const char *alias
, char **name
);
600 bool winbindd_can_contact_domain(struct winbindd_domain
*domain
);
601 void winbindd_set_locator_kdc_envs(const struct winbindd_domain
*domain
);
602 void winbindd_unset_locator_kdc_env(const struct winbindd_domain
*domain
);
603 void winbindd_set_locator_kdc_envs(const struct winbindd_domain
*domain
);
604 void winbindd_unset_locator_kdc_env(const struct winbindd_domain
*domain
);
605 void set_auth_errors(struct winbindd_response
*resp
, NTSTATUS result
);
606 bool is_domain_offline(const struct winbindd_domain
*domain
);
607 bool is_domain_online(const struct winbindd_domain
*domain
);
608 bool parse_sidlist(TALLOC_CTX
*mem_ctx
, const char *sidstr
,
609 struct dom_sid
**sids
, uint32_t *num_sids
);
610 bool parse_xidlist(TALLOC_CTX
*mem_ctx
, const char *xidstr
,
611 struct unixid
**pxids
, uint32_t *pnum_xids
);
613 /* The following definitions come from winbindd/winbindd_wins.c */
615 void winbindd_wins_byname(struct winbindd_cli_state
*state
);
617 struct dcerpc_binding_handle
*wbint_binding_handle(TALLOC_CTX
*mem_ctx
,
618 struct winbindd_domain
*domain
,
619 struct winbindd_child
*child
);
620 enum winbindd_result
winbindd_dual_ndrcmd(struct winbindd_domain
*domain
,
621 struct winbindd_cli_state
*state
);
623 struct tevent_req
*wb_lookupsid_send(TALLOC_CTX
*mem_ctx
,
624 struct tevent_context
*ev
,
625 const struct dom_sid
*sid
);
626 NTSTATUS
wb_lookupsid_recv(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
,
627 enum lsa_SidType
*type
, const char **domain
,
630 struct tevent_req
*winbindd_lookupsid_send(TALLOC_CTX
*mem_ctx
,
631 struct tevent_context
*ev
,
632 struct winbindd_cli_state
*cli
,
633 struct winbindd_request
*request
);
634 NTSTATUS
winbindd_lookupsid_recv(struct tevent_req
*req
,
635 struct winbindd_response
*response
);
637 struct tevent_req
*winbindd_lookupsids_send(TALLOC_CTX
*mem_ctx
,
638 struct tevent_context
*ev
,
639 struct winbindd_cli_state
*cli
,
640 struct winbindd_request
*request
);
641 NTSTATUS
winbindd_lookupsids_recv(struct tevent_req
*req
,
642 struct winbindd_response
*response
);
644 struct tevent_req
*wb_lookupname_send(TALLOC_CTX
*mem_ctx
,
645 struct tevent_context
*ev
,
646 const char *namespace,
647 const char *dom_name
,
650 NTSTATUS
wb_lookupname_recv(struct tevent_req
*req
, struct dom_sid
*sid
,
651 enum lsa_SidType
*type
);
653 struct tevent_req
*winbindd_lookupname_send(TALLOC_CTX
*mem_ctx
,
654 struct tevent_context
*ev
,
655 struct winbindd_cli_state
*cli
,
656 struct winbindd_request
*request
);
657 NTSTATUS
winbindd_lookupname_recv(struct tevent_req
*req
,
658 struct winbindd_response
*response
);
660 struct tevent_req
*winbindd_allocate_uid_send(TALLOC_CTX
*mem_ctx
,
661 struct tevent_context
*ev
,
662 struct winbindd_cli_state
*cli
,
663 struct winbindd_request
*request
);
664 NTSTATUS
winbindd_allocate_uid_recv(struct tevent_req
*req
,
665 struct winbindd_response
*response
);
667 struct tevent_req
*winbindd_allocate_gid_send(TALLOC_CTX
*mem_ctx
,
668 struct tevent_context
*ev
,
669 struct winbindd_cli_state
*cli
,
670 struct winbindd_request
*request
);
671 NTSTATUS
winbindd_allocate_gid_recv(struct tevent_req
*req
,
672 struct winbindd_response
*response
);
674 struct tevent_req
*wb_queryuser_send(TALLOC_CTX
*mem_ctx
,
675 struct tevent_context
*ev
,
676 const struct dom_sid
*user_sid
);
677 NTSTATUS
wb_queryuser_recv(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
,
678 struct wbint_userinfo
**pinfo
);
680 struct tevent_req
*wb_getpwsid_send(TALLOC_CTX
*mem_ctx
,
681 struct tevent_context
*ev
,
682 const struct dom_sid
*user_sid
,
683 struct winbindd_pw
*pw
);
684 NTSTATUS
wb_getpwsid_recv(struct tevent_req
*req
);
686 struct tevent_req
*winbindd_getpwsid_send(TALLOC_CTX
*mem_ctx
,
687 struct tevent_context
*ev
,
688 struct winbindd_cli_state
*cli
,
689 struct winbindd_request
*request
);
690 NTSTATUS
winbindd_getpwsid_recv(struct tevent_req
*req
,
691 struct winbindd_response
*response
);
693 struct tevent_req
*winbindd_getpwnam_send(TALLOC_CTX
*mem_ctx
,
694 struct tevent_context
*ev
,
695 struct winbindd_cli_state
*cli
,
696 struct winbindd_request
*request
);
697 NTSTATUS
winbindd_getpwnam_recv(struct tevent_req
*req
,
698 struct winbindd_response
*response
);
700 struct tevent_req
*winbindd_getpwuid_send(TALLOC_CTX
*mem_ctx
,
701 struct tevent_context
*ev
,
702 struct winbindd_cli_state
*cli
,
703 struct winbindd_request
*request
);
704 NTSTATUS
winbindd_getpwuid_recv(struct tevent_req
*req
,
705 struct winbindd_response
*response
);
706 struct tevent_req
*wb_lookupuseraliases_send(TALLOC_CTX
*mem_ctx
,
707 struct tevent_context
*ev
,
708 struct winbindd_domain
*domain
,
710 const struct dom_sid
*sids
);
711 NTSTATUS
wb_lookupuseraliases_recv(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
,
712 uint32_t *num_aliases
, uint32_t **aliases
);
713 struct tevent_req
*winbindd_getsidaliases_send(TALLOC_CTX
*mem_ctx
,
714 struct tevent_context
*ev
,
715 struct winbindd_cli_state
*cli
,
716 struct winbindd_request
*request
);
717 NTSTATUS
winbindd_getsidaliases_recv(struct tevent_req
*req
,
718 struct winbindd_response
*response
);
719 struct tevent_req
*wb_lookupusergroups_send(TALLOC_CTX
*mem_ctx
,
720 struct tevent_context
*ev
,
721 const struct dom_sid
*sid
);
722 NTSTATUS
wb_lookupusergroups_recv(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
,
723 uint32_t *num_sids
, struct dom_sid
**sids
);
725 struct tevent_req
*winbindd_getuserdomgroups_send(TALLOC_CTX
*mem_ctx
,
726 struct tevent_context
*ev
,
727 struct winbindd_cli_state
*cli
,
728 struct winbindd_request
*request
);
729 NTSTATUS
winbindd_getuserdomgroups_recv(struct tevent_req
*req
,
730 struct winbindd_response
*response
);
731 struct tevent_req
*wb_gettoken_send(TALLOC_CTX
*mem_ctx
,
732 struct tevent_context
*ev
,
733 const struct dom_sid
*sid
,
734 bool expand_local_aliases
);
735 NTSTATUS
wb_gettoken_recv(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
,
736 uint32_t *num_sids
, struct dom_sid
**sids
);
737 struct tevent_req
*winbindd_getgroups_send(TALLOC_CTX
*mem_ctx
,
738 struct tevent_context
*ev
,
739 struct winbindd_cli_state
*cli
,
740 struct winbindd_request
*request
);
741 NTSTATUS
winbindd_getgroups_recv(struct tevent_req
*req
,
742 struct winbindd_response
*response
);
744 struct tevent_req
*wb_seqnum_send(TALLOC_CTX
*mem_ctx
,
745 struct tevent_context
*ev
,
746 struct winbindd_domain
*domain
);
747 NTSTATUS
wb_seqnum_recv(struct tevent_req
*req
, uint32_t *seqnum
);
749 struct tevent_req
*wb_seqnums_send(TALLOC_CTX
*mem_ctx
,
750 struct tevent_context
*ev
);
751 NTSTATUS
wb_seqnums_recv(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
,
752 int *num_domains
, struct winbindd_domain
***domains
,
753 NTSTATUS
**statuses
, uint32_t **seqnums
);
755 struct tevent_req
*winbindd_show_sequence_send(TALLOC_CTX
*mem_ctx
,
756 struct tevent_context
*ev
,
757 struct winbindd_cli_state
*cli
,
758 struct winbindd_request
*request
);
759 NTSTATUS
winbindd_show_sequence_recv(struct tevent_req
*req
,
760 struct winbindd_response
*response
);
762 struct tevent_req
*wb_group_members_send(TALLOC_CTX
*mem_ctx
,
763 struct tevent_context
*ev
,
764 const struct dom_sid
*sid
,
766 enum lsa_SidType
*type
,
768 NTSTATUS
wb_group_members_recv(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
,
769 struct db_context
**members
);
771 struct tevent_req
*wb_alias_members_send(TALLOC_CTX
*mem_ctx
,
772 struct tevent_context
*ev
,
773 const struct dom_sid
*sid
,
774 enum lsa_SidType type
,
776 NTSTATUS
wb_alias_members_recv(struct tevent_req
*req
,
779 struct dom_sid
**sids
);
781 NTSTATUS
add_member_to_db(struct db_context
*db
, struct dom_sid
*sid
,
784 struct tevent_req
*wb_getgrsid_send(TALLOC_CTX
*mem_ctx
,
785 struct tevent_context
*ev
,
786 const struct dom_sid
*group_sid
,
788 NTSTATUS
wb_getgrsid_recv(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
,
789 const char **domname
, const char **name
, gid_t
*gid
,
790 struct db_context
**members
);
792 struct tevent_req
*winbindd_getgrgid_send(TALLOC_CTX
*mem_ctx
,
793 struct tevent_context
*ev
,
794 struct winbindd_cli_state
*cli
,
795 struct winbindd_request
*request
);
796 NTSTATUS
winbindd_getgrgid_recv(struct tevent_req
*req
,
797 struct winbindd_response
*response
);
799 struct tevent_req
*winbindd_getgrnam_send(TALLOC_CTX
*mem_ctx
,
800 struct tevent_context
*ev
,
801 struct winbindd_cli_state
*cli
,
802 struct winbindd_request
*request
);
803 NTSTATUS
winbindd_getgrnam_recv(struct tevent_req
*req
,
804 struct winbindd_response
*response
);
806 struct tevent_req
*winbindd_getusersids_send(TALLOC_CTX
*mem_ctx
,
807 struct tevent_context
*ev
,
808 struct winbindd_cli_state
*cli
,
809 struct winbindd_request
*request
);
810 NTSTATUS
winbindd_getusersids_recv(struct tevent_req
*req
,
811 struct winbindd_response
*response
);
813 struct tevent_req
*winbindd_lookuprids_send(TALLOC_CTX
*mem_ctx
,
814 struct tevent_context
*ev
,
815 struct winbindd_cli_state
*cli
,
816 struct winbindd_request
*request
);
817 NTSTATUS
winbindd_lookuprids_recv(struct tevent_req
*req
,
818 struct winbindd_response
*response
);
820 struct tevent_req
*wb_query_user_list_send(TALLOC_CTX
*mem_ctx
,
821 struct tevent_context
*ev
,
822 struct winbindd_domain
*domain
);
823 NTSTATUS
wb_query_user_list_recv(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
,
826 struct tevent_req
*wb_query_group_list_send(TALLOC_CTX
*mem_ctx
,
827 struct tevent_context
*ev
,
828 struct winbindd_domain
*domain
);
829 NTSTATUS
wb_query_group_list_recv(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
,
831 struct wbint_Principal
**groups
);
833 struct tevent_req
*wb_next_pwent_send(TALLOC_CTX
*mem_ctx
,
834 struct tevent_context
*ev
,
835 struct getpwent_state
*gstate
,
836 struct winbindd_pw
*pw
);
837 NTSTATUS
wb_next_pwent_recv(struct tevent_req
*req
);
839 struct tevent_req
*winbindd_setpwent_send(TALLOC_CTX
*mem_ctx
,
840 struct tevent_context
*ev
,
841 struct winbindd_cli_state
*cli
,
842 struct winbindd_request
*request
);
843 NTSTATUS
winbindd_setpwent_recv(struct tevent_req
*req
,
844 struct winbindd_response
*presp
);
846 struct tevent_req
*winbindd_getpwent_send(TALLOC_CTX
*mem_ctx
,
847 struct tevent_context
*ev
,
848 struct winbindd_cli_state
*cli
,
849 struct winbindd_request
*request
);
850 NTSTATUS
winbindd_getpwent_recv(struct tevent_req
*req
,
851 struct winbindd_response
*response
);
853 struct tevent_req
*winbindd_endpwent_send(TALLOC_CTX
*mem_ctx
,
854 struct tevent_context
*ev
,
855 struct winbindd_cli_state
*cli
,
856 struct winbindd_request
*request
);
857 NTSTATUS
winbindd_endpwent_recv(struct tevent_req
*req
,
858 struct winbindd_response
*response
);
860 struct tevent_req
*winbindd_dsgetdcname_send(TALLOC_CTX
*mem_ctx
,
861 struct tevent_context
*ev
,
862 struct winbindd_cli_state
*cli
,
863 struct winbindd_request
*request
);
864 NTSTATUS
winbindd_dsgetdcname_recv(struct tevent_req
*req
,
865 struct winbindd_response
*response
);
867 struct tevent_req
*wb_dsgetdcname_send(TALLOC_CTX
*mem_ctx
,
868 struct tevent_context
*ev
,
869 const char *domain_name
,
870 const struct GUID
*domain_guid
,
871 const char *site_name
,
873 NTSTATUS
wb_dsgetdcname_recv(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
,
874 struct netr_DsRGetDCNameInfo
**pdcinfo
);
875 NTSTATUS
wb_dsgetdcname_gencache_set(const char *domname
,
876 struct netr_DsRGetDCNameInfo
*dcinfo
);
877 NTSTATUS
wb_dsgetdcname_gencache_get(TALLOC_CTX
*mem_ctx
,
879 struct netr_DsRGetDCNameInfo
**dcinfo
);
881 struct tevent_req
*winbindd_getdcname_send(TALLOC_CTX
*mem_ctx
,
882 struct tevent_context
*ev
,
883 struct winbindd_cli_state
*cli
,
884 struct winbindd_request
*request
);
885 NTSTATUS
winbindd_getdcname_recv(struct tevent_req
*req
,
886 struct winbindd_response
*response
);
888 struct tevent_req
*wb_next_grent_send(TALLOC_CTX
*mem_ctx
,
889 struct tevent_context
*ev
,
891 struct getgrent_state
*gstate
,
892 struct winbindd_gr
*gr
);
893 NTSTATUS
wb_next_grent_recv(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
,
894 struct db_context
**members
);
896 struct tevent_req
*winbindd_setgrent_send(TALLOC_CTX
*mem_ctx
,
897 struct tevent_context
*ev
,
898 struct winbindd_cli_state
*cli
,
899 struct winbindd_request
*request
);
900 NTSTATUS
winbindd_setgrent_recv(struct tevent_req
*req
,
901 struct winbindd_response
*response
);
902 struct tevent_req
*winbindd_getgrent_send(TALLOC_CTX
*mem_ctx
,
903 struct tevent_context
*ev
,
904 struct winbindd_cli_state
*cli
,
905 struct winbindd_request
*request
);
906 NTSTATUS
winbindd_getgrent_recv(struct tevent_req
*req
,
907 struct winbindd_response
*response
);
908 struct tevent_req
*winbindd_endgrent_send(TALLOC_CTX
*mem_ctx
,
909 struct tevent_context
*ev
,
910 struct winbindd_cli_state
*cli
,
911 struct winbindd_request
*request
);
912 NTSTATUS
winbindd_endgrent_recv(struct tevent_req
*req
,
913 struct winbindd_response
*response
);
915 struct tevent_req
*winbindd_list_users_send(TALLOC_CTX
*mem_ctx
,
916 struct tevent_context
*ev
,
917 struct winbindd_cli_state
*cli
,
918 struct winbindd_request
*request
);
919 NTSTATUS
winbindd_list_users_recv(struct tevent_req
*req
,
920 struct winbindd_response
*response
);
922 struct tevent_req
*winbindd_list_groups_send(TALLOC_CTX
*mem_ctx
,
923 struct tevent_context
*ev
,
924 struct winbindd_cli_state
*cli
,
925 struct winbindd_request
*request
);
926 NTSTATUS
winbindd_list_groups_recv(struct tevent_req
*req
,
927 struct winbindd_response
*response
);
929 struct tevent_req
*winbindd_check_machine_acct_send(TALLOC_CTX
*mem_ctx
,
930 struct tevent_context
*ev
,
931 struct winbindd_cli_state
*cli
,
932 struct winbindd_request
*request
);
933 NTSTATUS
winbindd_check_machine_acct_recv(struct tevent_req
*req
,
934 struct winbindd_response
*presp
);
936 struct tevent_req
*winbindd_ping_dc_send(TALLOC_CTX
*mem_ctx
,
937 struct tevent_context
*ev
,
938 struct winbindd_cli_state
*cli
,
939 struct winbindd_request
*request
);
940 NTSTATUS
winbindd_ping_dc_recv(struct tevent_req
*req
,
941 struct winbindd_response
*presp
);
943 struct tevent_req
*winbindd_change_machine_acct_send(TALLOC_CTX
*mem_ctx
,
944 struct tevent_context
*ev
,
945 struct winbindd_cli_state
*cli
,
946 struct winbindd_request
*request
);
947 NTSTATUS
winbindd_change_machine_acct_recv(struct tevent_req
*req
,
948 struct winbindd_response
*presp
);
950 struct tevent_req
*winbindd_pam_auth_send(TALLOC_CTX
*mem_ctx
,
951 struct tevent_context
*ev
,
952 struct winbindd_cli_state
*cli
,
953 struct winbindd_request
*request
);
954 NTSTATUS
winbindd_pam_auth_recv(struct tevent_req
*req
,
955 struct winbindd_response
*response
);
957 struct tevent_req
*winbindd_pam_auth_crap_send(
959 struct tevent_context
*ev
,
960 struct winbindd_cli_state
*cli
,
961 struct winbindd_request
*request
);
962 NTSTATUS
winbindd_pam_auth_crap_recv(struct tevent_req
*req
,
963 struct winbindd_response
*response
);
965 struct tevent_req
*winbindd_pam_chauthtok_send(
967 struct tevent_context
*ev
,
968 struct winbindd_cli_state
*cli
,
969 struct winbindd_request
*request
);
970 NTSTATUS
winbindd_pam_chauthtok_recv(struct tevent_req
*req
,
971 struct winbindd_response
*response
);
973 struct tevent_req
*winbindd_pam_logoff_send(TALLOC_CTX
*mem_ctx
,
974 struct tevent_context
*ev
,
975 struct winbindd_cli_state
*cli
,
976 struct winbindd_request
*request
);
977 NTSTATUS
winbindd_pam_logoff_recv(struct tevent_req
*req
,
978 struct winbindd_response
*response
);
980 struct tevent_req
*winbindd_pam_chng_pswd_auth_crap_send(
982 struct tevent_context
*ev
,
983 struct winbindd_cli_state
*cli
,
984 struct winbindd_request
*request
);
985 NTSTATUS
winbindd_pam_chng_pswd_auth_crap_recv(
986 struct tevent_req
*req
,
987 struct winbindd_response
*response
);
989 struct tevent_req
*wb_lookupsids_send(TALLOC_CTX
*mem_ctx
,
990 struct tevent_context
*ev
,
991 struct dom_sid
*sids
,
993 NTSTATUS
wb_lookupsids_recv(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
,
994 struct lsa_RefDomainList
**domains
,
995 struct lsa_TransNameArray
**names
);
997 struct tevent_req
*wb_sids2xids_send(TALLOC_CTX
*mem_ctx
,
998 struct tevent_context
*ev
,
999 const struct dom_sid
*sids
,
1000 const uint32_t num_sids
);
1001 NTSTATUS
wb_sids2xids_recv(struct tevent_req
*req
,
1002 struct unixid xids
[], uint32_t num_xids
);
1003 struct tevent_req
*winbindd_sids_to_xids_send(TALLOC_CTX
*mem_ctx
,
1004 struct tevent_context
*ev
,
1005 struct winbindd_cli_state
*cli
,
1006 struct winbindd_request
*request
);
1007 NTSTATUS
winbindd_sids_to_xids_recv(struct tevent_req
*req
,
1008 struct winbindd_response
*response
);
1009 struct tevent_req
*wb_xids2sids_send(TALLOC_CTX
*mem_ctx
,
1010 struct tevent_context
*ev
,
1011 const struct unixid
*xids
,
1013 NTSTATUS
wb_xids2sids_recv(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
,
1014 struct dom_sid
**sids
);
1015 struct tevent_req
*winbindd_xids_to_sids_send(TALLOC_CTX
*mem_ctx
,
1016 struct tevent_context
*ev
,
1017 struct winbindd_cli_state
*cli
,
1018 struct winbindd_request
*request
);
1019 NTSTATUS
winbindd_xids_to_sids_recv(struct tevent_req
*req
,
1020 struct winbindd_response
*response
);
1021 struct tevent_req
*winbindd_wins_byip_send(TALLOC_CTX
*mem_ctx
,
1022 struct tevent_context
*ev
,
1023 struct winbindd_cli_state
*cli
,
1024 struct winbindd_request
*request
);
1025 NTSTATUS
winbindd_wins_byip_recv(struct tevent_req
*req
,
1026 struct winbindd_response
*presp
);
1027 struct tevent_req
*winbindd_wins_byname_send(TALLOC_CTX
*mem_ctx
,
1028 struct tevent_context
*ev
,
1029 struct winbindd_cli_state
*cli
,
1030 struct winbindd_request
*request
);
1031 NTSTATUS
winbindd_wins_byname_recv(struct tevent_req
*req
,
1032 struct winbindd_response
*presp
);
1033 struct tevent_req
*winbindd_domain_info_send(
1034 TALLOC_CTX
*mem_ctx
,
1035 struct tevent_context
*ev
,
1036 struct winbindd_cli_state
*cli
,
1037 struct winbindd_request
*request
);
1038 NTSTATUS
winbindd_domain_info_recv(struct tevent_req
*req
,
1039 struct winbindd_response
*response
);
1041 /* The following definitions come from winbindd/winbindd_samr.c */
1043 NTSTATUS
open_internal_samr_conn(TALLOC_CTX
*mem_ctx
,
1044 struct winbindd_domain
*domain
,
1045 struct rpc_pipe_client
**samr_pipe
,
1046 struct policy_handle
*samr_domain_hnd
);
1047 NTSTATUS
open_internal_lsa_conn(TALLOC_CTX
*mem_ctx
,
1048 struct rpc_pipe_client
**lsa_pipe
,
1049 struct policy_handle
*lsa_hnd
);
1051 /* The following definitions come from winbindd/winbindd_irpc.c */
1052 NTSTATUS
wb_irpc_register(void);
1054 /* The following definitions come from winbindd/winbindd_reconnect.c */
1055 bool reconnect_need_retry(NTSTATUS status
, struct winbindd_domain
*domain
);
1057 /* The following definitions come from winbindd/winbindd_gpupdate.c */
1058 void gpupdate_init(void);
1059 void gpupdate_user_init(const char *user
);
1061 /* The following comes from winbindd/winbindd_dual_srv.c */
1062 bool reset_cm_connection_on_error(struct winbindd_domain
*domain
,
1063 struct dcerpc_binding_handle
*b
,
1066 #endif /* _WINBINDD_PROTO_H_ */