From a1d94944319d647730844d4d975fc4e5d58f9126 Mon Sep 17 00:00:00 2001 From: Michael Schwendt Date: Aug 04 2006 16:58:22 +0000 Subject: auto-import compface-1.5.2-2 on branch devel from compface-1.5.2-2.src.rpm --- diff --git a/compface-1.5.2-stack-smashing.patch b/compface-1.5.2-stack-smashing.patch new file mode 100644 index 0000000..8b18cf2 --- /dev/null +++ b/compface-1.5.2-stack-smashing.patch @@ -0,0 +1,26 @@ +Prevent sscanf stack smashing, and fix two GCC warnings. + +diff -Nur compface-1.5.2-prepped/file.c compface-1.5.2-modified/file.c +--- compface-1.5.2-prepped/file.c 2006-08-04 18:58:17.000000000 +0200 ++++ compface-1.5.2-modified/file.c 2006-08-04 18:59:30.000000000 +0200 +@@ -80,7 +80,7 @@ + static char table_inv[] = { 0,8,4,12,2,10,6,14,1,9, 5,13, 3,11, 7,15 }; + static char table_nop[] = { 0,1,2, 3,4, 5,6, 7,8,9,10,11,12,13,14,15 }; + char *table = table_nop; /* optionally invert bits in nibble */ +- register inc = 0; /* optionally swap nimmles */ ++ register int inc = 0; /* optionally swap nimmles */ + int bits; + + t = s = fbuf; +@@ -91,9 +91,9 @@ + char type1[128]; + char type2[128]; + while (*s && *s++ != '\n'); +- if (sscanf(s, "#define %*s %d", &bits) == 1) if (bits == 48) { ++ if ((sscanf(s, "#define %*s %d", &bits) == 1) && (bits == 48)) { + while (*s && *s++ != '\n'); +- if (sscanf(s, "static %s %s", type1,type2)==2 && ++ if (sscanf(s, "static %127s %127s", type1,type2)==2 && + (!strcmp(type1, "char") || + !strcmp(type2, "char"))) { + while (*s && *s++ != '\n'); diff --git a/compface-test.xbm b/compface-test.xbm new file mode 100644 index 0000000..5ac4670 --- /dev/null +++ b/compface-test.xbm @@ -0,0 +1,23 @@ +#define noname_width 48 +#define noname_height 48 +static char noname_bits[] = { + 0xFC,0xFF,0xFF,0xFF,0xFF,0x7F,0xFC,0xFF,0xFF,0xFF,0xFF,0x7F,0xFF,0xFF,0xFF, + 0xFF,0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F,0xE0, + 0xFF,0xFF,0xE7,0xCF,0x3F,0xC0,0xFF,0xFF,0xC7,0xDF,0x7F,0xF0,0xFF,0xFF,0xC7, + 0xCF,0xFF,0xFF,0xFF,0xFF,0xE3,0x9F,0xFF,0xFF,0xFF,0xFF,0xC7,0xAF,0x52,0x55, + 0x95,0x00,0xE0,0x2F,0x02,0x00,0x00,0x04,0xC0,0x4F,0x49,0x2A,0x01,0x10,0xE0, + 0xFF,0xFF,0xFF,0xFF,0xF7,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFC,0xFF,0xFF, + 0xFF,0xFF,0x7F}; diff --git a/compface.spec b/compface.spec index b068507..581fe96 100644 --- a/compface.spec +++ b/compface.spec @@ -1,15 +1,18 @@ Name: compface Version: 1.5.2 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Utilities for handling X-Faces Group: Applications/Multimedia License: MIT URL: http://www.ibiblio.org/pub/Linux/apps/graphics/convert/ Source0: http://ftp.xemacs.org/pub/xemacs/aux/%{name}-%{version}.tar.gz +Source1: compface-test.xbm Patch0: http://ftp.debian.org/debian/pool/main/libc/libcompface/libcompface_1.5.2-3.diff.gz -Patch1: %{name}-1.5.2-build.patch +Patch1: compface-1.5.2-stack-smashing.patch +Patch2: %{name}-1.5.2-build.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +BuildRequires: diffutils %description %{summary}. @@ -26,7 +29,8 @@ Requires: %{name} = %{version}-%{release} %prep %setup -q %patch0 -p1 -%patch1 -p0 +%patch1 -p1 -b .stack-smashing +%patch2 -p0 %build @@ -39,6 +43,12 @@ rm -rf $RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT STRIP=/bin/true +%check || : +export LD_LIBRARY_PATH=$RPM_BUILD_ROOT%{_libdir}:$LD_LIBRARY_PATH +./compface %{SOURCE1} | ./uncompface -X > __test.xbm +cmp %{SOURCE1} __test.xbm + + %clean rm -rf $RPM_BUILD_ROOT @@ -66,6 +76,11 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Fri Aug 4 2006 Michael Schwendt - 1.5.2-2 +- Add patch to prevent sscanf stack smashing through Debian's patch. +- Fix two GCC warnings in the same patch. +- Add one test to the %%check section and BR diffutils. + * Wed Aug 2 2006 Ville Skyttä - 1.5.2-1 - Update to 1.5.2, apply Debian's 1.5.2-3 patchset. - Crudely patch to build a shared lib (inspired by Debian), drop static one.