From root@nlc.net.au  Thu Oct 22 20:03:56 1998
Received: from nhj.nlc.net.au (nhj.nlc.net.au [203.24.133.1])
          by hub.freebsd.org (8.8.8/8.8.8) with SMTP id UAA12340
          for <FreeBSD-gnats-submit@freebsd.org>; Thu, 22 Oct 1998 20:03:54 -0700 (PDT)
          (envelope-from root@nlc.net.au)
Received: (qmail 27824 invoked from network); 23 Oct 1998 13:03:28 +1000
Received: from monster.nlc.net.au (203.24.133.4)
  by nhj.nlc.net.au with SMTP; 23 Oct 1998 13:03:28 +1000
Received: (qmail 23891 invoked by uid 0); 23 Oct 1998 13:03:23 +1000
Message-Id: <19981023030323.23890.qmail@monster.nlc.net.au>
Date: 23 Oct 1998 13:03:23 +1000
From: john@nlc.net.au
Reply-To: john@nlc.net.au
To: FreeBSD-gnats-submit@freebsd.org
Subject: Additional patch needed for radiusd-cistron port
X-Send-Pr-Version: 3.2

>Number:         8419
>Category:       ports
>Synopsis:       Additional patch needed for radiusd-cistron port
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Oct 22 20:10:00 PDT 1998
>Closed-Date:    Sun Oct 25 12:02:32 PST 1998
>Last-Modified:  Sun Oct 25 12:02:42 PST 1998
>Originator:     John Saunders
>Release:        FreeBSD 2.2.7-STABLE i386
>Organization:
NORTHLINK COMMUNICATIONS
>Environment:

	FreeBSD 2.2.7-STABLE. ports package cvsupped october 12th.

>Description:

	The cistron radiusd uses "-sizeof(struct xyz)" constructs
	as the offset passed to lseek. However this is evaluated
	as  32 bit constant but FreeBSD uses 64 bits for an lseek
	offset. The net result is a large positive seek instead
	of the desired small negative one.

>How-To-Repeat:

	Send the cistron radiusd accouting packets.

>Fix:
	
	Replace "-sizeof(struct xyz)" with "-(off_t)sizeof(struct xyz)".
	The following patch needs to be placed in the following
	file /usr/ports/net/radiusd-cistron/patches/patch-ae

--- src/acct.c.orig	Fri Oct 23 12:47:05 1998
+++ src/acct.c	Fri Oct 23 12:48:13 1998
@@ -198,7 +198,7 @@
 			/*
 			 *	Match. Zap it.
 			 */
-			if (lseek(fd, -sizeof(u), SEEK_CUR) < 0) {
+			if (lseek(fd, -(off_t)sizeof(u), SEEK_CUR) < 0) {
 				log(L_ERR, "Accounting: radzap: negative lseek!\n");
 				lseek(fd, 0, SEEK_SET);
 			}
@@ -439,7 +439,7 @@
 				r = -1;
 				break;
 			}
-			if (lseek(fd, -sizeof(u), SEEK_CUR) < 0) {
+			if (lseek(fd, -(off_t)sizeof(u), SEEK_CUR) < 0) {
 				log(L_ERR, "Accounting: negative lseek!\n");
 				lseek(fd, 0, SEEK_SET);
 			}
@@ -1005,7 +1005,7 @@
 				 *	False record - zap it.
 				 */
 
-				lseek(fd, -sizeof(u), SEEK_CUR);
+				lseek(fd, -(off_t)sizeof(u), SEEK_CUR);
 				write(fd, &empty, sizeof(empty));
 
 				if ((wfp = fopen(RADWTMP, "a")) != NULL) {

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: fenner 
State-Changed-When: Sun Oct 25 12:02:32 PST 1998 
State-Changed-Why:  
Committed, thanks! 
>Unformatted:
