-#ifdef USE_PAM
-static pam_handle_t *pamh = NULL;
-# ifdef __GNUC__
-static int
-init_conv(int num_msg, const struct pam_message **msgm,
- struct pam_response **response __attribute__((unused)),
- void *appdata_ptr __attribute__((unused)))
-# else
-static int
-init_conv(int num_msg, const struct pam_message **msgm,
- struct pam_response **response, void *appdata_ptr)
-# endif
-{
- int i;
- for (i = 0; i < num_msg; i++) {
- const struct pam_message *msg = msgm[i];
- if (msg == (const struct pam_message*)0)
- continue;
- if (msg->msg == (char*)0)
- continue;
- switch (msg->msg_style) {
- case PAM_ERROR_MSG:
- case PAM_TEXT_INFO:
- initlog(L_VB, "pam_message %s", msg->msg);
- default:
- break;
- }
- }
- return 0;
-}
-static const struct pam_conv conv = { init_conv, NULL };
-# define PAM_FAIL_CHECK(func, args...) \
- { \
- if ((pam_ret = (func)(args)) != PAM_SUCCESS) { \
- initlog(L_VB, "%s", pam_strerror(pamh, pam_ret)); \
- goto pam_error; \
- } \
- }
-#endif /* USE_PAM */
-
-