diff --git a/ports-mgmt/portmanager/Makefile b/ports-mgmt/portmanager/Makefile index b112b5d4e38f..be42a2f5ba7e 100644 --- a/ports-mgmt/portmanager/Makefile +++ b/ports-mgmt/portmanager/Makefile @@ -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 --git a/ports-mgmt/portmanager/files/patch-ac b/ports-mgmt/portmanager/files/patch-ac new file mode 100644 index 000000000000..4212684a7470 --- /dev/null +++ b/ports-mgmt/portmanager/files/patch-ac @@ -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 + diff --git a/sysutils/portmanager/Makefile b/sysutils/portmanager/Makefile index b112b5d4e38f..be42a2f5ba7e 100644 --- a/sysutils/portmanager/Makefile +++ b/sysutils/portmanager/Makefile @@ -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 --git a/sysutils/portmanager/files/patch-ac b/sysutils/portmanager/files/patch-ac new file mode 100644 index 000000000000..4212684a7470 --- /dev/null +++ b/sysutils/portmanager/files/patch-ac @@ -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 +