Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Oct 2004 12:05:34 -0700 (PDT)
From:      "Michael C.Shultz" <ringworm@inbox.lv>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/73292: [MAINTAINER] sysutils/portmanager minor fix
Message-ID:  <20041029190534.86D152CE7AE@ringworm.mechee.com>
Resent-Message-ID: <200410291910.i9TJAPtw091322@freefall.freebsd.org>

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

>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	<pmupgrade.h>
+ 
+ #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:



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