diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2010-05-10 22:59:52 +0200 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2010-05-10 22:59:52 +0200 |
commit | 7061d2c2f7a376721f196f7f88253b3a0428e980 (patch) | |
tree | 6e9826062ac2e2756d537cc62ed4adb0a1f387f6 /compat/pam_compat.h | |
parent | a672d0d688d3ee0e66c0f15287d9f9fcc32d45bf (diff) |
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
Diffstat (limited to 'compat/pam_compat.h')
-rw-r--r-- | compat/pam_compat.h | 18 |
1 files changed, 17 insertions, 1 deletions
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 |