From owner-freebsd-ports-bugs@FreeBSD.ORG Fri Oct 29 19:10:26 2004 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 56A5916A4DB for ; Fri, 29 Oct 2004 19:10:26 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1DF0843D48 for ; Fri, 29 Oct 2004 19:10:26 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i9TJAPfT091323 for ; Fri, 29 Oct 2004 19:10:26 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i9TJAPtw091322; Fri, 29 Oct 2004 19:10:25 GMT (envelope-from gnats) Resent-Date: Fri, 29 Oct 2004 19:10:25 GMT Resent-Message-Id: <200410291910.i9TJAPtw091322@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, "Michael C.Shultz" Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1DE0E16A4D0 for ; Fri, 29 Oct 2004 19:06:52 +0000 (GMT) Received: from out008.verizon.net (out008pub.verizon.net [206.46.170.108]) by mx1.FreeBSD.org (Postfix) with ESMTP id AB36743D53 for ; Fri, 29 Oct 2004 19:06:51 +0000 (GMT) (envelope-from mike@inbox.lv) Received: from ringworm.mechee.com ([4.26.226.89]) by out008.verizon.net (InterMail vM.5.01.06.06 201-253-122-130-106-20030910) with ESMTP id <20041029190650.FCPZ17228.out008.verizon.net@ringworm.mechee.com> for ; Fri, 29 Oct 2004 14:06:50 -0500 Received: by ringworm.mechee.com (Postfix, from userid 1001) id 86D152CE7AE; Fri, 29 Oct 2004 12:05:34 -0700 (PDT) Message-Id: <20041029190534.86D152CE7AE@ringworm.mechee.com> Date: Fri, 29 Oct 2004 12:05:34 -0700 (PDT) From: "Michael C.Shultz" To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: ports/73292: [MAINTAINER] sysutils/portmanager minor fix X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: "Michael C.Shultz" List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Oct 2004 19:10:26 -0000 >Number: 73292 >Category: ports >Synopsis: [MAINTAINER] sysutils/portmanager minor fix >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: maintainer-update >Submitter-Id: current-users >Arrival-Date: Fri Oct 29 19:10:25 GMT 2004 >Closed-Date: >Last-Modified: >Originator: Michael C. Shultz >Release: FreeBSD 5.3-STABLE i386 >Organization: >Environment: System: FreeBSD ringworm.mechee.com 5.3-STABLE FreeBSD 5.3-STABLE #0: Sun Oct 24 05:04:58 PDT 2004 mike@ringworm.mechee.com:/usr/obj/usr/src/sys/RINGWORM i386 >Description: portmanager seg faults when an installed port's +CONTENTS file has no "@comment ORIGIN:" in it. >How-To-Repeat: install bsdpan-GDTextUtil-0.86 then run portmanager >Fix: patch-ac fixes this problem. ***Note added file files/patch-ac*** --- portmanager.shar begins here --- diff -ruN /usr/ports/sysutils/portmanager/Makefile portmanager/Makefile --- /usr/ports/sysutils/portmanager/Makefile Tue Oct 12 09:07:04 2004 +++ portmanager/Makefile Fri Oct 29 11:49:34 2004 @@ -7,7 +7,7 @@ PORTNAME= portmanager PORTVERSION= 0.2.0 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= sysutils MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} MASTER_SITE_SUBDIR= portmanager diff -ruN /usr/ports/sysutils/portmanager/files/patch-ac portmanager/files/patch-ac --- /usr/ports/sysutils/portmanager/files/patch-ac Wed Dec 31 16:00:00 1969 +++ portmanager/files/patch-ac Thu Oct 28 15:43:02 2004 @@ -0,0 +1,74 @@ +diff -ruN ./libPMGR/src/PMGRrDbCreate.c ../../portmanager-0.2.0/libPMGR/src/PMGRrDbCreate.c +--- ./libPMGR/src/PMGRrDbCreate.c Thu Aug 12 02:19:05 2004 ++++ ../../portmanager-0.2.0/libPMGR/src/PMGRrDbCreate.c Thu Oct 28 15:28:20 2004 +@@ -55,6 +55,7 @@ + char* portDependencyDir = NULL; + char* portDir = NULL; + char* portName = NULL; ++ int address = 0; + int errorCode = 0; + int idx = 0; + int portDependencyDirLen = 0; +@@ -140,10 +141,46 @@ + } + fread( portBuffer, 1, size, portStream ); + portBuffer[size+1] = 0; +- portName = strstr( portBuffer, "@name " ) + strlen( "@name " ); +- portNameLen = strstr( portName, "\n" ) - portName; +- portDir = strstr( portBuffer, "@comment ORIGIN:" ) + strlen( "@comment ORIGIN:" ); +- portDirLen = strstr( portDir, "\n" ) - portDir; ++ ++ /* sets portName to start address of portname */ ++ /* ver 0.2.0_3 added error checking for @name not found int +CONTENTS file */ ++ if( (address = (int)strnstr(portBuffer, "@name ", size)) == 0 ) ++ { ++ fprintf( stderr, "%s %s error: \"@name\" not found in %s\n", id, ver, pkg.portDirName ); ++ fprintf( stderr, "\t\t%s installation is corrupt!\n", pkg.entry->d_name ); ++ fprintf( stderr, "\t\trecomend running \"pkg_delete -f %s\" then manually reinstalling this port\n", pkg.entry->d_name ); ++ return(1); ++ } ++ portName = (char*)(address + strlen("@name ")); ++ ++ if( (address = (int)strnstr(portName, "\n", 256)) == 0 ) ++ { ++ fprintf( stderr, "%s %s portName error: \"end of line\" not found in %s\n", id, ver, pkg.portDirName ); ++ fprintf( stderr, "\t\t%s installation is corrupt!\n", pkg.entry->d_name ); ++ fprintf( stderr, "\t\trecomend running \"pkg_delete -f %s\" then manually reinstalling this port\n", pkg.entry->d_name ); ++ return(1); ++ } ++ portNameLen = address - (int)portName; ++ ++ if( (address = (int)strnstr(portBuffer, "@comment ORIGIN:", size)) == 0 ) ++ { ++ fprintf( stderr, "%s %s error: \"@comment ORIGIN:\" not found in %s\n", id, ver, pkg.portDirName ); ++ fprintf( stderr, "\t\t%s installation is corrupt!\n", pkg.entry->d_name ); ++ fprintf( stderr, "\t\trecomend running \"pkg_delete -f %s\" then manually reinstalling this port\n", pkg.entry->d_name ); ++ return(1); ++ } ++ portDir = (char*)(address + strlen("@comment ORIGIN:")); ++ ++ ++ if( (address = (int)strnstr(portDir, "\n", 256)) == 0 ) ++ { ++ fprintf( stderr, "%s %s portDir error: \"end of line\" not found in %s\n", id, ver, pkg.portDirName ); ++ fprintf( stderr, "\t\t%s installation is corrupt!\n", pkg.entry->d_name ); ++ fprintf( stderr, "\t\trecomend running \"pkg_delete -f %s\" then manually reinstalling this port\n", pkg.entry->d_name ); ++ return(1); ++ } ++ portDirLen = address - (int)portDir; ++ + portName[portNameLen] = 0; + portDir[portDirLen] = 0; + fprintf( portIStream, "%s%c%s%c\n", portName, NULL, portDir, NULL ); +diff -ruN ./libPMGR/src/libPMGR.h ../../portmanager-0.2.0/libPMGR/src/libPMGR.h +--- ./libPMGR/src/libPMGR.h Thu Oct 28 15:33:54 2004 ++++ ../../portmanager-0.2.0/libPMGR/src/libPMGR.h Thu Oct 28 15:31:41 2004 +@@ -33,7 +33,7 @@ + #include + + #ifndef VER +-static char ver[] = "0.2.0_2"; ++static char ver[] = "0.2.0_3"; + #define VER 1 + #endif + --- portmanager.shar ends here --- >Release-Note: >Audit-Trail: >Unformatted: