From nobody  Fri Nov 14 11:12:08 1997
Received: (from nobody@localhost)
          by hub.freebsd.org (8.8.7/8.8.7) id LAA24144;
          Fri, 14 Nov 1997 11:12:08 -0800 (PST)
          (envelope-from nobody)
Message-Id: <199711141912.LAA24144@hub.freebsd.org>
Date: Fri, 14 Nov 1997 11:12:08 -0800 (PST)
From: rich@math.missouri.edu
To: freebsd-gnats-submit@freebsd.org
Subject: Linux emul: Missing offset assignment in linux_truncate function
X-Send-Pr-Version: www-1.0

>Number:         5044
>Category:       i386
>Synopsis:       Linux emul: Missing offset assignment in linux_truncate function
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Nov 14 11:20:01 PST 1997
>Closed-Date:    Sun Mar 22 13:21:49 PST 1998
>Last-Modified:  Sun Mar 22 13:22:24 PST 1998
>Originator:     Richard Winkel
>Release:        2.2.5
>Organization:
Univ of Missouri
>Environment:
FreeBSD lisa.math.missouri.edu 2.2.5-STABLE FreeBSD 2.2.5-STABLE #0:
 Thu Nov  6 13:47:01 CST 1997     root@:/usr/src/sys/compile/g6_200_1  
i386
>Description:
Linux function "linux_truncate" forgets to assign callers offset
argument to bsd "otruncate" argument.  Results in a random offset,
which adds MB's of nulls to the end of the affected file.

>How-To-Repeat:
Problem is triggered by linux port of mathematica.  All file saves
results in huge files which consist of the actual data followed by
MB's of nulls.
>Fix:
At bottom of /usr/src/sys/i386/linux/linux_file.c, insert one line:

        bsd.path = args->path;
        bsd.length = args->length;   /* this is the fix */
        
        return otruncate(p, &bsd, retval);

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: steve 
State-Changed-When: Sun Mar 22 13:21:49 PST 1998 
State-Changed-Why:  
Fixed by jmb in both -current and -stable. 
>Unformatted:
