2 /* The following definitions come from auth/auth.c */
4 NTSTATUS
smb_register_auth(int version
, const char *name
, auth_init_function init
);
5 bool load_auth_module(struct auth_context
*auth_context
,
6 const char *module
, auth_methods
**ret
) ;
7 NTSTATUS
make_auth_context_subsystem(TALLOC_CTX
*mem_ctx
,
8 struct auth_context
**auth_context
);
9 NTSTATUS
make_auth_context_fixed(TALLOC_CTX
*mem_ctx
,
10 struct auth_context
**auth_context
,
13 /* The following definitions come from auth/auth_builtin.c */
15 NTSTATUS
auth_builtin_init(void);
17 /* The following definitions come from auth/auth_compat.c */
19 NTSTATUS
check_plaintext_password(const char *smb_name
,
20 DATA_BLOB plaintext_password
,
21 struct auth_serversupplied_info
**server_info
);
22 bool password_ok(struct auth_context
*actx
, bool global_encrypted
,
23 const char *session_workgroup
,
24 const char *smb_name
, DATA_BLOB password_blob
);
26 /* The following definitions come from auth/auth_domain.c */
28 void attempt_machine_password_change(void);
29 NTSTATUS
auth_domain_init(void);
31 NTSTATUS
auth_netlogond_init(void);
33 /* The following definitions come from auth/auth_ntlmssp.c */
35 NTSTATUS
auth_ntlmssp_steal_session_info(TALLOC_CTX
*mem_ctx
,
36 struct auth_ntlmssp_state
*auth_ntlmssp_state
,
37 struct auth_serversupplied_info
**session_info
);
38 NTSTATUS
auth_ntlmssp_start(struct auth_ntlmssp_state
**auth_ntlmssp_state
);
41 /* The following definitions come from auth/auth_sam.c */
43 NTSTATUS
check_sam_security(const DATA_BLOB
*challenge
,
45 const struct auth_usersupplied_info
*user_info
,
46 struct auth_serversupplied_info
**server_info
);
47 NTSTATUS
check_sam_security_info3(const DATA_BLOB
*challenge
,
49 const struct auth_usersupplied_info
*user_info
,
50 struct netr_SamInfo3
**pinfo3
);
51 NTSTATUS
auth_sam_init(void);
53 /* The following definitions come from auth/auth_server.c */
55 NTSTATUS
auth_server_init(void);
57 /* The following definitions come from auth/auth_unix.c */
59 NTSTATUS
auth_unix_init(void);
61 /* The following definitions come from auth/auth_util.c */
63 NTSTATUS
make_user_info_map(struct auth_usersupplied_info
**user_info
,
65 const char *client_domain
,
66 const char *workstation_name
,
69 const struct samr_Password
*lm_interactive_pwd
,
70 const struct samr_Password
*nt_interactive_pwd
,
71 const char *plaintext
,
72 enum auth_password_state password_state
);
73 bool make_user_info_netlogon_network(struct auth_usersupplied_info
**user_info
,
75 const char *client_domain
,
76 const char *workstation_name
,
77 uint32 logon_parameters
,
78 const uchar
*lm_network_pwd
,
80 const uchar
*nt_network_pwd
,
82 bool make_user_info_netlogon_interactive(struct auth_usersupplied_info
**user_info
,
84 const char *client_domain
,
85 const char *workstation_name
,
86 uint32 logon_parameters
,
88 const uchar lm_interactive_pwd
[16],
89 const uchar nt_interactive_pwd
[16],
90 const uchar
*dc_sess_key
);
91 bool make_user_info_for_reply(struct auth_usersupplied_info
**user_info
,
93 const char *client_domain
,
95 DATA_BLOB plaintext_password
);
96 NTSTATUS
make_user_info_for_reply_enc(struct auth_usersupplied_info
**user_info
,
98 const char *client_domain
,
99 DATA_BLOB lm_resp
, DATA_BLOB nt_resp
);
100 bool make_user_info_guest(struct auth_usersupplied_info
**user_info
) ;
102 NTSTATUS
make_server_info_sam(struct auth_serversupplied_info
**server_info
,
103 struct samu
*sampass
);
104 NTSTATUS
create_local_token(TALLOC_CTX
*mem_ctx
,
105 const struct auth_serversupplied_info
*server_info
,
106 DATA_BLOB
*session_key
,
107 struct auth_serversupplied_info
**session_info_out
);
108 NTSTATUS
create_token_from_username(TALLOC_CTX
*mem_ctx
, const char *username
,
110 uid_t
*uid
, gid_t
*gid
,
111 char **found_username
,
112 struct security_token
**token
);
113 bool user_in_group_sid(const char *username
, const struct dom_sid
*group_sid
);
114 bool user_in_group(const char *username
, const char *groupname
);
116 NTSTATUS
make_server_info_pw(struct auth_serversupplied_info
**server_info
,
119 NTSTATUS
make_session_info_from_username(TALLOC_CTX
*mem_ctx
,
120 const char *username
,
122 struct auth_serversupplied_info
**session_info
);
123 struct auth_serversupplied_info
*copy_serverinfo(TALLOC_CTX
*mem_ctx
,
124 const struct auth_serversupplied_info
*src
);
125 bool init_guest_info(void);
126 NTSTATUS
init_system_info(void);
127 bool session_info_set_session_key(struct auth_serversupplied_info
*info
,
128 DATA_BLOB session_key
);
129 NTSTATUS
make_server_info_guest(TALLOC_CTX
*mem_ctx
,
130 struct auth_serversupplied_info
**server_info
);
131 NTSTATUS
make_session_info_system(TALLOC_CTX
*mem_ctx
,
132 struct auth_serversupplied_info
**session_info
);
133 const struct auth_serversupplied_info
*get_session_info_system(void);
134 bool copy_current_user(struct current_user
*dst
, struct current_user
*src
);
135 struct passwd
*smb_getpwnam( TALLOC_CTX
*mem_ctx
, const char *domuser
,
136 char **p_save_username
, bool create
);
137 NTSTATUS
make_server_info_info3(TALLOC_CTX
*mem_ctx
,
138 const char *sent_nt_username
,
140 struct auth_serversupplied_info
**server_info
,
141 struct netr_SamInfo3
*info3
);
142 struct wbcAuthUserInfo
;
143 NTSTATUS
make_server_info_wbcAuthUserInfo(TALLOC_CTX
*mem_ctx
,
144 const char *sent_nt_username
,
146 const struct wbcAuthUserInfo
*info
,
147 struct auth_serversupplied_info
**server_info
);
148 void free_user_info(struct auth_usersupplied_info
**user_info
);
149 bool make_auth_methods(struct auth_context
*auth_context
, auth_methods
**auth_method
) ;
150 bool is_trusted_domain(const char* dom_name
);
152 /* The following definitions come from auth/user_info.c */
154 NTSTATUS
make_user_info(struct auth_usersupplied_info
**ret_user_info
,
155 const char *smb_name
,
156 const char *internal_username
,
157 const char *client_domain
,
159 const char *workstation_name
,
160 const DATA_BLOB
*lm_pwd
,
161 const DATA_BLOB
*nt_pwd
,
162 const struct samr_Password
*lm_interactive_pwd
,
163 const struct samr_Password
*nt_interactive_pwd
,
164 const char *plaintext_password
,
165 enum auth_password_state password_state
);
166 void free_user_info(struct auth_usersupplied_info
**user_info
);
168 /* The following definitions come from auth/auth_winbind.c */
170 NTSTATUS
auth_winbind_init(void);
172 /* The following definitions come from auth/server_info.c */
174 struct netr_SamInfo2
;
175 struct netr_SamInfo3
;
176 struct netr_SamInfo6
;
178 struct auth_serversupplied_info
*make_server_info(TALLOC_CTX
*mem_ctx
);
179 NTSTATUS
serverinfo_to_SamInfo2(struct auth_serversupplied_info
*server_info
,
180 uint8_t *pipe_session_key
,
181 size_t pipe_session_key_len
,
182 struct netr_SamInfo2
*sam2
);
183 NTSTATUS
serverinfo_to_SamInfo3(const struct auth_serversupplied_info
*server_info
,
184 uint8_t *pipe_session_key
,
185 size_t pipe_session_key_len
,
186 struct netr_SamInfo3
*sam3
);
187 NTSTATUS
serverinfo_to_SamInfo6(struct auth_serversupplied_info
*server_info
,
188 uint8_t *pipe_session_key
,
189 size_t pipe_session_key_len
,
190 struct netr_SamInfo6
*sam6
);
191 NTSTATUS
samu_to_SamInfo3(TALLOC_CTX
*mem_ctx
,
193 const char *login_server
,
194 struct netr_SamInfo3
**_info3
,
195 struct extra_auth_info
*extra
);
196 struct netr_SamInfo3
*copy_netr_SamInfo3(TALLOC_CTX
*mem_ctx
,
197 struct netr_SamInfo3
*orig
);
198 struct netr_SamInfo3
*wbcAuthUserInfo_to_netr_SamInfo3(TALLOC_CTX
*mem_ctx
,
199 const struct wbcAuthUserInfo
*info
);
201 /* The following definitions come from auth/auth_wbc.c */
203 NTSTATUS
auth_wbc_init(void);
205 /* The following definitions come from auth/pampass.c */
207 bool smb_pam_claim_session(char *user
, char *tty
, char *rhost
);
208 bool smb_pam_close_session(char *user
, char *tty
, char *rhost
);
209 NTSTATUS
smb_pam_accountcheck(const char *user
, const char *rhost
);
210 NTSTATUS
smb_pam_passcheck(const char * user
, const char * rhost
,
211 const char * password
);
212 bool smb_pam_passchange(const char *user
, const char *rhost
,
213 const char *oldpassword
, const char *newpassword
);
214 bool smb_pam_claim_session(char *user
, char *tty
, char *rhost
);
215 bool smb_pam_close_session(char *in_user
, char *tty
, char *rhost
);
217 /* The following definitions come from auth/pass_check.c */
219 void dfs_unlogin(void);
220 NTSTATUS
pass_check(const struct passwd
*pass
,
223 const char *password
,
226 /* The following definitions come from auth/token_util.c */
228 bool nt_token_check_sid ( const struct dom_sid
*sid
, const struct security_token
*token
);
229 bool nt_token_check_domain_rid( struct security_token
*token
, uint32 rid
);
230 struct security_token
*get_root_nt_token( void );
231 NTSTATUS
add_aliases(const struct dom_sid
*domain_sid
,
232 struct security_token
*token
);
233 struct security_token
*create_local_nt_token(TALLOC_CTX
*mem_ctx
,
234 const struct dom_sid
*user_sid
,
237 const struct dom_sid
*groupsids
);
238 NTSTATUS
create_local_nt_token_from_info3(TALLOC_CTX
*mem_ctx
,
240 struct netr_SamInfo3
*info3
,
241 struct extra_auth_info
*extra
,
242 struct security_token
**ntok
);
243 void debug_unix_user_token(int dbg_class
, int dbg_lev
, uid_t uid
, gid_t gid
,
244 int n_groups
, gid_t
*groups
);
246 /* The following definitions come from auth/user_util.c */
248 bool map_username(TALLOC_CTX
*ctx
, const char *user_in
, char **p_user_out
);
249 bool user_in_netgroup(TALLOC_CTX
*ctx
, const char *user
, const char *ngname
);
250 bool user_in_list(TALLOC_CTX
*ctx
, const char *user
,const char **list
);
252 /* The following definitions come from auth/user_krb5.c */
253 struct PAC_LOGON_INFO
;
254 NTSTATUS
get_user_from_kerberos_info(TALLOC_CTX
*mem_ctx
,
255 const char *cli_name
,
256 const char *princ_name
,
257 struct PAC_LOGON_INFO
*logon_info
,
259 bool *mapped_to_guest
,
263 struct passwd
**_pw
);
264 NTSTATUS
make_session_info_krb5(TALLOC_CTX
*mem_ctx
,
269 struct PAC_LOGON_INFO
*logon_info
,
270 bool mapped_to_guest
, bool username_was_mapped
,
271 DATA_BLOB
*session_key
,
272 struct auth_serversupplied_info
**session_info
);