+2009-04-22 Nicolas François <nicolas.francois@centraliens.net>
+
+ * src/login.c: timeout, delay, and retries should be unsigned.
+ * src/login.c: Ignore the return value of alarm() and sleep().
+
2009-04-22 Nicolas François <nicolas.francois@centraliens.net>
* src/login.c: If we cannot get the terminal configuration, do not
static bool preauth_flag = false;
static bool amroot;
-static int timeout;
+static unsigned int timeout;
/*
* External identifiers.
static RETSIGTYPE alarm_handler (unused int sig)
{
- fprintf (stderr, _("\nLogin timed out after %d seconds.\n"), timeout);
+ fprintf (stderr, _("\nLogin timed out after %u seconds.\n"), timeout);
exit (0);
}
#if defined(HAVE_STRFTIME) && !defined(USE_PAM)
char ptime[80];
#endif
- int delay;
- int retries;
+ unsigned int delay;
+ unsigned int retries;
bool failed;
bool subroot = false;
#ifndef USE_PAM
top:
/* only allow ALARM sec. for login */
(void) signal (SIGALRM, alarm_handler);
- timeout = getdef_num ("LOGIN_TIMEOUT", ALARM);
+ timeout = getdef_unum ("LOGIN_TIMEOUT", ALARM);
if (timeout > 0) {
- alarm (timeout);
+ (void) alarm (timeout);
}
environ = newenvp; /* make new environment active */
- delay = getdef_num ("FAIL_DELAY", 1);
- retries = getdef_num ("LOGIN_RETRIES", RETRIES);
+ delay = getdef_unum ("FAIL_DELAY", 1);
+ retries = getdef_unum ("LOGIN_RETRIES", RETRIES);
#ifdef USE_PAM
retcode = pam_start ("login", username, &conv, &pamh);
}
/* We don't get here unless they were authenticated above */
- alarm (0);
+ (void) alarm (0);
}
/* Check the account validity */
* before the sleep() below completes, login will exit.
*/
if (delay > 0) {
- sleep (delay);
+ (void) sleep (delay);
}
puts (_("Login incorrect"));
} /* while (true) */
#endif /* ! USE_PAM */
- alarm (0); /* turn off alarm clock */
+ (void) alarm (0); /* turn off alarm clock */
#ifndef USE_PAM /* PAM does this */
/*