Index: .fossil-settings/ignore-glob ================================================================== --- .fossil-settings/ignore-glob +++ .fossil-settings/ignore-glob @@ -1,12 +1,15 @@ archive/kitcreator-*.tar.gz.new archive/tcpdump-*.tar.gz.new +archive/tcpdump-*.tar.bz2.new archive/twapi-*.zip.new archive/winpcap-dev-*.zip.new archive/winpcap-inst-*.exe.new archive/kitcreator-*.tar.gz archive/tcpdump-*.tar.gz +archive/tcpdump-*.tar.bz2 +archive/tcpdump-*.patches archive/twapi-*.zip archive/winpcap-dev-*.zip archive/winpcap-inst-*.exe files/npf32.sys files/npf64.sys Index: Makefile ================================================================== --- Makefile +++ Makefile @@ -4,14 +4,16 @@ TWAPI_VERSION = 3.1.17 TWAPI_URL = http://sourceforge.net/projects/twapi/files/Current%20Releases/Tcl%20Windows%20API/twapi-$(TWAPI_VERSION)/twapi-$(TWAPI_VERSION).zip TWAPI_ZIP = archive/twapi-$(TWAPI_VERSION).zip TWAPI_SHA256 = 8803e90fdc60c8d6a1ca3d559b145e8d09ae2e1259df603ca27c89ff7b0416f4 -TCPDUMP_VERSION = 4.5.1 -TCPDUMP_URL = http://www.tcpdump.org/release/tcpdump-$(TCPDUMP_VERSION).tar.gz -TCPDUMP_TARBALL = archive/tcpdump-$(TCPDUMP_VERSION).tar.gz -TCPDUMP_SHA256 = 14ab39657128f3a650aed4cf455f76c7590601087b6101c253d698f6e73f0b96 +TCPDUMP_VERSION = 4.0.0-3.20090921gitdf3cb4.2.el6 +TCPDUMP_SRPM = archive/tcpdump-$(TCPDUMP_VERSION).src.rpm +TCPDUMP_TARBALL = archive/tcpdump-$(TCPDUMP_VERSION).tar.bz2 +TCPDUMP_LOCAL_PATCHES = archive/tcpdump-$(TCPDUMP_VERSION)-local.patches +TCPDUMP_PATCHES = archive/tcpdump-$(TCPDUMP_VERSION).patches +TCPDUMP_SHA256 = 0e654b3df95d338efc1ed9f97984878c2203ae8527f3f589b6acce66d88d357d WINPCAP_DEV_VERSION = 4.1.2 WINPCAP_DEV_URL = http://www.winpcap.org/install/bin/WpdPack_4_1_2.zip WINPCAP_DEV_ZIP = archive/winpcap-dev-$(WINPCAP_DEV_VERSION).zip WINPCAP_DEV_SHA256 = ea799cf2f26e4afb1892938070fd2b1ca37ce5cf75fec4349247df12b784edbd @@ -49,38 +51,50 @@ cp '__TMP_WPCAP__/$$SYSDIR/drivers/npf_1.sys' files/npf64.sys cp '__TMP_WPCAP__/$$SYSDIR/drivers/npf.sys' files/npf32.sys rm -rf __TMP_WPCAP__ # TCPDUMP -$(TCPDUMP_TARBALL): +$(TCPDUMP_PATCHES): $(TCPDUMP_SRPM) $(TCPDUMP_LOCAL_PATCHES) + for patch in `rpm2cpio '$(TCPDUMP_SRPM)' | cpio --extract --to-stdout tcpdump.spec | awk '/^Patch[0-9][0-9]*: tcpdump/{ print $$2 }'`; do \ + rpm2cpio '$(TCPDUMP_SRPM)' | cpio --extract --to-stdout "$${patch}" || exit 1; \ + done > '$(TCPDUMP_PATCHES).new' + cat '$(TCPDUMP_LOCAL_PATCHES)' >> '$(TCPDUMP_PATCHES).new' + mv '$(TCPDUMP_PATCHES).new' '$(TCPDUMP_PATCHES)' + +$(TCPDUMP_TARBALL): $(TCPDUMP_SRPM) @-mkdir -p archive >/dev/null 2>/dev/null - wget --no-use-server-timestamps -O "$(TCPDUMP_TARBALL).new" "$(TCPDUMP_URL)" + rpm2cpio $(TCPDUMP_SRPM) | cpio --extract --to-stdout 'tcpdump-*.tar.*' > "$(TCPDUMP_TARBALL).new" @if test -n "$(TCPDUMP_SHA256)"; then if test "`openssl sha256 "$(TCPDUMP_TARBALL).new" | sed 's@^.*= *@@'`" != "$(TCPDUMP_SHA256)"; then echo "$(TCPDUMP_TARBALL): Checksum Mismatch!"; exit 1; fi; fi - gzip -dc "$(TCPDUMP_TARBALL).new" | tar -tf - >/dev/null + bzip2 -dc "$(TCPDUMP_TARBALL).new" | tar -tf - >/dev/null mv "$(TCPDUMP_TARBALL).new" "$(TCPDUMP_TARBALL)" $(WINPCAP_DEV_ZIP): @-mkdir -p archive >/dev/null 2>/dev/null wget --no-use-server-timestamps -O "$(WINPCAP_DEV_ZIP).new" "$(WINPCAP_DEV_URL)" @if test -n "$(WINPCAP_DEV_SHA256)"; then if test "`openssl sha256 "$(WINPCAP_DEV_ZIP).new" | sed 's@^.*= *@@'`" != "$(WINPCAP_DEV_SHA256)"; then echo "$(WINPCAP_DEV_ZIP): Checksum Mismatch!"; exit 1; fi; fi unzip -l "$(WINPCAP_DEV_ZIP).new" mv "$(WINPCAP_DEV_ZIP).new" "$(WINPCAP_DEV_ZIP)" -files/tcpdump.exe: $(TCPDUMP_TARBALL) $(WINPCAP_DEV_ZIP) pcap-config +files/tcpdump.exe: $(TCPDUMP_TARBALL) $(TCPDUMP_PATCHES) $(WINPCAP_DEV_ZIP) pcap-config rm -rf __TMP_TCP__ mkdir __TMP_TCP__ ( \ set -e; \ cd __TMP_TCP__; \ - gzip -dc ../$(TCPDUMP_TARBALL) | tar -xf -; \ + bzip2 -dc ../$(TCPDUMP_TARBALL) | tar -xf -; \ unzip ../$(WINPCAP_DEV_ZIP); \ cp ../pcap-config WpdPack/; \ cd WpdPack; \ echo '#define pcap_can_set_rfmon(x) 0' >> Include/pcap/pcap.h; \ echo '#define pcap_set_rfmon(x, y) -1' >> Include/pcap/pcap.h; \ echo '#define pcap_statustostr(x) ""' >> Include/pcap/pcap.h; \ - cd ../tcpdump-$(TCPDUMP_VERSION); \ + cd ../tcpdump; \ + patch -p1 < "../../$(TCPDUMP_PATCHES)"; \ + if [ -d win32/Include/Arpa -a ! -e win32/Include/arpa ]; then ln -s Arpa win32/Include/arpa; fi; \ + if [ -d win32/Include/Netinet -a ! -e win32/Include/netinet ]; then ln -s Netinet win32/Include/netinet; fi; \ + ( echo '#include "config.h"'; cat missing/bittypes.h ) > missing/bittypes.h.new; \ + mv missing/bittypes.h.new missing/bittypes.h; \ ./configure --without-smi --disable-smb --enable-ipv6 --without-crypto --host=$(TOOLCHAIN) PCAP_CONFIG="$$(pwd)/../WpdPack/pcap-config" LIBS='-lws2_32' ac_cv_func_getnameinfo='yes'; \ sed -i 's@Ws2tcpip\.h@ws2tcpip.h@' tcpdump-stdinc.h; \ grep -v '^# *define.*UNALIGNED' tcpdump-stdinc.h | \ grep -v '' > tcpdump-stdinc.h.new && mv tcpdump-stdinc.h.new tcpdump-stdinc.h; \ echo '#define HAVE_SOCKADDR_STORAGE 1' >> config.h; \ @@ -93,15 +107,17 @@ echo '#define HAVE_INT32_T 1' >> config.h; \ echo '#define HAVE_INT64_T 1' >> config.h; \ echo '#define HAVE_GENERATED_VERSION 1' >> config.h; \ echo '#define IN6_IS_ADDR_UNSPECIFIED IN6_IS_ADDR_UNSPECIFIED' >> config.h; \ echo '#undef HAVE_ALARM' >> config.h; \ + echo '#define getuid() 0' >> config.h; \ + echo '#define geteuid() 0' >> config.h; \ grep -v '^# *define *inline' config.h > config.h.new && mv config.h.new config.h; \ $(MAKE); \ ) @-mkdir -p files - cp __TMP_TCP__/tcpdump-$(TCPDUMP_VERSION)/tcpdump files/tcpdump.exe.new + cp __TMP_TCP__/tcpdump/tcpdump files/tcpdump.exe.new $(TOOLCHAIN_CMD)strip files/tcpdump.exe.new mv files/tcpdump.exe.new files/tcpdump.exe rm -rf __TMP_TCP__ # TWAPI (TCL Windows API) @@ -126,11 +142,11 @@ tclkit-zip: $(KITCREATOR_TARBALL) tcpdump.rc icon/tcpdump.ico rm -rf kitcreator-$(KITCREATOR_VERSION) gzip -dc "$(KITCREATOR_TARBALL)" | tar -xf - cp icon/tcpdump.ico kitcreator-$(KITCREATOR_VERSION)/kit.ico - sed 's/@@TCPDUMP_VERSION_COMMA@@/$(shell echo $(TCPDUMP_VERSION) | sed 's@\.@,@g'),0/;s/@@TCPDUMP_VERSION@@/$(TCPDUMP_VERSION)/' tcpdump.rc > kitcreator-$(KITCREATOR_VERSION)/kit.rc + sed 's/@@TCPDUMP_VERSION_COMMA@@/$(shell echo $(TCPDUMP_VERSION) | cut -f 1 -d - | sed 's@\.@,@g'),0/;s/@@TCPDUMP_VERSION@@/$(TCPDUMP_VERSION)/' tcpdump.rc > kitcreator-$(KITCREATOR_VERSION)/kit.rc cd kitcreator-$(KITCREATOR_VERSION) && KITCREATOR_PKGS=' ' AR=$(TOOLCHAIN_CMD)ar CC=$(TOOLCHAIN_CMD)gcc ./kitcreator 8.5.15 --host=$(TOOLCHAIN) --enable-kit-storage=zip --enable-threads cp kitcreator-$(KITCREATOR_VERSION)/tclkit-8.5.15 tclkit-zip.new mv tclkit-zip.new tclkit-zip rm -rf kitcreator-$(KITCREATOR_VERSION) @@ -159,10 +175,11 @@ $(MAKE) -C icon clean distclean: clean rm -f "$(TWAPI_ZIP)" "$(TCPDUMP_TARBALL)" "$(WINPCAP_DEV_ZIP)" "$(KITCREATOR_TARBALL)" "$(WINPCAP_INST_7ZIP)" rm -f "$(TWAPI_ZIP).new" "$(TCPDUMP_TARBALL).new" "$(WINPCAP_DEV_ZIP).new" "$(KITCREATOR_TARBALL).new" "$(WINPCAP_INST_7ZIP).new" + rm -f "$(TCPDUMP_PATCHES).new" "$(TCPDUMP_PATCHES)" rm -f $(WINPCAP_INST_FILES) rm -f tclkit-zip files/tcpdump.exe -rmdir archive files .PHONY: all clean distclean ADDED archive/tcpdump-4.0.0-3.20090921gitdf3cb4.2.el6-local.patches Index: archive/tcpdump-4.0.0-3.20090921gitdf3cb4.2.el6-local.patches ================================================================== --- /dev/null +++ archive/tcpdump-4.0.0-3.20090921gitdf3cb4.2.el6-local.patches @@ -0,0 +1,34 @@ +--- tcpdump/tcpdump.c 2014-02-20 13:04:20.077631000 -0600 ++++ tcpdump-1rsk/tcpdump.c 2014-02-20 13:03:16.942631000 -0600 +@@ -387,18 +387,20 @@ + #define U_FLAG + #endif + +-#ifndef WIN32 + /* Drop root privileges and chroot if necessary */ + static void + droproot(const char *username, const char *chroot_dir) + { ++#ifndef WIN32 + struct passwd *pw = NULL; ++#endif + + if (chroot_dir && !username) { + fprintf(stderr, "tcpdump: Chroot without dropping root is insecure\n"); + exit(1); + } + ++#ifndef WIN32 + pw = getpwnam(username); + if (pw) { + if (chroot_dir) { +@@ -423,8 +425,8 @@ + username); + exit(1); + } ++#endif + } +-#endif /* WIN32 */ + + static int + getWflagChars(int x) ADDED archive/tcpdump-4.0.0-3.20090921gitdf3cb4.2.el6.src.rpm Index: archive/tcpdump-4.0.0-3.20090921gitdf3cb4.2.el6.src.rpm ================================================================== --- /dev/null +++ archive/tcpdump-4.0.0-3.20090921gitdf3cb4.2.el6.src.rpm cannot compute difference between binary files Index: pcap-config ================================================================== --- pcap-config +++ pcap-config @@ -4,12 +4,11 @@ ourdir="$(dirname "$(readlink -f "$(which "$0")")")" case "$opt" in --cflags) - echo "-Iwin32/Include -I${ourdir}/Include" - + echo "-Iwin32/Include -I${ourdir}/Include -DNBBY=8" ;; --libs) echo "-L${ourdir}/Lib -lwpcap -lws2_32" ;; *)