Added Steve Langasek <vorlon@netexpress.net> pam_smbpass PAM module code.
[ira/wip.git] / source3 / pam_smbpass / support.h
1 /* syslogging function for errors and other information */
2 extern void _log_err(int, const char *, ...);
3
4 /* set the control flags for the UNIX module. */
5 extern int set_ctrl(int, int, const char **);
6
7 /* generic function for freeing pam data segments */
8 extern void _cleanup(pam_handle_t *, void *, int);
9
10 /*
11  * Safe duplication of character strings. "Paranoid"; don't leave
12  * evidence of old token around for later stack analysis.
13  */
14
15 extern char *xstrdup(const char *);
16
17 /* ************************************************************** *
18  * Useful non-trivial functions                                   *
19  * ************************************************************** */
20
21 extern void _cleanup_failures(pam_handle_t *, void *, int);
22
23 /* compare 2 strings */
24 extern BOOL strequal(const char *, const char *);
25
26 extern struct smb_passwd *
27 _my_get_smbpwnam(FILE *, const char *, BOOL *, BOOL *, long *);
28
29 extern int _smb_verify_password( pam_handle_t *pamh
30                                  , const struct smb_passwd *smb_pwent
31                                  , const char *p, unsigned int ctrl );
32
33 /*
34  * this function obtains the name of the current user and ensures
35  * that the PAM_USER item is set to this value
36  */
37
38 extern int _smb_get_user(pam_handle_t *, unsigned int,
39                          const char *, const char **);
40
41 /* _smb_blankpasswd() is a quick check for a blank password */
42
43 extern int _smb_blankpasswd(unsigned int, const struct smb_passwd *);
44
45
46 /* obtain a password from the user */
47 extern int _smb_read_password( pam_handle_t *, unsigned int, const char*,
48                                 const char *, const char *, const char *,
49                                 const char **);
50
51 extern int _pam_smb_approve_pass(pam_handle_t *, unsigned int, const char *,
52                                  const char *);