pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/www/netscape7 Add a tiny binary patch to netscape7 (li...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/d5bbe06b88dd
branches:  trunk
changeset: 478606:d5bbe06b88dd
user:      atatat <atatat%pkgsrc.org@localhost>
date:      Tue Jul 27 04:36:06 2004 +0000

description:
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:

 www/netscape7/Makefile                                     |  10 +-
 www/netscape7/files/binpatch-x86-unknown-linux2.2.5-7.1.sh |  63 ++++++++++++++
 2 files changed, 71 insertions(+), 2 deletions(-)

diffs (102 lines):

diff -r 3792922fd666 -r d5bbe06b88dd www/netscape7/Makefile
--- a/www/netscape7/Makefile    Tue Jul 27 04:30:24 2004 +0000
+++ b/www/netscape7/Makefile    Tue Jul 27 04:36:06 2004 +0000
@@ -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 @@
 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 @@
        @${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 -r 3792922fd666 -r d5bbe06b88dd www/netscape7/files/binpatch-x86-unknown-linux2.2.5-7.1.sh
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/www/netscape7/files/binpatch-x86-unknown-linux2.2.5-7.1.sh        Tue Jul 27 04:36:06 2004 +0000
@@ -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@localhost> 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



Home | Main Index | Thread Index | Old Index