From gnat@himalia.frii.com  Thu Aug  7 14:05:43 1997
Received: from himalia.frii.com (himalia.frii.com [208.146.240.8])
          by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id OAA01088
          for <FreeBSD-gnats-submit@freebsd.org>; Thu, 7 Aug 1997 14:05:42 -0700 (PDT)
Received: (from gnat@localhost) by himalia.frii.com (8.8.5/8.7.3) id OAA28841; Thu, 7 Aug 1997 14:57:43 -0600 (MDT)
Message-Id: <199708072057.OAA28841@himalia.frii.com>
Date: Thu, 7 Aug 1997 14:57:43 -0600 (MDT)
From: gnat@frii.com
Reply-To: gnat@frii.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: /usr/sbin/quot isn't 64-bit off_t clean
X-Send-Pr-Version: 3.2

>Number:         4246
>Category:       bin
>Synopsis:       /usr/sbin/quot isn't 64-bit off_t clean
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Aug  7 14:10:01 PDT 1997
>Closed-Date:    Wed Aug 13 05:11:31 PDT 1997
>Last-Modified:  Wed Aug 13 05:18:04 PDT 1997
>Originator:     Nathan Torkington
>Release:        FreeBSD 2.2.2-RELEASE i386
>Organization:
Interchangeable Antipodeans, Inc.
>Environment:

Found in FreeBSD 2.2.2.

>Description:

/usr/sbin/quot calls lseek() without casting the offset to off_t.
This makes breakage on filesystems where the offset is > 2**31.

>How-To-Repeat:

Use quot on a big filesystem (4gig?).

>Fix:
	
gnat@himalia (quot) diff quot.c new-quot.c
97,98c97
<               if (lseek(fd,ino_to_fsba(super,last) << super->fs_fshift,0) < 0
<                   || read(fd,ip,INOSZ(super)) != INOSZ(super)) {
---
>               if (lseek(fd,(off_t) ino_to_fsba(super,last) << super->fs_fshift,0) < (off_t)0 || read(fd,ip,INOSZ(super)) != INOSZ(super)) {


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: jkh 
State-Changed-When: Wed Aug 13 05:11:31 PDT 1997 
State-Changed-Why:  
Fix applied to RELENG_2_2 and -current; thanks! 
>Unformatted:
