diff options
author | atatat <atatat@pkgsrc.org> | 2004-07-27 04:36:06 +0000 |
---|---|---|
committer | atatat <atatat@pkgsrc.org> | 2004-07-27 04:36:06 +0000 |
commit | ccf1ae148b1531760bc86b0cd4be387e8dbbb7bd (patch) | |
tree | 8425a4675d6796ecfec05cf393374f815769b604 /www | |
parent | d036daa122e5cdf526e4d632093da5011867c9d7 (diff) | |
download | pkgsrc-ccf1ae148b1531760bc86b0cd4be387e8dbbb7bd.tar.gz |
Add a tiny binary patch to netscape7 (libsoftokn3.so, actually) that
makes the NetBSD kernel stop whining about file descriptor 0 being
closed when netstat gets run. The script contains everything you
don't want to know.
Bump this pkg to PKGREVISION 3.
Diffstat (limited to 'www')
-rw-r--r-- | www/netscape7/Makefile | 10 | ||||
-rwxr-xr-x | www/netscape7/files/binpatch-x86-unknown-linux2.2.5-7.1.sh | 63 |
2 files changed, 71 insertions, 2 deletions
diff --git a/www/netscape7/Makefile b/www/netscape7/Makefile index c018336d41e..14f003d4f86 100644 --- a/www/netscape7/Makefile +++ b/www/netscape7/Makefile @@ -1,9 +1,9 @@ -# $NetBSD: Makefile,v 1.27 2004/06/26 10:46:41 grant Exp $ +# $NetBSD: Makefile,v 1.28 2004/07/27 04:36:06 atatat Exp $ # DISTNAME= netscape-i686-pc-linux-gnu-sea PKGNAME= netscape${VERS_MAJ}-${VERS_MAJ}.${VERS_MIN} -PKGREVISION= 2 +PKGREVISION= 3 CATEGORIES= www MASTER_SITES= ftp://ftp.netscape.com/pub/netscape7/${SUB}/ \ ftp://sunsite.utk.edu/pub/netscape/netscape7/${SUB}/ \ @@ -15,6 +15,8 @@ MAINTAINER= jschauma@NetBSD.org HOMEPAGE= http://channels.netscape.com/ns/browsers/default.jsp COMMENT= Netscape Browser, Mail and Newsreader suite, version 7 +BUILD_DEPENDS= binpatch>=1.0:../../pkgtools/binpatch + RESTRICTED= "No re-distribution without agreement from Netscape" NO_SRC_ON_CDROM= ${RESTRICTED} NO_BIN_ON_CDROM= ${RESTRICTED} @@ -82,6 +84,10 @@ pre-install: @${ECHO} "@unexec \$${RMDIR} %D/lib/netscape 2>/dev/null || \$${TRUE}" \ >> ${PLIST_SRC} +post-build: + ${SH} ../../www/netscape7/files/binpatch-x86-unknown-linux2.2.5-7.1.sh \ + ${LOCALBASE} ${WRKSRC}/dest/libsoftokn3.so + do-install: ${INSTALL_PROGRAM_DIR} ${PREFIX}/lib/netscape/netscape7 cd ${INSTDIR} && ${PAX} -rw . ${PREFIX}/lib/netscape/netscape7 diff --git a/www/netscape7/files/binpatch-x86-unknown-linux2.2.5-7.1.sh b/www/netscape7/files/binpatch-x86-unknown-linux2.2.5-7.1.sh new file mode 100755 index 00000000000..384eb6b74ff --- /dev/null +++ b/www/netscape7/files/binpatch-x86-unknown-linux2.2.5-7.1.sh @@ -0,0 +1,63 @@ +#!/bin/sh + +# $NetBSD: binpatch-x86-unknown-linux2.2.5-7.1.sh,v 1.1 2004/07/27 04:36:06 atatat Exp $ +# +# ------------------------------------------------------------------------ +# "THE BEER-WARE LICENSE" (Revision 42): +# Andrew Brown <atatat@NetBSD.org> wrote this file. As long as you +# retain this notice you can do whatever you want with this stuff. +# If we meet some day, and you think this stuff is worth it, you can +# buy me a beer in return. +# ------------------------------------------------------------------------ + +PATH=$1/bin:$PATH +export PATH + +# % objdump -h libsoftokn3.so +# libsoftokn3.so: file format elf32-i386 +# +file=$2 +size=417992 + +# % objdump -h libsoftokn3.so +# Sections: +# Idx Name Size VMA LMA File off Algn +# ... +# 10 .text 0004d1e0 00003e10 00003e10 00003e10 2**4 +# CONTENTS, ALLOC, LOAD, READONLY, CODE +# +# % pmap -a 13475 | grep libsoftokn3.so +# bbb3a000-bbb9afff 388k 00000000 r-xp+ (rwx) 1/0/0 00:04 77819 - /usr/pkg/lib/netscape/netscape7/libsoftokn3.so [0xc64927f0] +# bbb9b000-bbb9efff 16k 00061000 rw-p- (rwx) 1/0/0 00:04 77819 - /usr/pkg/lib/netscape/netscape7/libsoftokn3.so [0xc64927f0] +# +# % objdump -d -j .text --adjust-vma=0xbbb3a000 libsoftokn3.so +# ... +# bbb62a3d: 6a 00 push $0x0 +# bbb62a3f: e8 f8 ad fd ff call 0xbbb3d83c +# bbb62a44: e8 23 af fd ff call 0xbbb3d96c +# ... +# +# ins addr - lma - adjust-vma + file off +# 0xbbb62a3d - 0x00003e10 - 0xbbb3a000 + 0x00003e10 = 0x00028a3d +# +offset=0x00028a3d + +# compare the push/call/call instruction bytes +# +compare=6a00e8f8adfdffe823affdff + +# the push instruction is two bytes long +# +skip=2 + +# five nops will overwrite the call to 0xbbb3d83c +# +replace=9090909090 + +binpatch \ + file=$file \ + size=$size \ + offset=$offset \ + compare=$compare \ + skip=$skip \ + replace=$replace |