Some defaults I_ defines got renamed.

This commit is contained in:
Todd C. Miller
2000-12-31 01:39:06 +00:00
parent d956d77528
commit 16e6a3b84a
6 changed files with 18 additions and 17 deletions

View File

@@ -67,7 +67,7 @@ aixauth_verify(pw, prompt, auth)
char *message, *pass; char *message, *pass;
int reenter = 1; int reenter = 1;
pass = tgetpass(prompt, def_ival(I_PW_TIMEOUT) * 60, tgetpass_flags); pass = tgetpass(prompt, def_ival(I_PASSWD_TIMEOUT) * 60, tgetpass_flags);
if (authenticate(pw->pw_name, pass, &reenter, &message) == 0) if (authenticate(pw->pw_name, pass, &reenter, &message) == 0)
return(AUTH_SUCCESS); return(AUTH_SUCCESS);
else else

View File

@@ -122,9 +122,9 @@ bsdauth_verify(pw, prompt, auth)
* S/Key. * S/Key.
*/ */
if ((s = auth_challenge(as)) == NULL) { if ((s = auth_challenge(as)) == NULL) {
pass = tgetpass(prompt, def_ival(I_PW_TIMEOUT) * 60, tgetpass_flags); pass = tgetpass(prompt, def_ival(I_PASSWD_TIMEOUT) * 60, tgetpass_flags);
} else { } else {
pass = tgetpass(s, def_ival(I_PW_TIMEOUT) * 60, tgetpass_flags); pass = tgetpass(s, def_ival(I_PASSWD_TIMEOUT) * 60, tgetpass_flags);
if (!pass || *pass == '\0') { if (!pass || *pass == '\0') {
if ((prompt = strrchr(s, '\n'))) if ((prompt = strrchr(s, '\n')))
prompt++; prompt++;
@@ -139,7 +139,7 @@ bsdauth_verify(pw, prompt, auth)
while (isspace(prompt[len]) || prompt[len] == ':') while (isspace(prompt[len]) || prompt[len] == ':')
prompt[len--] = '\0'; prompt[len--] = '\0';
easprintf(&s, "%s [echo on]: ", prompt); easprintf(&s, "%s [echo on]: ", prompt);
pass = tgetpass(s, def_ival(I_PW_TIMEOUT) * 60, pass = tgetpass(s, def_ival(I_PASSWD_TIMEOUT) * 60,
tgetpass_flags | TGP_ECHO); tgetpass_flags | TGP_ECHO);
free(s); free(s);
} }

View File

@@ -118,13 +118,14 @@ fwtk_verify(pw, prompt, auth)
/* Get the password/response from the user. */ /* Get the password/response from the user. */
if (strncmp(resp, "challenge ", 10) == 0) { if (strncmp(resp, "challenge ", 10) == 0) {
(void) snprintf(buf, sizeof(buf), "%s\nResponse: ", &resp[10]); (void) snprintf(buf, sizeof(buf), "%s\nResponse: ", &resp[10]);
pass = tgetpass(buf, def_ival(I_PW_TIMEOUT) * 60, tgetpass_flags); pass = tgetpass(buf, def_ival(I_PASSWD_TIMEOUT) * 60, tgetpass_flags);
if (!pass || *pass == '\0') { if (!pass || *pass == '\0') {
pass = tgetpass("Response [echo on]: ", def_ival(I_PW_TIMEOUT) * 60, pass = tgetpass("Response [echo on]: ",
tgetpass_flags | TGP_ECHO); def_ival(I_PASSWD_TIMEOUT) * 60, tgetpass_flags | TGP_ECHO);
} }
} else if (strncmp(resp, "password", 8) == 0) { } else if (strncmp(resp, "password", 8) == 0) {
pass = tgetpass(prompt, def_ival(I_PW_TIMEOUT) * 60, tgetpass_flags); pass = tgetpass(prompt, def_ival(I_PASSWD_TIMEOUT) * 60,
tgetpass_flags);
} else { } else {
(void) fprintf(stderr, "%s: %s\n", Argv[0], resp); (void) fprintf(stderr, "%s: %s\n", Argv[0], resp);
return(AUTH_FATAL); return(AUTH_FATAL);

View File

@@ -155,7 +155,7 @@ sudo_conv(num_msg, msg, response, appdata_ptr)
p = pm->msg; p = pm->msg;
/* Read the password. */ /* Read the password. */
pr->resp = estrdup((char *) tgetpass(p, pr->resp = estrdup((char *) tgetpass(p,
def_ival(I_PW_TIMEOUT) * 60, tgetpass_flags)); def_ival(I_PASSWD_TIMEOUT) * 60, tgetpass_flags));
if (*pr->resp == '\0') if (*pr->resp == '\0')
nil_pw = 1; /* empty password */ nil_pw = 1; /* empty password */
break; break;

View File

@@ -80,8 +80,8 @@ sudo_collect(timeout, rendition, title, nprompts, prompts)
switch (rendition) { switch (rendition) {
case SIAFORM: case SIAFORM:
case SIAONELINER: case SIAONELINER:
if (timeout <= 0 || timeout > def_ival(I_PW_TIMEOUT) * 60) if (timeout <= 0 || timeout > def_ival(I_PASSWD_TIMEOUT) * 60)
timeout = def_ival(I_PW_TIMEOUT) * 60; timeout = def_ival(I_PASSWD_TIMEOUT) * 60;
/* /*
* Substitute custom prompt if a) the sudo prompt is not "Password:" * Substitute custom prompt if a) the sudo prompt is not "Password:"
* and b) the SIA prompt is "Password:" (so we know it is safe). * and b) the SIA prompt is "Password:" (so we know it is safe).

View File

@@ -99,7 +99,7 @@ verify_user(pw, prompt)
struct passwd *pw; struct passwd *pw;
char *prompt; char *prompt;
{ {
short counter = def_ival(I_PW_TRIES) + 1; short counter = def_ival(I_PASSWD_TRIES) + 1;
short success = AUTH_FAILURE; short success = AUTH_FAILURE;
short status; short status;
char *p; char *p;
@@ -156,7 +156,7 @@ verify_user(pw, prompt)
#ifdef AUTH_STANDALONE #ifdef AUTH_STANDALONE
p = prompt; p = prompt;
#else #else
p = (char *) tgetpass(prompt, def_ival(I_PW_TIMEOUT) * 60, p = (char *) tgetpass(prompt, def_ival(I_PASSWD_TIMEOUT) * 60,
tgetpass_flags); tgetpass_flags);
if (!p || *p == '\0') if (!p || *p == '\0')
nil_pw = 1; nil_pw = 1;
@@ -184,7 +184,7 @@ verify_user(pw, prompt)
/* Exit loop on nil password, but give it a chance to match first. */ /* Exit loop on nil password, but give it a chance to match first. */
if (nil_pw) { if (nil_pw) {
if (counter == def_ival(I_PW_TRIES)) if (counter == def_ival(I_PASSWD_TRIES))
exit(1); exit(1);
else else
break; break;
@@ -214,8 +214,8 @@ cleanup:
return; return;
case AUTH_FAILURE: case AUTH_FAILURE:
log_error(NO_MAIL, "%d incorrect password attempt%s", log_error(NO_MAIL, "%d incorrect password attempt%s",
def_ival(I_PW_TRIES) - counter, def_ival(I_PASSWD_TRIES) - counter,
(def_ival(I_PW_TRIES) - counter == 1) ? "" : "s"); (def_ival(I_PASSWD_TRIES) - counter == 1) ? "" : "s");
case AUTH_FATAL: case AUTH_FATAL:
exit(1); exit(1);
} }
@@ -231,7 +231,7 @@ pass_warn(fp)
(void) fprintf(fp, "%s\n", INSULT); (void) fprintf(fp, "%s\n", INSULT);
else else
#endif #endif
(void) fprintf(fp, "%s\n", def_str(I_BADPASS_MSG)); (void) fprintf(fp, "%s\n", def_str(I_BADPASS_MESSAGE));
} }
void void