From 85ff75043e1c622ad41c9fe877b09903e4d355a0 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 22 Nov 2013 05:11:49 +0100 Subject: whoops MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/cerberus.c | 1 - src/pam.c | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/cerberus.c b/src/cerberus.c index 94dc183..03a7a75 100644 --- a/src/cerberus.c +++ b/src/cerberus.c @@ -214,7 +214,6 @@ void do_login(int argc, char** argv) username = entry->pw_name; - /* Verify passphrase or other token, if -f has not been used */ initialise_pam(hostname, username, read_passphrase); if ((skip_auth == 0) && authenticate_pam()) diff --git a/src/pam.c b/src/pam.c index f85e741..6a35a34 100644 --- a/src/pam.c +++ b/src/pam.c @@ -216,7 +216,7 @@ char authenticate_pam(void) * * @param num_msg Number of pointers in the array `msg` * @param msg Message from PAM - * @param resp Responses to PAM for by index corresponding messages + * @param resp Pointer to responses to PAM for by index corresponding messages * @param appdata_ptr (Not used) * @return `PAM_SUCCESS`, `PAM_CONV_ERR` or `PAM_BUF_ERR` */ @@ -226,6 +226,8 @@ int conv_pam(int num_msg, const struct pam_message** msg, struct pam_response** (void) appdata_ptr; + *resp = calloc(num_msg, sizeof(struct pam_response)); + for (i = 0; i < num_msg; i++) { ((*resp) + i)->resp = NULL; -- cgit v1.2.3-70-g09d2