From amesbury@oitsec.umn.edu  Wed Feb 15 22:01:34 2006
Return-Path: <amesbury@oitsec.umn.edu>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id D65FF16A420
	for <bug-followup@FreeBSD.org>; Wed, 15 Feb 2006 22:01:34 +0000 (GMT)
	(envelope-from amesbury@oitsec.umn.edu)
Received: from mail.oitsec.umn.edu (mail.oitsec.umn.edu [128.101.238.120])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 7EFB543D45
	for <bug-followup@FreeBSD.org>; Wed, 15 Feb 2006 22:01:34 +0000 (GMT)
	(envelope-from amesbury@oitsec.umn.edu)
Received: from localhost (localhost [127.0.0.1])
	by mail.oitsec.umn.edu (Postfix) with ESMTP id C6B5A1CC039
	for <bug-followup@FreeBSD.org>; Wed, 15 Feb 2006 16:01:33 -0600 (CST)
Received: from mail.oitsec.umn.edu ([127.0.0.1])
 by localhost (mail.oitsec.umn.edu [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 72010-02 for <bug-followup@FreeBSD.org>;
 Wed, 15 Feb 2006 16:01:33 -0600 (CST)
Received: from [160.94.247.212] (paulaner.oitsec.umn.edu [160.94.247.212])
	by mail.oitsec.umn.edu (Postfix) with ESMTP id 9055B1CC02F
	for <bug-followup@FreeBSD.org>; Wed, 15 Feb 2006 16:01:33 -0600 (CST)
Message-Id: <43F3A4BD.2070905@oitsec.umn.edu>
Date: Wed, 15 Feb 2006 16:01:33 -0600
From: Alan Amesbury <amesbury@oitsec.umn.edu>
To: bug-followup@FreeBSD.org
Subject: Re: tcpslice(1) incorrectly handles dates where year is >=2000

>Number:         93410
>Category:       bin
>Synopsis:       Re: tcpslice(1) incorrectly handles dates where year is >=2000
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Feb 15 22:10:06 GMT 2006
>Closed-Date:    Thu Feb 16 09:10:45 GMT 2006
>Last-Modified:  Thu Feb 16 09:10:45 GMT 2006
>Originator:     
>Release:        
>Organization:
>Environment:
>Description:
 NEW!  WITH PATCH!  :-)
 
 This bug is present in 5.4-RELEASE and 6.0-RELEASE.  I believe this
 patch for /usr/src/usr.sbin/tcpdump/tcpslice/gwtm2secs.c fixes the problem:
 
 --- gwtm2secs.c.orig    Wed Feb 15 15:49:46 2006
 +++ gwtm2secs.c Wed Feb 15 15:50:45 2006
 @@ -46,11 +46,9 @@
          * 2-digit years are either 19xx or 20xx - a simple heuristic
          * distinguishes them, since we can't represent any time < 1970.
          */
 -       if ( year < 100 )
 -               if ( year >= 70 )
 -                       year += 1900;
 -               else
 -                       year += 2000;
 +       year += 1900;
 +       if ( year < 1970 )
 +               year += 100;
  
         days = 0;
         for ( i = 1970; i < year; ++i )
 
 
 
 
 I've tested the patch against a 5.4-RELEASE-p11 source tree.  The
 resulting binary seems to pass the tests I submitted in my original PR.
 
 
 --
 Alan Amesbury
 University of Minnesota
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: linimon 
State-Changed-When: Thu Feb 16 09:10:06 UTC 2006 
State-Changed-Why:  
Misfiled followup to bin/82207; content migrated. 


Responsible-Changed-From-To: gnats-admin->freebsd-bugs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Thu Feb 16 09:10:06 UTC 2006 
Responsible-Changed-Why:  

http://www.freebsd.org/cgi/query-pr.cgi?pr=93410 
>Unformatted:
