debian/0000755000000000000000000000000011743125541007171 5ustar debian/zzuf.install0000644000000000000000000000020311363153221011544 0ustar usr/bin/zzat usr/bin/zzuf usr/lib/zzuf/libzzuf.so usr/share/man/man1/zzat.1 usr/share/man/man1/zzuf.1 usr/share/man/man3/libzzuf.3 debian/compat0000644000000000000000000000000211311025733010360 0ustar 5 debian/patches/0000755000000000000000000000000011743125541010620 5ustar debian/patches/100_more_tolerant_test.diff0000644000000000000000000000320011363153221015730 0ustar commit f0d37488611cd831160c1236c5b3e898777b808e Author: sam 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 debian/patches/200_libc_symbol_versioning.diff0000644000000000000000000000441511743125304016575 0ustar 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 +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 #elif defined HAVE_INTTYPES_H # include #endif +#ifdef HAVE_DLFCN_H +# include +#endif + #if defined HAVE_WINDOWS_H # include # include @@ -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 debian/patches/series0000644000000000000000000000007411743125036012035 0ustar 100_more_tolerant_test.diff 200_libc_symbol_versioning.diff debian/changelog0000644000000000000000000001150011743124644011043 0ustar zzuf (0.13.svn20100215-4) unstable; urgency=low * debian/patches/200_libc_symbol_versioning.diff: fix a problem with libc6 symbol versioning where we would call fopen() version GLIBC_2.0 but freopen() would think we were using version GLIBC_2.1 and thus corrupt the stream contents. -- Sam Hocevar Tue, 17 Apr 2012 01:20:43 +0200 zzuf (0.13.svn20100215-3) unstable; urgency=low * debian/rules: -D_FORTIFY_SOURCE breaks zzuf; make sure this macro is not set in CFLAGS. Patch courtesy of Matthias Klose (Closes: #642100). * debian/rules: add build-arch and build-indep rules. * debian/control: set policy to 3.9.3. -- Sam Hocevar Sun, 08 Apr 2012 11:00:29 +0200 zzuf (0.13.svn20100215-2) unstable; urgency=high * debian/patches/100_more_tolerant_test.diff: when one of the -r unit tests fails, try it again up to three times (Closes: #577294). Patch from upstream SVN. * debian/rules: misc fixes, courtesy of Loïc Minier (Closes: #575683). Fixes concurrent builds and adds support for nocheck. -- Sam Hocevar Mon, 19 Apr 2010 22:02:22 +0000 zzuf (0.13.svn20100215-1) unstable; urgency=low * New SVN snapshot. Renames zzcat into zzat to avoid an unfortunate conflict with zziplib (Closes: #568426). -- Sam Hocevar Mon, 15 Feb 2010 22:26:37 +0100 zzuf (0.13-1) unstable; urgency=low * New upstream release. * This release properly handles the getc_unlocked() call used by new versions of sed. The test suite passes again (Closes: #533977, #562434). * This release fixes a problem with memory limit detection (Closes: #566552). * debian/rules: + Fix a race condition in the build rule (Closes: #543458). -- Sam Hocevar Sun, 31 Jan 2010 17:54:31 +0000 zzuf (0.12.svn20091212-1) experimental; urgency=low * New SVN snapshot. * This snapshot properly handles the getc_unlocked() call used by new versions of sed. The test suite passes again (Closes: #533977). * debian/control: + Build-depend on missing ${misc:Depends}. + Set policy to 3.8.3. * debian/source/format: + Switch to 3.0 (quilt) source format. * debian/rules: + Fix a race condition in the build rule (Closes: #543458). -- Sam Hocevar Sat, 12 Dec 2009 23:42:57 +0100 zzuf (0.12-1) unstable; urgency=low * New upstream release. * debian/control: + Set policy to 3.8.0. No changes required. -- Sam Hocevar (Debian packages) Fri, 13 Jun 2008 13:57:07 +0000 zzuf (0.11-1) unstable; urgency=low * New upstream release. -- Sam Hocevar (Debian packages) Sun, 18 May 2008 21:53:06 +0000 zzuf (0.9-2) unstable; urgency=low * debian/control: + Set policy to 3.7.3. * debian/patches/100_dup_dup2_implementation.diff: + Patch from upstream SVN. Implements dup() and dup2() due to Debian- specific internal changes to dd which caused the test suite to fail (Closes: #474884). -- Sam Hocevar (Debian packages) Sun, 27 Apr 2008 10:07:40 +0200 zzuf (0.9-1) unstable; urgency=low * New upstream release. + This version no longer clobbers LD_PRELOAD (Closes: #413310). * debian/rules: + Don't use -$(MAKE) distclean. -- Sam Hocevar (Debian packages) Tue, 10 Jul 2007 02:28:09 +0200 zzuf (0.8.1-1) unstable; urgency=low * New minor upstream release. Fixes an unsaved errno value and removes a spurious debug message (Closes: #413046). Patches courtesy of Sami Liedes. -- Sam Hocevar (Debian packages) Fri, 2 Mar 2007 01:00:42 +0100 zzuf (0.8-1) unstable; urgency=low * New upstream release. * debian/copyright: + Updated postal address. -- Sam Hocevar (Debian packages) Sat, 24 Feb 2007 17:37:35 +0100 zzuf (0.7-1) unstable; urgency=low * New upstream release. -- Sam Hocevar (Debian packages) Sun, 28 Jan 2007 02:11:15 +0100 zzuf (0.6-1) unstable; urgency=low * First Debian upload (Closes: #407072). -- Sam Hocevar (Debian packages) Thu, 25 Jan 2007 14:32:04 +0100 zzuf (0.5-1) unstable; urgency=low * First public upstream release. -- Sam Hocevar (Debian packages) Mon, 15 Jan 2007 01:02:44 +0100 zzuf (0.4-1) unstable; urgency=low * New upstream release. -- Sam Hocevar (Debian packages) Fri, 12 Jan 2007 00:43:45 +0100 zzuf (0.3-1) unstable; urgency=low * New upstream release. -- Sam Hocevar (Debian packages) Sun, 7 Jan 2007 22:32:05 +0100 zzuf (0.2-1) unstable; urgency=low * New upstream release. -- Sam Hocevar (Debian packages) Sat, 6 Jan 2007 01:43:08 +0100 zzuf (0.1-1) unstable; urgency=low * Initial release. -- Sam Hocevar (Debian packages) Sat, 23 Dec 2006 19:57:52 +0100 debian/control0000644000000000000000000000130311740252260010565 0ustar Source: zzuf Section: devel Priority: optional Maintainer: Sam Hocevar Build-Depends: debhelper (>= 5.0) Standards-Version: 3.9.3 Package: zzuf Section: devel Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: transparent application fuzzer Zzuf is a transparent fuzzer. It works by intercepting applications' file and network operations and changing random bits in their input. Its behaviour is deterministic, making it easy to reproduce bugs. . Zzuf has support for variable fuzzing ratio, character filtering, fuzzing decision based on filenames and optional network fuzzing. It can also stop processes that run for too long or that output too much data. debian/copyright0000644000000000000000000000202510570066210011115 0ustar This package was downloaded from http://sam.zoy.org/zzuf/ Upstream author: Sam Hocevar Copyright (c) 2002, 2007 Sam Hocevar All Rights Reserved This program is free software. It comes without any warranty, to the extent permitted by applicable law. You can redistribute it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See http://sam.zoy.org/wtfpl/COPYING for more details. | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | Version 2, December 2004 | | Copyright (C) 2004 Sam Hocevar | 14 rue de Plaisance, 75014 Paris, France | Everyone is permitted to copy and distribute verbatim or modified | copies of this license document, and changing it is allowed as long | as the name is changed. | | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION | | 0. You just DO WHAT THE FUCK YOU WANT TO. debian/rules0000755000000000000000000000361011740252260010245 0ustar #!/usr/bin/make -f #export DH_VERBOSE=1 export DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) # FOR AUTOCONF 2.52 AND NEWER ONLY ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE)) confflags += --build $(DEB_HOST_GNU_TYPE) else confflags += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE) endif confflags += --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info CFLAGS = $(shell dpkg-buildflags --get CFLAGS) -U_FORTIFY_SOURCE configure: configure-stamp configure-stamp: dh_testdir CFLAGS="$(CFLAGS)" ./configure $(confflags) --prefix=/usr touch $@ build: build-arch build-indep build-arch: build-arch-stamp build-arch-stamp: configure-stamp dh_testdir $(MAKE) touch $@ build-indep: build-indep-stamp build-indep-stamp: dh_testdir touch $@ ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE)) maybe_check = $(if $(findstring nocheck,$(DEB_BUILD_OPTIONS)),,check) endif check: check-stamp check-stamp: build-arch-stamp $(MAKE) check touch $@ clean: dh_testdir dh_testroot rm -f check-stamp build-arch-stamp build-indep-stamp configure-stamp [ ! -f Makefile ] || $(MAKE) distclean dh_clean install: build dh_testdir dh_testroot dh_clean -k dh_installdirs usr/bin usr/share/man/man1 $(MAKE) install DESTDIR=`pwd`/debian/tmp dh_install --sourcedir=debian/tmp --list-missing binary-indep: build $(maybe_check) install # Build architecture-dependent files here. binary-arch: build $(maybe_check) install dh_testdir dh_testroot dh_installdocs -A README TODO NEWS dh_installmenu dh_installcron dh_installinfo dh_installmime dh_installchangelogs ChangeLog dh_link dh_strip dh_compress dh_fixperms dh_installdeb dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install configure debian/source/0000755000000000000000000000000011743125541010471 5ustar debian/source/format0000644000000000000000000000001411311025733011670 0ustar 3.0 (quilt)