summaryrefslogtreecommitdiff
path: root/contrib/openpam/lib/pam_get_user.c
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2004-02-10 10:11:23 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2004-02-10 10:11:23 +0000
commit87dbb1bf2489cec74aba1940f08e6379a1f0b0b6 (patch)
tree30e52e2cca820c5a8b789c03f10eb852acef2805 /contrib/openpam/lib/pam_get_user.c
parent152772dd7fff114c073c854e3f486de73331d81c (diff)
parente10ae02217d1aeea5a7401c102f7476861060685 (diff)
Notes
Diffstat (limited to 'contrib/openpam/lib/pam_get_user.c')
-rw-r--r--contrib/openpam/lib/pam_get_user.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/contrib/openpam/lib/pam_get_user.c b/contrib/openpam/lib/pam_get_user.c
index 413056cf2cdc..2e8e3428168f 100644
--- a/contrib/openpam/lib/pam_get_user.c
+++ b/contrib/openpam/lib/pam_get_user.c
@@ -31,7 +31,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $P4: //depot/projects/openpam/lib/pam_get_user.c#18 $
+ * $P4: //depot/projects/openpam/lib/pam_get_user.c#19 $
*/
#include <sys/param.h>
@@ -57,6 +57,7 @@ pam_get_user(pam_handle_t *pamh,
const char **user,
const char *prompt)
{
+ const void *promptp;
char *resp;
int r;
@@ -67,9 +68,11 @@ pam_get_user(pam_handle_t *pamh,
if (r == PAM_SUCCESS && *user != NULL)
RETURNC(PAM_SUCCESS);
if (prompt == NULL) {
- r = pam_get_item(pamh, PAM_USER_PROMPT, (const void **)&prompt);
- if (r != PAM_SUCCESS || prompt == NULL)
+ r = pam_get_item(pamh, PAM_USER_PROMPT, &promptp);
+ if (r != PAM_SUCCESS || promptp == NULL)
prompt = user_prompt;
+ else
+ prompt = promptp;
}
r = pam_prompt(pamh, PAM_PROMPT_ECHO_ON, &resp, "%s", prompt);
if (r != PAM_SUCCESS)