* verify who he/she is.
*/
void
-check_user(override)
- int override;
+check_user(validated)
+ int validated;
{
char *timestampdir = NULL;
char *timestampfile = NULL;
build_timestamp(×tampdir, ×tampfile);
status = timestamp_status(timestampdir, timestampfile, user_name,
TS_MAKE_DIRS);
- if (override || status != TS_CURRENT) {
+ if (status != TS_CURRENT || ISSET(validated, FLAG_CHECK_USER)) {
lecture(status);
/* Expand any escapes in the prompt. */
verify_user(auth_pw, prompt);
}
- if (status != TS_ERROR)
+ /* Only update timestamp if user was validated. */
+ if (status != TS_ERROR && ISSET(validated, VALIDATE_OK))
update_timestamp(timestampdir, timestampfile);
efree(timestampdir);
efree(timestampfile);
/* Require a password if sudoers says so. */
if (def_authenticate)
- check_user(ISSET(validated, FLAG_CHECK_USER));
+ check_user(validated);
/* If run as root with SUDO_USER set, set sudo_user.pw to that user. */
/* XXX - causes confusion when root is not listed in sudoers */