From 604990dfa7c170628364a2c865097df331a8ebe6 Mon Sep 17 00:00:00 2001 From: Danny Rawlins Date: Sun, 16 Oct 2011 19:03:30 +1100 Subject: [PATCH] fontforge: 20100501 -> 20110222 picked up orphaned port --- fontforge/.footprint | 10 ++- fontforge/.md5sum | 5 +- fontforge/CVE-2010-4259.patch | 51 -------------- fontforge/Pkgfile | 34 ++++++---- .../fontforge-20110222-libz.so-linkage.patch | 66 +++++++++++++++++++ 5 files changed, 100 insertions(+), 66 deletions(-) delete mode 100644 fontforge/CVE-2010-4259.patch create mode 100644 fontforge/fontforge-20110222-libz.so-linkage.patch diff --git a/fontforge/.footprint b/fontforge/.footprint index af8be5a0d..608c7e51a 100644 --- a/fontforge/.footprint +++ b/fontforge/.footprint @@ -16,7 +16,7 @@ drwxr-xr-x root/root usr/include/fontforge/ -rw-r--r-- root/root usr/include/fontforge/chardata.h -rw-r--r-- root/root usr/include/fontforge/charset.h -rw-r--r-- root/root usr/include/fontforge/config.h --rw-r--r-- root/root usr/include/fontforge/configure-pfaedit.h +-rw-r--r-- root/root usr/include/fontforge/configure-fontforge.h -rw-r--r-- root/root usr/include/fontforge/delta.h -rw-r--r-- root/root usr/include/fontforge/dynamic.h -rw-r--r-- root/root usr/include/fontforge/edgelist.h @@ -25,6 +25,7 @@ drwxr-xr-x root/root usr/include/fontforge/ -rw-r--r-- root/root usr/include/fontforge/fffreetype.h -rw-r--r-- root/root usr/include/fontforge/ffpython.h -rw-r--r-- root/root usr/include/fontforge/fileutil.h +-rw-r--r-- root/root usr/include/fontforge/fontforge.h -rw-r--r-- root/root usr/include/fontforge/fontforgevw.h -rw-r--r-- root/root usr/include/fontforge/fvmetrics.h -rw-r--r-- root/root usr/include/fontforge/gdraw.h @@ -48,7 +49,6 @@ drwxr-xr-x root/root usr/include/fontforge/ -rw-r--r-- root/root usr/include/fontforge/namehash.h -rw-r--r-- root/root usr/include/fontforge/nonlineartrans.h -rw-r--r-- root/root usr/include/fontforge/ofl.h --rw-r--r-- root/root usr/include/fontforge/pfaedit.h -rw-r--r-- root/root usr/include/fontforge/plugins.h -rw-r--r-- root/root usr/include/fontforge/print.h -rw-r--r-- root/root usr/include/fontforge/psfont.h @@ -98,6 +98,12 @@ drwxr-xr-x root/root usr/man/man1/ -rw-r--r-- root/root usr/man/man1/sfddiff.1.gz drwxr-xr-x root/root usr/share/ drwxr-xr-x root/root usr/share/fontforge/ +-rw-r--r-- root/root usr/share/fontforge/Adobe-CNS1-5.cidmap +-rw-r--r-- root/root usr/share/fontforge/Adobe-GB1-5.cidmap +-rw-r--r-- root/root usr/share/fontforge/Adobe-Identity-0.cidmap +-rw-r--r-- root/root usr/share/fontforge/Adobe-Japan1-6.cidmap +-rw-r--r-- root/root usr/share/fontforge/Adobe-Japan2-0.cidmap +-rw-r--r-- root/root usr/share/fontforge/Adobe-Korea1-2.cidmap drwxr-xr-x root/root usr/share/fontforge/pixmaps/ -rw-r--r-- root/root usr/share/fontforge/pixmaps/colorwheel.png -rw-r--r-- root/root usr/share/fontforge/pixmaps/editclear.png diff --git a/fontforge/.md5sum b/fontforge/.md5sum index e84e599c6..bf228196e 100644 --- a/fontforge/.md5sum +++ b/fontforge/.md5sum @@ -1,2 +1,3 @@ -17912437f45886a394aefa30e7310bd9 CVE-2010-4259.patch -5f3d20d645ec1aa2b7b4876386df8717 fontforge_full-20100501.tar.bz2 +063691163e592515b31514515bb3ce8c cidmaps.tgz +d0a4a99a711e60b91bef3e2944e49cdb fontforge-20110222-libz.so-linkage.patch +5be4dda345b5d73a27cc399df96e463a fontforge_full-20110222.tar.bz2 diff --git a/fontforge/CVE-2010-4259.patch b/fontforge/CVE-2010-4259.patch deleted file mode 100644 index d965dcc57..000000000 --- a/fontforge/CVE-2010-4259.patch +++ /dev/null @@ -1,51 +0,0 @@ ---- fontforge/fontforge/fvimportbdf.c 15 Apr 2010 10:47:36 -0000 1.58 -+++ fontforge/fontforge/fvimportbdf.c 3 Dec 2010 21:03:38 -0000 -@@ -560,7 +560,7 @@ - } - - if ( strcmp(tok,"FONT")==0 ) { -- if ( sscanf(buf,"-%*[^-]-%[^-]-%[^-]-%[^-]-%*[^-]-", family, weight, italic )!=0 ) { -+ if ( sscanf(buf,"-%*[^-]-%99[^-]-%99[^-]-%99[^-]-%*[^-]-", family, weight, italic )!=0 ) { - char *pt=buf; - int dcnt=0; - while ( *pt=='-' && dcnt<7 ) { ++pt; ++dcnt; } -@@ -616,26 +616,30 @@ - sscanf(buf, "%d", &defs->metricsset ); - else if ( strcmp(tok,"VVECTOR")==0 ) - sscanf(buf, "%*d %d", &defs->vertical_origin ); -+ /* For foundry, fontname and encname, only copy up to the buffer size */ - else if ( strcmp(tok,"FOUNDRY")==0 ) -- sscanf(buf, "%[^\"]", foundry ); -+ sscanf(buf, "%99[^\"]", foundry ); - else if ( strcmp(tok,"FONT_NAME")==0 ) -- sscanf(buf, "%[^\"]", fontname ); -+ sscanf(buf, "%99[^\"]", fontname ); - else if ( strcmp(tok,"CHARSET_REGISTRY")==0 ) -- sscanf(buf, "%[^\"]", encname ); -+ sscanf(buf, "%99[^\"]", encname ); - else if ( strcmp(tok,"CHARSET_ENCODING")==0 ) { - enc = 0; - if ( sscanf(buf, " %d", &enc )!=1 ) - sscanf(buf, "%d", &enc ); -+ /* These properties should be copied up to the buffer length too */ - } else if ( strcmp(tok,"FAMILY_NAME")==0 ) { -- strcpy(family,buf); -+ strncpy(family,buf,99); - } else if ( strcmp(tok,"FULL_NAME")==0 || strcmp(tok,"FACE_NAME")==0 ) { -- strcpy(full,buf); -+ strncpy(full,buf,99); - } else if ( strcmp(tok,"WEIGHT_NAME")==0 ) -- strcpy(weight,buf); -+ strncpy(weight,buf,99); - else if ( strcmp(tok,"SLANT")==0 ) -- strcpy(italic,buf); -+ strncpy(italic,buf,99); - else if ( strcmp(tok,"COPYRIGHT")==0 ) { -- strcpy(comments,buf); -+ /* LS: Assume the size of the passed-in buffer is 1000, see below in -+ * COMMENT */ -+ strncpy(comments,buf,999); - found_copyright = true; - } else if ( strcmp(tok,"COMMENT")==0 && !found_copyright ) { - char *pt = comments+strlen(comments); - diff --git a/fontforge/Pkgfile b/fontforge/Pkgfile index 73cac5539..b009c13f8 100644 --- a/fontforge/Pkgfile +++ b/fontforge/Pkgfile @@ -1,22 +1,34 @@ # Description: An outline font editor. # URL: http://fontforge.sourceforge.net -# Maintainer: Antti Nykanen, aon at iki dot fi -# Depends on: freetype, libpng, libtiff, libungif, xorg-libxi, xorg-libxkbui +# Maintainer: Danny Rawlins, monster dot romster at gmail dot com +# Packager: Antti Nykanen, aon at iki dot fi +# Depends on: freetype libpng libtiff libungif libuninameslist xorg-libxi xorg-libxkbui name=fontforge -version=20100501 +version=20110222 release=1 -source=(http://download.sourceforge.net/$name/${name}_full-$version.tar.bz2 \ - CVE-2010-4259.patch) +source=(http://downloads.sourceforge.net/project/$name/fontforge-source/fontforge_full-$version.tar.bz2 + http://fontforge.sourceforge.net/cidmaps.tgz + fontforge-20110222-libz.so-linkage.patch) build() { cd $name-$version - patch -p1 -i $SRC/CVE-2010-4259.patch - sed "s|PyBytes_Decode|PyString_Decode|g" -i fontforge/ffpython.h - ./configure --prefix=/usr \ - --mandir=/usr/man \ - --without-freetype-src + + patch -p 1 -i $SRC/fontforge-20110222-libz.so-linkage.patch + + install -d $PKG/usr/share/fontforge + cp $SRC/*.cidmap $PKG/usr/share/fontforge/ + + ./configure \ + --prefix=/usr \ + --mandir=/usr/man \ + --with-multilayer \ + --with-devicetables \ + --with-regual-link \ + --without-freetype-src \ + --disable-static + make make install DESTDIR=$PKG - rm -r $PKG/usr/share/locale/ + rm -r $PKG/usr/share/locale } diff --git a/fontforge/fontforge-20110222-libz.so-linkage.patch b/fontforge/fontforge-20110222-libz.so-linkage.patch new file mode 100644 index 000000000..7e01e8a3a --- /dev/null +++ b/fontforge/fontforge-20110222-libz.so-linkage.patch @@ -0,0 +1,66 @@ +https://bugs.gentoo.org/show_bug.cgi?id=367425 + +diff -ruN fontforge-20110222~/fontforge/parsepdf.c fontforge-20110222/fontforge/parsepdf.c +--- fontforge-20110222~/fontforge/parsepdf.c 2011-02-15 05:37:39.000000000 +0200 ++++ fontforge-20110222/fontforge/parsepdf.c 2011-05-17 22:19:56.000000000 +0300 +@@ -759,7 +759,11 @@ + if ( zlib!=NULL ) + return( true ); + +- if ( (zlib = dlopen("libz" SO_EXT,RTLD_GLOBAL|RTLD_LAZY))==NULL ) { ++ if ( (zlib = dlopen("libz" SO_EXT,RTLD_GLOBAL|RTLD_LAZY))==NULL ++#ifdef SO_1_EXT ++ && (zlib = dlopen("libz" SO_1_EXT,RTLD_LAZY))==NULL ++#endif ++ ) { + LogError( "%s", dlerror()); + return( false ); + } +diff -ruN fontforge-20110222~/fontforge/svg.c fontforge-20110222/fontforge/svg.c +--- fontforge-20110222~/fontforge/svg.c 2011-02-18 23:33:27.000000000 +0200 ++++ fontforge-20110222/fontforge/svg.c 2011-05-17 22:19:56.000000000 +0300 +@@ -1153,7 +1153,11 @@ + if ( xmltested ) + return( libxml!=NULL ); + +- dlopen("libz" SO_EXT,RTLD_GLOBAL|RTLD_LAZY); ++ dlopen("libz" SO_EXT,RTLD_GLOBAL|RTLD_LAZY) ++#ifdef SO_1_EXT ++ || dlopen("libz" SO_1_EXT,RTLD_LAZY) ++#endif ++ ; + + libxml = dlopen( "libxml2" SO_EXT,RTLD_LAZY); + # ifdef SO_2_EXT +diff -ruN fontforge-20110222~/fontforge/ufo.c fontforge-20110222/fontforge/ufo.c +--- fontforge-20110222~/fontforge/ufo.c 2011-02-17 02:20:37.000000000 +0200 ++++ fontforge-20110222/fontforge/ufo.c 2011-05-17 22:19:56.000000000 +0300 +@@ -929,7 +929,11 @@ + if ( xmltested ) + return( libxml!=NULL ); + +- dlopen("libz" SO_EXT,RTLD_GLOBAL|RTLD_LAZY); ++ dlopen("libz" SO_EXT,RTLD_GLOBAL|RTLD_LAZY) ++#ifdef SO_1_EXT ++ || dlopen("libz" SO_1_EXT,RTLD_LAZY) ++#endif ++ ; + + libxml = dlopen( "libxml2" SO_EXT,RTLD_LAZY); + # ifdef SO_2_EXT +diff -ruN fontforge-20110222~/fontforge/woff.c fontforge-20110222/fontforge/woff.c +--- fontforge-20110222~/fontforge/woff.c 2011-02-15 05:37:40.000000000 +0200 ++++ fontforge-20110222/fontforge/woff.c 2011-05-17 22:19:56.000000000 +0300 +@@ -76,7 +76,11 @@ + if ( zlib!=NULL ) + return( true ); + +- if ( (zlib = dlopen("libz" SO_EXT,RTLD_GLOBAL|RTLD_LAZY))==NULL ) { ++ if ( (zlib = dlopen("libz" SO_EXT,RTLD_GLOBAL|RTLD_LAZY))==NULL ++#ifdef SO_1_EXT ++ && (zlib = dlopen("libz" SO_1_EXT,RTLD_LAZY))==NULL ++#endif ++ ) { + LogError( "%s", dlerror()); + return( false ); + }