1 #ifndef _GNU_SOURCE 2 #define _GNU_SOURCE 3 #endif 4 5 #ifndef __PAM_PG_OPTIONS_H_ 6 #define __PAM_PG_OPTIONS_H_ 7 8 #define PAM_PGSQL_FILECONF SYSCONFDIR "/pam_pgsql.conf" 9 #define PAM_PGSQL_PORT 5432 10 11 #include <sys/cdefs.h> 12 13 #define PAM_OPT_DEBUG 0x01 14 #define PAM_OPT_NO_WARN 0x02 15 #define PAM_OPT_USE_FIRST_PASS 0x04 16 #define PAM_OPT_TRY_FIRST_PASS 0x08 17 #define PAM_OPT_USE_MAPPED_PASS 0x10 18 #define PAM_OPT_ECHO_PASS 0x20 19 #define PAM_OPT_TRY_OLDAUTH 0x40 20 #define PAM_OPT_USE_OLDAUTH 0x80 21 22 typedef enum { 23 PW_CLEAR = 1, 24 PW_MD5, 25 PW_CRYPT, 26 PW_CRYPT_MD5, 27 PW_SHA1, 28 PW_MD5_POSTGRES 29 } pw_scheme; 30 31 typedef struct modopt_s { 32 33 char *connstr; 34 char *fileconf; 35 char *host; 36 char *db; 37 char *table; 38 char *timeout; 39 char *user; 40 char *passwd; 41 char *sslmode; 42 char *column_pwd; 43 char *column_user; 44 char *column_expired; 45 char *column_newpwd; 46 char *query_acct; 47 char *query_pwd; 48 char *query_auth; 49 char *query_auth_succ; 50 char *query_auth_fail; 51 char *query_session_open; 52 char *query_session_close; 53 char *port; 54 int pw_type; 55 int debug; 56 int std_flags; 57 58 } modopt_t; 59 60 modopt_t * mod_options(int , const char **); 61 62 63 int pam_get_pass(pam_handle_t *, int, const char **, const char *, int); 64 int pam_get_confirm_pass(pam_handle_t *, const char **, const char *, const char *, int); 65 const char *pam_get_service(pam_handle_t *pamh); 66 67 #endif 68