Skip site navigation (1)Skip section navigation (2)
Date:      23 Oct 1998 13:03:23 +1000
From:      john@nlc.net.au
To:        FreeBSD-gnats-submit@FreeBSD.ORG
Subject:   ports/8419: Additional patch needed for radiusd-cistron port
Message-ID:  <19981023030323.23890.qmail@monster.nlc.net.au>

next in thread | raw e-mail | index | archive | help

>Number:         8419
>Category:       ports
>Synopsis:       Additional patch needed for radiusd-cistron port
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports
>State:          open
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Oct 22 20:10:00 PDT 1998
>Last-Modified:
>Originator:     John Saunders
>Organization:
NORTHLINK COMMUNICATIONS
>Release:        FreeBSD 2.2.7-STABLE i386
>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) {

>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19981023030323.23890.qmail>