aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvodz <vodz@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-01-31 11:16:40 +0000
committervodz <vodz@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-01-31 11:16:40 +0000
commit7d1ec35a57352c41a4f2046d3c6cf709bba2153d (patch)
treef483983f797a93b5d117d9e3f29f82db07d26d48
parent18a21473c50d65ad8fb480d369aebd2f1dafd8ed (diff)
downloadbusybox-w32-7d1ec35a57352c41a4f2046d3c6cf709bba2153d.tar.gz
busybox-w32-7d1ec35a57352c41a4f2046d3c6cf709bba2153d.tar.bz2
busybox-w32-7d1ec35a57352c41a4f2046d3c6cf709bba2153d.zip
destroy potential overflow for x86_64. Added ATTRIBUTE_UNUSED
git-svn-id: svn://busybox.net/trunk/busybox@13752 69ca8d6d-28ef-0310-b511-8ec308f3f277
-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 );
52static void motd ( void ); 52static void motd ( void );
53 53
54 54
55static void alarm_handler ( int sig ) 55static void alarm_handler ( int sig ATTRIBUTE_UNUSED)
56{ 56{
57 fprintf (stderr, "\nLogin timed out after %d seconds.\n", TIMEOUT ); 57 fprintf (stderr, "\nLogin timed out after %d seconds.\n", TIMEOUT );
58 exit ( EXIT_SUCCESS ); 58 exit ( EXIT_SUCCESS );
@@ -432,6 +432,8 @@ static void checkutmp(int picky)
432 if (ut) { 432 if (ut) {
433 utent = *ut; 433 utent = *ut;
434 } else { 434 } else {
435 time_t t_tmp;
436
435 if (picky) { 437 if (picky) {
436 puts(NO_UTENT); 438 puts(NO_UTENT);
437 exit(1); 439 exit(1);
@@ -450,7 +452,8 @@ static void checkutmp(int picky)
450 /* XXX - assumes /dev/tty?? */ 452 /* XXX - assumes /dev/tty?? */
451 strncpy(utent.ut_id, utent.ut_line + 3, sizeof utent.ut_id); 453 strncpy(utent.ut_id, utent.ut_line + 3, sizeof utent.ut_id);
452 strncpy(utent.ut_user, "LOGIN", sizeof utent.ut_user); 454 strncpy(utent.ut_user, "LOGIN", sizeof utent.ut_user);
453 time((time_t*)&utent.ut_time); 455 t_tmp = (time_t)utent.ut_time;
456 time(&t_tmp);
454 } 457 }
455} 458}
456 459
@@ -461,7 +464,7 @@ static void checkutmp(int picky)
461 * USER_PROCESS. the wtmp file will be updated as well. 464 * USER_PROCESS. the wtmp file will be updated as well.
462 */ 465 */
463 466
464static void setutmp(const char *name, const char *line) 467static void setutmp(const char *name, const char *line ATTRIBUTE_UNUSED)
465{ 468{
466 utent.ut_type = USER_PROCESS; 469 utent.ut_type = USER_PROCESS;
467 strncpy(utent.ut_user, name, sizeof utent.ut_user); 470 strncpy(utent.ut_user, name, sizeof utent.ut_user);