[Pkg-shadow-commits] r2745 - in upstream/trunk: . src
Nicolas FRANÇOIS
nekral-guest at alioth.debian.org
Wed Apr 22 20:15:22 UTC 2009
Author: nekral-guest
Date: 2009-04-22 20:15:21 +0000 (Wed, 22 Apr 2009)
New Revision: 2745
Modified:
upstream/trunk/ChangeLog
upstream/trunk/src/login.c
Log:
* src/login.c: timeout, delay, and retries should be unsigned.
* src/login.c: Ignore the return value of alarm() and sleep().
Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog 2009-04-22 20:12:06 UTC (rev 2744)
+++ upstream/trunk/ChangeLog 2009-04-22 20:15:21 UTC (rev 2745)
@@ -1,5 +1,10 @@
2009-04-22 Nicolas François <nicolas.francois at 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 at centraliens.net>
+
* src/login.c: If we cannot get the terminal configuration, do not
change the terminal configuration. setup_tty() is just a best
effort configuration of the terminal.
Modified: upstream/trunk/src/login.c
===================================================================
--- upstream/trunk/src/login.c 2009-04-22 20:12:06 UTC (rev 2744)
+++ upstream/trunk/src/login.c 2009-04-22 20:15:21 UTC (rev 2745)
@@ -101,7 +101,7 @@
static bool preauth_flag = false;
static bool amroot;
-static int timeout;
+static unsigned int timeout;
/*
* External identifiers.
@@ -413,7 +413,7 @@
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);
}
@@ -522,8 +522,8 @@
#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
@@ -695,14 +695,14 @@
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);
@@ -847,7 +847,7 @@
}
/* We don't get here unless they were authenticated above */
- alarm (0);
+ (void) alarm (0);
}
/* Check the account validity */
@@ -1065,7 +1065,7 @@
* before the sleep() below completes, login will exit.
*/
if (delay > 0) {
- sleep (delay);
+ (void) sleep (delay);
}
puts (_("Login incorrect"));
@@ -1078,7 +1078,7 @@
} /* while (true) */
#endif /* ! USE_PAM */
- alarm (0); /* turn off alarm clock */
+ (void) alarm (0); /* turn off alarm clock */
#ifndef USE_PAM /* PAM does this */
/*
More information about the Pkg-shadow-commits
mailing list