status = timestamp_status(timestampdir, timestampfile, user_name, TS_MAKE_DIRS);
if (status != TS_CURRENT || ISSET(validated, FLAG_CHECK_USER)) {
/* Bail out if we are non-interactive and a password is required */
if (ISSET(mode, MODE_NONINTERACTIVE)) { warningx(_("sorry, a password is required to run %s"), getprogname());
rval = -1;
goto done;
}
/* XXX - should not lecture if askpass helper is being used. */ lecture(status);
/* Expand any escapes in the prompt. */
prompt = expand_prompt(user_prompt ? user_prompt : def_passprompt, user_name, user_shost);
rval = verify_user(auth_pw, prompt);
}
/* Only update timestamp if user was validated. */
if (rval == TRUE && ISSET(validated, VALIDATE_OK) && !ISSET(mode, MODE_IGNORE_TICKET) && status != TS_ERROR) update_timestamp(timestampdir, timestampfile);
Sworddragon, I believe this code from plugins/ sudoers/ check.c in check_user() prevents the tty reuse problem:
/* Stash the tty's ctime for tty ticket comparison. */
tty_info. dev = sb.st_dev;
tty_info. ino = sb.st_ino;
tty_info. rdev = sb.st_rdev; devpts( user_ttypath) )
ctim_ get(&sb, &tty_info.ctime);
if (def_tty_tickets && user_ttypath && stat(user_ttypath, &sb) == 0) {
if (tty_is_
}
if (build_ timestamp( ×tampdir, ×tampfile) == -1) {
rval = -1;
goto done;
}
status = timestamp_ status( timestampdir, timestampfile, user_name,
TS_MAKE_ DIRS);
if (status != TS_CURRENT || ISSET(validated, FLAG_CHECK_USER)) { TIVE)) {
warningx( _("sorry, a password is required to run %s"), getprogname());
/* Bail out if we are non-interactive and a password is required */
if (ISSET(mode, MODE_NONINTERAC
rval = -1;
goto done;
}
/* XXX - should not lecture if askpass helper is being used. */
lecture( status) ;
/* Expand any escapes in the prompt. */ prompt( user_prompt ? user_prompt : def_passprompt,
user_ name, user_shost);
prompt = expand_
rval = verify_ user(auth_ pw, prompt);
!ISSET( mode, MODE_IGNORE_TICKET) && status != TS_ERROR)
update_ timestamp( timestampdir, timestampfile);
}
/* Only update timestamp if user was validated. */
if (rval == TRUE && ISSET(validated, VALIDATE_OK) &&
Thanks