summaryrefslogtreecommitdiffhomepage
path: root/loginutils
diff options
context:
space:
mode:
author"Vladimir N. Oleynik" <dzo@simtreas.ru>2006-01-31 11:16:40 +0000
committer"Vladimir N. Oleynik" <dzo@simtreas.ru>2006-01-31 11:16:40 +0000
commit77bb33c47420546ffb0e6f0e92e32e910b092bf0 (patch)
treef483983f797a93b5d117d9e3f29f82db07d26d48 /loginutils
parent9f4a1e1c75e86a38da22a3e82980fcddc4e58717 (diff)
destroy potential overflow for x86_64. Added ATTRIBUTE_UNUSED
Diffstat (limited to 'loginutils')
-rw-r--r--loginutils/login.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/loginutils/login.c b/loginutils/login.c
index 4d513dcb2..35f9e4a9c 100644
--- a/loginutils/login.c
+++ b/loginutils/login.c
@@ -52,7 +52,7 @@ static int login_prompt ( char *buf_name );
static void motd ( void );
-static void alarm_handler ( int sig )
+static void alarm_handler ( int sig ATTRIBUTE_UNUSED)
{
fprintf (stderr, "\nLogin timed out after %d seconds.\n", TIMEOUT );
exit ( EXIT_SUCCESS );
@@ -432,6 +432,8 @@ static void checkutmp(int picky)
if (ut) {
utent = *ut;
} else {
+ time_t t_tmp;
+
if (picky) {
puts(NO_UTENT);
exit(1);
@@ -450,7 +452,8 @@ static void checkutmp(int picky)
/* XXX - assumes /dev/tty?? */
strncpy(utent.ut_id, utent.ut_line + 3, sizeof utent.ut_id);
strncpy(utent.ut_user, "LOGIN", sizeof utent.ut_user);
- time((time_t*)&utent.ut_time);
+ t_tmp = (time_t)utent.ut_time;
+ time(&t_tmp);
}
}
@@ -461,7 +464,7 @@ static void checkutmp(int picky)
* USER_PROCESS. the wtmp file will be updated as well.
*/
-static void setutmp(const char *name, const char *line)
+static void setutmp(const char *name, const char *line ATTRIBUTE_UNUSED)
{
utent.ut_type = USER_PROCESS;
strncpy(utent.ut_user, name, sizeof utent.ut_user);