From 7061d2c2f7a376721f196f7f88253b3a0428e980 Mon Sep 17 00:00:00 2001 From: Arthur de Jong Date: Mon, 10 May 2010 20:59:52 +0000 Subject: replace my_pam_warn() with pam_info() and pam_error() and provide replacement for pam_prompt() also using it in our pam_get_authtok() replacement git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1098 ef36b2f9-881f-0410-afb5-c4e39611909c --- compat/pam_compat.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'compat/pam_compat.h') diff --git a/compat/pam_compat.h b/compat/pam_compat.h index c453061..f3607af 100644 --- a/compat/pam_compat.h +++ b/compat/pam_compat.h @@ -40,7 +40,23 @@ /* define our own replacement pam_get_authtok() if it wasn't found */ #ifndef HAVE_PAM_GET_AUTHTOK int pam_get_authtok(pam_handle_t *pamh,int item,const char **authtok,const char *prompt); -#endif /* HAVE_PAM_GET_AUTHTOK */ +#endif /* not HAVE_PAM_GET_AUTHTOK */ + +/* replace pam_prompt() if needed */ +#ifndef HAVE_PAM_PROMPT +int pam_prompt(pam_handle_t *pamh,int style,char **response,const char *format,...) + LIKE_PRINTF(4,5); +#endif /* not HAVE_PAM_PROMPT */ + +/* provide pam_info() if needed */ +#ifndef pam_info +#define pam_info(pamh, fmt...) pam_prompt(pamh,PAM_TEXT_INFO,NULL,__VA_ARGS__) +#endif /* not pam_info */ + +/* provide pam_error() if needed */ +#ifndef pam_error +#define pam_error(pamh, fmt...) pam_prompt(pamh,PAM_ERROR_MSG,NULL,__VA_ARGS__) +#endif /* not pam_error */ /* fall back to using getpwnam() if pam_modutil_getpwnam() isn't defined */ #ifndef HAVE_PAM_MODUTIL_GETGWNAM -- cgit v1.2.3