-/*
- * conv(): the PAM conversation function. this assumes that a
- * PAM_PROMPT_ECHO_ON is asking for a username, and a PAM_PROMPT_ECHO_OFF is
- * asking for a password. esoteric authentication modules will fail with this
- * code, but we can't really support them with the existing client protocol
- * anyway. the failure mode should be to deny access, in any case.
- */
-
-static int conv(int num_msg, const struct pam_message **msg,
- struct pam_response **resp, void *appdata_ptr)
-{
- struct pam_response *temp_resp;
- struct appdata *data = appdata_ptr;
-
- if ((temp_resp = malloc(sizeof(struct pam_response[num_msg]))) == NULL)
- return PAM_CONV_ERR;
-
- while (num_msg--)
- {
- switch ((*msg)[num_msg].msg_style)
- {
- case PAM_PROMPT_ECHO_ON:
- temp_resp[num_msg].resp = strdup(data->name);
- break;
- case PAM_PROMPT_ECHO_OFF:
- temp_resp[num_msg].resp = strdup(data->pw);
- break;
- default:
- temp_resp[num_msg].resp = NULL;
+// conv(): the PAM conversation function. this assumes that a
+// PAM_PROMPT_ECHO_ON is asking for a username, and a PAM_PROMPT_ECHO_OFF is
+// asking for a password. esoteric authentication modules will fail with this
+// code, but we can't really support them with the existing client protocol
+// anyway. the failure mode should be to deny access, in any case.
+static int conv(int num_msg, const struct pam_message **msg, struct pam_response **resp, void *appdata_ptr) {
+ struct pam_response *temp_resp;
+ struct appdata *data = appdata_ptr;
+
+ if ((temp_resp =
+ malloc(sizeof(struct pam_response[num_msg]))) == NULL)
+ return PAM_CONV_ERR;
+
+ while (num_msg--) {
+ switch ((*msg)[num_msg].msg_style) {
+ case PAM_PROMPT_ECHO_ON:
+ temp_resp[num_msg].resp = strdup(data->name);
+ break;
+ case PAM_PROMPT_ECHO_OFF:
+ temp_resp[num_msg].resp = strdup(data->pw);
+ break;
+ default:
+ temp_resp[num_msg].resp = NULL;
+ }
+ temp_resp[num_msg].resp_retcode = 0;