1 /* 2 * PAM authentication module for PostgreSQL 3 * 4 * Based in part on pam_unix.c of FreeBSD. See COPYRIGHT 5 * for licensing details. 6 * 7 * David D.W. Downey ("pgpkeys") <david-downey@codecastle.com> et al. (see COPYRIGHT) 8 * William Grzybowski <william@agencialivre.com.br> 9 */ 10 11 12 #ifndef __PAM_PGSQL_H 13 #define __PAM_PGSQL_H 14 15 #include "backend_pgsql.h" 16 17 #define PAM_SM_AUTH 18 #define PAM_SM_ACCOUNT 19 #define PAM_SM_PASSWORD 20 #include <security/pam_modules.h> 21 22 #define PASSWORD_PROMPT "Password: " 23 #define PASSWORD_PROMPT_NEW "New password: " 24 #define PASSWORD_PROMPT_CONFIRM "Confirm new password: " 25 26 #include <syslog.h> 27 28 #define DBGLOG(x...) if(options->debug) { \ 29 openlog("PAM_pgsql", LOG_PID, LOG_AUTH); \ 30 syslog(LOG_DEBUG, ##x); \ 31 closelog(); \ 32 } 33 #define SYSLOG(x...) do { \ 34 openlog("PAM_pgsql", LOG_PID, LOG_AUTH); \ 35 syslog(LOG_INFO, ##x); \ 36 closelog(); \ 37 } while(0); 38 39 #endif 40