LinuxSecurity.com
Share your story
The central voice for Linux and Open Source security news
Home News Topics Advisories HOWTOs Features Newsletters About Register

Welcome!
Sign up!
EnGarde Community
Login
Polls
What is the most important Linux security technology?
 
Advisories
Community
Linux Events
Linux User Groups
Link to Us
Security Center
Book Reviews
Security Dictionary
Security Tips
SELinux
White Papers
Featured Blogs
All About Linux
DanWalsh LiveJournal
Securitydistro
Latest Newsletters
Linux Security Week: November 17th, 2014
Linux Advisory Watch: November 14th, 2014
Subscribe
LinuxSecurity Newsletters
E-mail:
Choose Lists:
About our Newsletters
RSS Feeds
Get the LinuxSecurity news you want faster with RSS
Powered By

  
OpenBSD 2.6: at(1) Y2K Fix Print E-mail
User Rating:      How can I rate this item?
Posted by LinuxSecurity.com Team   
OpenBSD The at(1) command was unable to parse some kinds of dates.
Apply by doing:
        cd /usr/src
        patch -p0 < 015_aty2k.patch
	cd usr.bin/at
	make
	make install

Index: usr.bin/at/at.c
===================================================================
RCS file: /cvs/src/usr.bin/at/at.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- usr.bin/at/at.c	1998/07/09 20:40:58	1.16
+++ usr.bin/at/at.c	1999/12/15 05:33:06	1.17
@@ -197,7 +197,7 @@
 
 	sigaction(SIGINT, &act, NULL);
 
-	(void)strcpy(atfile, _PATH_ATJOBS);
+	(void)strlcpy(atfile, _PATH_ATJOBS, sizeof atfile);
 	ppos = atfile + strlen(atfile);
 
 	/*
Index: usr.bin/at/parsetime.c
===================================================================
RCS file: /cvs/src/usr.bin/at/parsetime.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- usr.bin/at/parsetime.c	1999/03/21 04:04:42	1.8
+++ usr.bin/at/parsetime.c	2000/01/05 08:06:25	1.9
@@ -443,21 +443,23 @@
 	struct tm *tm;
 	int mday, mon, year;
 {
-	if (year > 99) {
-	    if (year >= TM_YEAR_BASE)
-		    year -= TM_YEAR_BASE;
-	    else
-		    panic("garbled time");
-	} else if (year != -1) {
-		/*
-		 * check if the specified year is in the next century.
-		 * allow for one year of user error as many people will
-		 * enter n - 1 at the start of year n.
-		 */
-		if (year < tm->tm_year % 100 - 1)
-			year += 100;
-		/* adjust for the year 2000 and beyond */
-		year += tm->tm_year - (tm->tm_year % 100);
+
+	/*
+	 * Convert year into tm_year format (year - 1900).
+	 * We may be given the year in 2 digit, 4 digit, or tm_year format.
+	 */
+	if (year != -1) {
+		if (year >= TM_YEAR_BASE)
+			year -= TM_YEAR_BASE;	/* convert from 4 digit year */
+		else if (year < 100) {
+			/* Convert to tm_year assuming current century */
+			year += (tm->tm_year / 100) * 100;
+
+			if (year == tm->tm_year - 1)
+				year++;		/* Common off by one error */
+			else if (year < tm->tm_year)
+				year += 100;	/* must be in next century */
+		}
 	}
 
 	if (year < 0 &&
 
< Prev   Next >
    
Partner

 

Latest Features
Peter Smith Releases Linux Network Security Online
Securing a Linux Web Server
Password guessing with Medusa 2.0
Password guessing as an attack vector
Squid and Digest Authentication
Squid and Basic Authentication
Demystifying the Chinese Hacking Industry: Earning 6 Million a Night
Free Online security course (LearnSIA) - A Call for Help
What You Need to Know About Linux Rootkits
Review: A Practical Guide to Fedora and Red Hat Enterprise Linux - Fifth Edition
Yesterday's Edition
Next year's DDoS attacks to come from Vietnam, India and Indonesia
Web Site Security Certificates Soon To Be Free and Easy
Hacker Lexicon: What Is the Dark Web?
Partner Sponsor

Community | HOWTOs | Blogs | Features | Book Reviews | Networking
 Security Projects |  Latest News |  Newsletters |  SELinux |  Privacy |  Home
 Hardening |   About Us |   Advertise |   Legal Notice |   RSS |   Guardian Digital
(c)Copyright 2014 Guardian Digital, Inc. All rights reserved.