summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander F Rødseth2015-06-10 14:26:05 +0200
committerAlexander F Rødseth2015-06-10 14:26:05 +0200
commit550f953a12ae23fbc84858a93925b795a2f42699 (patch)
tree6231d25a1a6573edd0be37031bca6a7fe80eeb1e
downloadaur-550f953a12ae23fbc84858a93925b795a2f42699.tar.gz
Initial import
-rw-r--r--.SRCINFO22
-rw-r--r--100_more_tolerant_test.diff57
-rw-r--r--200_libc_symbol_versioning.diff77
-rw-r--r--Changelog14
-rw-r--r--PKGBUILD57
5 files changed, 227 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..5ecb90fac5c3
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,22 @@
+pkgbase = zzuf
+ pkgdesc = Transparent application input fuzzer.
+ pkgver = 0.13.svn20100215
+ pkgrel = 1
+ url = http://caca.zoy.org/wiki/zzuf
+ changelog = Changelog
+ arch = i686
+ arch = x86_64
+ license = custom
+ depends = glibc
+ options = !buildflags
+ options = !libtool
+ options = !staticlibs
+ source = http://ftp.debian.org/debian/pool/main/z/zzuf/zzuf_0.13.svn20100215.orig.tar.gz
+ source = 100_more_tolerant_test.diff
+ source = 200_libc_symbol_versioning.diff
+ sha256sums = 012b195cdc8e6c62fc25e4e357a5fd9d686d5b4faa59a8fcf7fb0d0906ebcff4
+ sha256sums = 5aecac85a56fc2bb4d8d1402aee4fa78f709bb6cde24338b53c2809039e7a936
+ sha256sums = 788adac61b5632867e2a685fe7db771e209cfefdd15343d861fba04fbee858fb
+
+pkgname = zzuf
+
diff --git a/100_more_tolerant_test.diff b/100_more_tolerant_test.diff
new file mode 100644
index 000000000000..702d22c6d828
--- /dev/null
+++ b/100_more_tolerant_test.diff
@@ -0,0 +1,57 @@
+commit f0d37488611cd831160c1236c5b3e898777b808e
+Author: sam <sam@92316355-f0b4-4df1-b90c-862c8a59935f>
+Date: Mon Apr 19 20:52:05 2010 +0000
+
+ Make check-zzuf-r-ratio slightly more tolerant.
+
+ git-svn-id: svn://svn.zoy.org/libcaca/zzuf/trunk@4394 92316355-f0b4-4df1-b90c-862c8a59935f
+
+diff --git a/test/check-zzuf-r-ratio b/test/check-zzuf-r-ratio
+index 2c0d178..d19bcc4 100755
+--- a/test/check-zzuf-r-ratio
++++ b/test/check-zzuf-r-ratio
+@@ -17,13 +17,24 @@ checkflip()
+ {
+ r=$1
+ expect=$2
+- s2=$seed
+ mib=20
++ try=3
++ s2=$seed
++ new_test "$mib MiB of zeroes, ratio $r"
++ echo " expecting $expect"
++ checkflip_internal $1 $2 $mib $try $s2
++}
++
++checkflip_internal()
++{
++ r=$1
++ expect=$2
++ mib=$3
++ try=$4
++ s2=$5
+ rmax=-1
+ rmin=-1
+ rtot=0
+- new_test "$mib MiB of zeroes, ratio $r"
+- echo " expecting $expect"
+ printf " got"
+ for x in 0 1 2 3 4; do
+ ret=`dd if=/dev/zero bs=1048576 count=$mib 2>/dev/null | $ZZUF -s $s2 -r $r | "$ZZERO"`
+@@ -41,7 +52,15 @@ checkflip()
+ pass_test " ok"
+ elif [ $(($rmean * 8)) -lt $(($expect * 7)) \
+ -o $(($rmean * 7)) -gt $(($expect * 8)) ]; then
+- fail_test " FAILED"
++ if [ $try -gt 0 ]; then
++ # Hack: if we failed with that seed, just try another one.
++ # Kinda defeats the purpose of the test, but well, that's
++ # how randomness works, you cannot win each time.
++ echo " trying again"
++ checkflip_internal $1 $2 $3 $(($3 - 1)) "$3$s2"
++ else
++ fail_test " FAILED"
++ fi
+ else
+ pass_test " ok"
+ fi
diff --git a/200_libc_symbol_versioning.diff b/200_libc_symbol_versioning.diff
new file mode 100644
index 000000000000..0769e857279f
--- /dev/null
+++ b/200_libc_symbol_versioning.diff
@@ -0,0 +1,77 @@
+Index: zzuf-0.13.svn20100215/src/libzzuf/lib-load.h
+===================================================================
+--- zzuf-0.13.svn20100215.orig/src/libzzuf/lib-load.h 2010-01-13 02:16:46.000000000 +0100
++++ zzuf-0.13.svn20100215/src/libzzuf/lib-load.h 2012-04-17 01:26:49.068253763 +0200
+@@ -20,6 +20,7 @@
+
+ #ifdef HAVE_DLFCN_H
+ # include <dlfcn.h>
++extern void *_zz_dl_lib;
+ # define NEW(x) x
+ # define LOADSYM(x) \
+ do { \
+@@ -29,7 +30,7 @@
+ * otherwise we may miss a lot of stuff if we wait for \
+ * the linker to load us fully. */ \
+ _zz_init(); \
+- ORIG(x) = dlsym(RTLD_NEXT, STR(x)); \
++ ORIG(x) = dlsym(_zz_dl_lib, STR(x)); \
+ } \
+ if(!ORIG(x)) \
+ abort(); \
+Index: zzuf-0.13.svn20100215/src/libzzuf/sys.c
+===================================================================
+--- zzuf-0.13.svn20100215.orig/src/libzzuf/sys.c 2010-01-13 02:16:46.000000000 +0100
++++ zzuf-0.13.svn20100215/src/libzzuf/sys.c 2012-04-17 01:26:35.476253559 +0200
+@@ -16,12 +16,19 @@
+
+ #include "config.h"
+
++/* Need this for RTLD_NEXT */
++#define _GNU_SOURCE
++
+ #if defined HAVE_STDINT_H
+ # include <stdint.h>
+ #elif defined HAVE_INTTYPES_H
+ # include <inttypes.h>
+ #endif
+
++#ifdef HAVE_DLFCN_H
++# include <dlfcn.h>
++#endif
++
+ #if defined HAVE_WINDOWS_H
+ # include <windows.h>
+ # include <imagehlp.h>
+@@ -34,6 +41,10 @@
+
+ #include "sys.h"
+
++#if defined HAVE_DLFCN_H
++void *_zz_dl_lib = RTLD_NEXT;
++#endif
++
+ #if defined HAVE_WINDOWS_H
+ static void insert_func(void *, void *, void *);
+
+@@ -71,6 +82,20 @@
+ insert_func(entry.hModule, LoadLibraryA_orig, LoadLibraryA_new);
+ }
+ CloseHandle(list);
++#elif defined HAVE_DLFCN_H
++ /* If glibc is recent enough, we use dladdr() to get its address. This
++ * way we are sure that the symbols we load are the most recent version,
++ * or we may get weird problems. We choose fileno as a random symbol to
++ * get, because we know we don't divert it. */
++# if HAVE_DLADDR
++ Dl_info di;
++ if (dladdr(&fileno, &di) != 0)
++ {
++ void *lib = dlopen(di.dli_fname, RTLD_NOW);
++ if (lib)
++ _zz_dl_lib = lib;
++ }
++# endif
+ #else
+ /* Nothing to do on our platform */
+ #endif
diff --git a/Changelog b/Changelog
new file mode 100644
index 000000000000..e1000dd15541
--- /dev/null
+++ b/Changelog
@@ -0,0 +1,14 @@
+2013-05-18 Mariusz Libera <mariusz.libera@gmail.com>
+
+ 0.13-2:
+ * new maintainer
+ * updated to svn version shiped in Debian and Fedora - renames zzcat to zzat
+ * added Debian patches
+ * added !staticlibs !libtool options
+ * added !buildflags - some flags may break zzuf - better safe than sorry
+ * added check() function
+ * added glibc to depends
+ * changed license to custom and added LICENSE file
+ * updated PKGBUILD
+ * added Changelog
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..d4f4b0b1163b
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,57 @@
+# Maintainer: Mariusz Libera <mariusz.libera@gmail.com>
+# Contributor: Pranay Kanwar <pranay.kanwar@gmail.com>
+pkgname=zzuf
+pkgver=0.13.svn20100215
+_ver=0.13
+pkgrel=1
+pkgdesc="Transparent application input fuzzer."
+url="http://caca.zoy.org/wiki/zzuf"
+arch=('i686' 'x86_64')
+license=('custom')
+options=('!buildflags' '!libtool' '!staticlibs')
+depends=('glibc')
+changelog=Changelog
+source=("http://ftp.debian.org/debian/pool/main/z/zzuf/zzuf_${pkgver}.orig.tar.gz"
+ '100_more_tolerant_test.diff'
+ '200_libc_symbol_versioning.diff')
+sha256sums=('012b195cdc8e6c62fc25e4e357a5fd9d686d5b4faa59a8fcf7fb0d0906ebcff4'
+ '5aecac85a56fc2bb4d8d1402aee4fa78f709bb6cde24338b53c2809039e7a936'
+ '788adac61b5632867e2a685fe7db771e209cfefdd15343d861fba04fbee858fb')
+
+prepare() {
+ cd $srcdir/$pkgname-$_ver
+
+ # apply Debian patches
+ for patch in ../*.diff ; do
+ patch -Np1 -i $patch
+ done
+}
+
+build() {
+ cd $srcdir/$pkgname-$_ver
+ ./configure --prefix=/usr
+ make
+}
+
+check() {
+ cd $srcdir/$pkgname-$_ver
+ make check
+}
+
+package() {
+ cd $srcdir/$pkgname-$_ver
+ make DESTDIR=$pkgdir install
+
+ # license
+ install -Dm644 COPYING $pkgdir/usr/share/licenses/$pkgname/LICENSE
+
+ # documentation
+ install -dm755 $pkgdir/usr/share/doc/$pkgname
+ install -m644 \
+ AUTHORS \
+ NEWS \
+ README \
+ TODO \
+ $pkgdir/usr/share/doc/$pkgname
+}
+