pam_vprompt.c (91094) | pam_vprompt.c (91097) |
---|---|
1/*- 2 * Copyright (c) 2002 Networks Associates Technologies, Inc. 3 * All rights reserved. 4 * 5 * This software was developed for the FreeBSD Project by ThinkSec AS and 6 * NAI Labs, the Security Research Division of Network Associates, Inc. 7 * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the 8 * DARPA CHATS research program. --- 44 unchanged lines hidden (view full) --- 53 char **resp, 54 const char *fmt, 55 va_list ap) 56{ 57 char msgbuf[PAM_MAX_MSG_SIZE]; 58 struct pam_message msg; 59 const struct pam_message *msgp; 60 struct pam_response *rsp; | 1/*- 2 * Copyright (c) 2002 Networks Associates Technologies, Inc. 3 * All rights reserved. 4 * 5 * This software was developed for the FreeBSD Project by ThinkSec AS and 6 * NAI Labs, the Security Research Division of Network Associates, Inc. 7 * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the 8 * DARPA CHATS research program. --- 44 unchanged lines hidden (view full) --- 53 char **resp, 54 const char *fmt, 55 va_list ap) 56{ 57 char msgbuf[PAM_MAX_MSG_SIZE]; 58 struct pam_message msg; 59 const struct pam_message *msgp; 60 struct pam_response *rsp; |
61 struct pam_conv conv; | 61 struct pam_conv *conv; |
62 int r; 63 | 62 int r; 63 |
64 if ((r = pam_get_item(pamh, PAM_CONV, (void *)&conv)) != PAM_SUCCESS) | 64 r = pam_get_item(pamh, PAM_CONV, (const void **)&conv); 65 if (r != PAM_SUCCESS) |
65 return (r); | 66 return (r); |
67 if (conv == NULL) { 68 openpam_log(PAM_LOG_ERROR, "no conversation function"); 69 return (PAM_SYSTEM_ERR); 70 } |
|
66 vsnprintf(msgbuf, PAM_MAX_MSG_SIZE, fmt, ap); 67 msg.msg_style = style; 68 msg.msg = msgbuf; 69 msgp = &msg; | 71 vsnprintf(msgbuf, PAM_MAX_MSG_SIZE, fmt, ap); 72 msg.msg_style = style; 73 msg.msg = msgbuf; 74 msgp = &msg; |
70 r = (conv.conv)(1, &msgp, &rsp, conv.appdata_ptr); | 75 r = (conv->conv)(1, &msgp, &rsp, conv->appdata_ptr); |
71 *resp = rsp == NULL ? NULL : rsp->resp; 72 free(rsp); 73 return (r); 74} | 76 *resp = rsp == NULL ? NULL : rsp->resp; 77 free(rsp); 78 return (r); 79} |