summaryrefslogtreecommitdiff
path: root/usr.bin/sudo/auth/pam.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2003-03-15 21:23:55 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2003-03-15 21:23:55 +0000
commitbbb8ce99718ff8e96e3ab9f63e060f51d45a353f (patch)
treeb9192dd905951043df796920ee782c06c3768f0f /usr.bin/sudo/auth/pam.c
parentf2636e6fcc8e9592b1ec53c4ca27c6187d03761f (diff)
update to what will soon be sudo 1.6.7
Diffstat (limited to 'usr.bin/sudo/auth/pam.c')
-rw-r--r--usr.bin/sudo/auth/pam.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/usr.bin/sudo/auth/pam.c b/usr.bin/sudo/auth/pam.c
index 28603f5a897..74c9a8a5b45 100644
--- a/usr.bin/sudo/auth/pam.c
+++ b/usr.bin/sudo/auth/pam.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999-2001 Todd C. Miller <Todd.Miller@courtesan.com>
+ * Copyright (c) 1999-2002 Todd C. Miller <Todd.Miller@courtesan.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -66,7 +66,7 @@
#include "sudo_auth.h"
#ifndef lint
-static const char rcsid[] = "$Sudo: pam.c,v 1.29 2002/01/22 16:43:23 millert Exp $";
+static const char rcsid[] = "$Sudo: pam.c,v 1.32 2003/03/15 20:37:44 millert Exp $";
#endif /* lint */
static int sudo_conv __P((int, PAM_CONST struct pam_message **,
@@ -201,11 +201,11 @@ sudo_conv(num_msg, msg, response, appdata_ptr)
struct pam_response **response;
VOID *appdata_ptr;
{
- struct pam_response *pr;
+ volatile struct pam_response *pr;
PAM_CONST struct pam_message *pm;
const char *p = def_prompt;
- char *pass;
- int n;
+ volatile char *pass;
+ int n, flags;
extern int nil_pw;
if ((*response = malloc(num_msg * sizeof(struct pam_response))) == NULL)
@@ -213,17 +213,17 @@ sudo_conv(num_msg, msg, response, appdata_ptr)
(void) memset(*response, 0, num_msg * sizeof(struct pam_response));
for (pr = *response, pm = *msg, n = num_msg; n--; pr++, pm++) {
+ flags = tgetpass_flags;
switch (pm->msg_style) {
case PAM_PROMPT_ECHO_ON:
- tgetpass_flags |= TGP_ECHO;
+ flags |= TGP_ECHO;
case PAM_PROMPT_ECHO_OFF:
/* Only override PAM prompt if it matches /^Password: ?/ */
if (strncmp(pm->msg, "Password:", 9) || (pm->msg[9] != '\0'
&& (pm->msg[9] != ' ' || pm->msg[10] != '\0')))
p = pm->msg;
/* Read the password. */
- pass = tgetpass(p, def_ival(I_PASSWD_TIMEOUT) * 60,
- tgetpass_flags);
+ pass = tgetpass(p, def_ival(I_PASSWD_TIMEOUT) * 60, flags);
pr->resp = estrdup(pass ? pass : "");
if (*pr->resp == '\0')
nil_pw = 1; /* empty password */