--- nspluginwrapper-1.1.0.orig/debian/rules +++ nspluginwrapper-1.1.0/debian/rules @@ -0,0 +1,94 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# debian/rules that uses debhelper. + +# Uncomment this to turn on verbose mode. +# export DH_VERBOSE=1 + +# quilty comfort +include /usr/share/quilt/quilt.make + +# These are used for cross-compiling and for saving the configure script +# from having to guess our platform (since we know it already) +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) + +# Report all warnings, generate debugging symbols (don't worry, we dh_strip) +CFLAGS = -Wall -g + +# Conditional optimmisation +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif + +CONFIG_FLAGS = \ + --host=$(DEB_HOST_GNU_TYPE) \ + --build=$(DEB_BUILD_GNU_TYPE) \ + --prefix=/usr \ + $(NULL) + +ifneq (,$(findstring x86_64,$(DEB_HOST_GNU_TYPE))) +CONFIG_FLAGS += \ + --with-lib32=lib32 \ + --with-lib64=lib \ + --biarch \ + $(NULL) +endif + + +configure: patch configure-stamp +configure-stamp: + dh_testdir + ./configure $(CONFIG_FLAGS) \ + CFLAGS="$(CFLAGS)" \ + LDFLAGS="-Wl,-z,defs" + touch $@ + +build: configure build-stamp +build-stamp: + dh_testdir + $(MAKE) + touch $@ + +clean: clean-patched unpatch +clean-patched: + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp + [ ! -f Makefile ] || $(MAKE) distclean + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + $(MAKE) DESTDIR=$(CURDIR)/debian/nspluginwrapper install + + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + dh_installchangelogs ChangeLog + dh_installdocs + dh_installexamples + dh_installman debian/nspluginwrapper.1 debian/nspluginplayer.1 + 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 --- nspluginwrapper-1.1.0.orig/debian/nspluginplayer.1 +++ nspluginwrapper-1.1.0/debian/nspluginplayer.1 @@ -0,0 +1,65 @@ +.\" Hey, EMACS: -*- nroff -*- +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH NSPLUGINPLAYER 1 "August 27, 2008" +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.SH NAME +nspluginplayer \- tool to play embedded web content +.SH SYNOPSIS +.B nspluginplayer +.RI [ option ]\ [ \-\-plugin ]\ [ name[=value] ] +.SH DESCRIPTION +This manual page documents briefly the +.B nspluginplayer +command. +.PP +\fBnspluginplayer\fP enables playing of embedded web content outside of the +web browser. +.SH USAGE +Common attributes include, which are used in place of +.RI [ name[=value] ] +parameter: +.TP +.B embed +use NP_EMBED mode +.TP +.B full +use NP_FULL mode (default) +.TP +.B src\=URI +location (URL) of the object to load +.TP +.B type\=MIME-TYPE +MIME type of the object +.TP +.B width\=WIDTH +width (in pixels) +.TP +.B height\=HEIGHT +height (in pixels) +.SH OPTIONS +A summary of options is included below. +.TP +.B \-v \-\-verbose +Enable verbose mode +.TP +.B \-f \-\-fullscreen +Start in fullscreen + +.SH AUTHOR +nspluginplayer was written by Gwenole Beauchesne . +.PP +This manual page was written by Sasa Bodiroza , +for the Ubuntu project (but may be used by others). --- nspluginwrapper-1.1.0.orig/debian/dirs +++ nspluginwrapper-1.1.0/debian/dirs @@ -0,0 +1,4 @@ +usr/bin +usr/lib/nspluginwrapper/plugins +usr/lib/mozilla/plugins +usr/lib/firefox/plugins --- nspluginwrapper-1.1.0.orig/debian/README.Debian +++ nspluginwrapper-1.1.0/debian/README.Debian @@ -0,0 +1,37 @@ +nspluginwrapper for Debian +-------------------------- + +nspluginwrapper is an RPC-based mechanism for running non-native plugins +built for the Netscape 4 plugin API (NPAPI) on architectures they were +not built for. For example, this allows you to use the Flash plugin for +the i386 architecture on an amd64 machine running a native 64-bit browser. + +It is known to work with Firefox, Iceweasel, Mozilla, Iceape and Konqueror. + +nspluginwrapper for Debian is built exclusively for the amd64 architecture +because the ia32-libs and ia32-libs-gtk packages are not available on other +architectures, and a gcc with target i386 is not available for ia64. Were +these available for, e.g. the PowerPC platform, it would be possible to +package nspluginwrapper for that platform. However, cross-compilers for the +i386 architecture would need to be made available, and this is highly +unlikely. + +Since Debian does not package any binary-only plugins, no automated +mechanism for automated nspluginwrapperisation is provided. Instead, +download the plugin and unpack it to a location where it will remain and +run: + + nspluginwrapper -i /path/to/npplugin.so + +To remove a plugin, run: + + nspluginwrapper -r ~/.mozilla/plugins/npwrapper.npplugin.so + +Alternately, install any plugins as normal into your .mozilla/plugins/ +directory and run: + + nspluginwrapper -a -u -v + +To automatically install any compatibility stubs without prompting. + + -- Rob Andrews Wed, 11 Apr 2007 19:14:03 +0100 --- nspluginwrapper-1.1.0.orig/debian/docs +++ nspluginwrapper-1.1.0/debian/docs @@ -0,0 +1,3 @@ +NEWS +README +TODO --- nspluginwrapper-1.1.0.orig/debian/compat +++ nspluginwrapper-1.1.0/debian/compat @@ -0,0 +1 @@ +5 --- nspluginwrapper-1.1.0.orig/debian/copyright +++ nspluginwrapper-1.1.0/debian/copyright @@ -0,0 +1,28 @@ +This package was debianized by Rob Andrews on +Wed, 14 Feb 2007 00:12:53 +0000. + +It was downloaded from http://gwenole.beauchesne.info/en/projects/nspluginwrapper + +Upstream Author: Gwenole Beauchesne + +Copyright: 2006 Gwenole Beauchesne + +License: + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + See /usr/share/common-licenses/GPL-2 on your debian system. + +The Debian packaging is (C) 2007, Rob Andrews and +is licensed under the GPL, see `/usr/share/common-licenses/GPL-2'. --- nspluginwrapper-1.1.0.orig/debian/nspluginwrapper.1 +++ nspluginwrapper-1.1.0/debian/nspluginwrapper.1 @@ -0,0 +1,61 @@ +.\" Hey, EMACS: -*- nroff -*- +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH NSPLUGINWRAPPER 1 "September 2, 2007" +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.SH NAME +nspluginwrapper \- tool to manage nspluginwrapper-wrapped plugins +.SH SYNOPSIS +.B nspluginwrapper +.RI [ options ] +.SH DESCRIPTION +This manual page documents briefly the +.B nspluginwrapper +command. +.PP +\fBnspluginwrapper\fP is a compatibility layer to allow the usage of non-native +plugins in a web browser supporting the Netscape 4 plugin API (NPAPI). +.SH OPTIONS +A summary of options is included below. +.TP +.B \-h +Display help and exit +.TP +.B \-i \fInpPLUGIN.so\fP +Install wrapper for npPLUGIN.so into the mozilla plugins directory +.TP +.B \-r \fI/path/to/npwrapper.npPLUGIN.so\fP +Remove the wrapper for npPLUGIN.so +.TP +.B \-u \fInpPLUGIN.so\fP +Update the plugin wrapper for npPLUGIN.so +.TP +.B \-a +Set automatic mode for plugins discovery - overrides \-i and \-u to automatically determine plugins installed +.TP +.B \-l +List plugins currently installed +.TP +.B \-n +Do not create or remove any Debian browser-specific symlinks upon installation +or removal of plugin wrappers. +.TP +.B \-v +Show verbose messages +.SH AUTHOR +nspluginwrapper was written by Gwenole Beauchesne . +.PP +This manual page was written by Rob Andrews , +for the Debian project (but may be used by others). --- nspluginwrapper-1.1.0.orig/debian/control +++ nspluginwrapper-1.1.0/debian/control @@ -0,0 +1,19 @@ +Source: nspluginwrapper +Section: utils +Priority: optional +Maintainer: Ubuntu MOTU Developers +XSBC-Original-Maintainer: Rob Andrews +Build-Depends: debhelper (>= 5), quilt, autotools-dev, libc6-dev-i386 [ amd64 ], libxt-dev, x11proto-core-dev, x11proto-xext-dev, libx11-dev, libatk1.0-dev, libfontconfig1-dev, libgtk2.0-dev, libglib2.0-dev, libpango1.0-dev, ia32-libs [ amd64 ], gcc-multilib [ amd64 ], g++-multilib [ amd64 ], libcurl4-gnutls-dev +Standards-Version: 3.8.0 +Xs-Vcs-Bzr: http://bazaar.launchpad.net/~ubuntu-dev/nspluginwrapper/ubuntu + +Package: nspluginwrapper +Architecture: amd64 i386 +Depends: ${shlibs:Depends} +Description: A wrapper to run Netscape plugins on other architectures + nspluginwrapper is an Open Source compatibility plugin for Netscape 4 + (NPAPI) plugins. That is, it enables you to use plugins on platforms + they were not built for. + . + This package is built to run i386 plugins, since there are no known + binary-only plugins built for any other architecture. --- nspluginwrapper-1.1.0.orig/debian/watch +++ nspluginwrapper-1.1.0/debian/watch @@ -0,0 +1,8 @@ +# watch control file for uscan +# See uscan(1) for format + +# Compulsory line, this is a version 3 file +version=3 + +# +http://gwenole.beauchesne.info/en/projects/nspluginwrapper .*/nspluginwrapper-(.*)\.tar\.bz2 --- nspluginwrapper-1.1.0.orig/debian/changelog +++ nspluginwrapper-1.1.0/debian/changelog @@ -0,0 +1,258 @@ +nspluginwrapper (1.1.0-0ubuntu3~ppa1) intrepid; urgency=low + + * Disable windowless mode: + - add deian/patches/008_disable_wmode.diff + - update debian/patches/series + + -- Conn O Griofa Fri, 19 Sep 2008 21:46:14 +0100 + +nspluginwrapper (1.1.0-0ubuntu2) intrepid; urgency=low + + * fix firefox crashes by null-deref of visual-id by Martin Stransky + - nspluginwrapper-1.1.0-visual-id.patch (rev 1.1) + - add debian/005_crash_in_visual_id.diff + * more fedora patch synchs: + + nspluginwrapper-1.1.0-runtime-restart.patch (rev 1.2) + - add debian/patches/006_runtime-restart.diff + - update debian/patches/series + + nspluginwrapper-1.1.0-fork.patch (rev 1.2) + - add debian/patches/007_redhat_fork.diff + - update debian/patches/series + + -- Alexander Sack Tue, 02 Sep 2008 14:50:40 +0200 + +nspluginwrapper (1.1.0-0ubuntu1) intrepid; urgency=low + + * Add libcurl4-gnutls-dev as build-depenedency + + -- Sasa Bodiroza Thu, 28 Aug 2008 00:48:30 +0200 + +nspluginwrapper (1.1.0-0ubuntu1~mt2) intrepid; urgency=low + + * Bump Standards-Version in debian/control + * Fix lintian warning debian-rules-ignores-make-clean-error + + -- Sasa Bodiroza Wed, 27 Aug 2008 03:16:09 +0200 + +nspluginwrapper (1.1.0-0ubuntu1~mt1) intrepid; urgency=low + + * New upstream release + * Refresh patches + * Add manpage for nspluginplayer: + - Add debian/nspluginplayer.1 + - Add it to dh_installman call in debian/rules + * Fix Section field (universe/utils to utils) in debian/control + * Don't install empty dirs usr/sbin and usr/lib/iceweasel/plugins in + debian/dirs + + -- Sasa Bodiroza Wed, 27 Aug 2008 02:52:30 +0200 + +nspluginwrapper (1.0.0-0ubuntu1~mt1) intrepid; urgency=low + + * New upstream release + * Refresh patches: + - 000_debian_make_symlinks.diff - modify is_system_wide_plugin_wrapper() + to has_system_wide_plugin_wrapper() + - 001_remove_bashisms.diff + - 002_install_to_NSPLUGINDIR.diff + - 003_update_help_info.diff + - 004_fix_threading.diff - remove part for src/npw-viewer.c, applied + upstream + + -- Sasa Bodiroza Fri, 01 Aug 2008 03:56:07 +0200 + +nspluginwrapper (0.9.91.5-2ubuntu3~mt1) intrepid; urgency=low + + * debian/control: i386 support requires us to make a bunch of biarch + build depends arch dependent [amd64] + * 004_fix_threading.diff: we take care that i386 build succeeds and update + the thread to add the -lgthread-2.0 flag outside biarch-only scope in + Makefile + * debian/rules: if we are not on x86_64 we dont want to use the lib32 + and biarch configure switches. + + -- Alexander Sack Tue, 22 Jul 2008 16:14:26 +0200 + +nspluginwrapper (0.9.91.5-2ubuntu2) hardy; urgency=low + + * No source change rebuild to resolve crashing against xulrunner 1.9b5 + - MOTU Release approved (LP: #212855) + + -- John Dong Thu, 10 Apr 2008 14:01:35 -0400 + +nspluginwrapper (0.9.91.5-2ubuntu1) hardy; urgency=low + + [ Stefan Ebner ] + * Merge from Debian unstable. (LP: #196540) Remaining Ubuntu changes: + * debian/control: + - Modify Maintainer value to match Debian-Maintainer-Field Spec + - Removed ia32-libs-gtk and util-linux from depends + - Changed Xs-Vcs-Bzr field to Xs-Vcs-Bzr: + http://code.launchpad.net/~ubuntu-dev/nspluginwrapper/ubuntu + + [ Christopher James Halse Rogers ] + * New Ubuntu changes: + * debian/shlibs.local: + - Drop. We don't have a ia32-libs-gtk package, and the package builds + fine without it. + + -- Christopher James Halse Rogers Tue, 18 Mar 2008 20:22:14 +1100 + +nspluginwrapper (0.9.91.5-2) unstable; urgency=low + + * linux32 is now provided by util-linux, so remove runtime dep on + linux32 (no longer installable) + * Fix issues on SMP by initialising and using gthreads in glib + - patch is 004_fix_threading.diff (Closes: #458584) + * Enable 003_update_help_info.diff, which for some reason I forgot to + put into the quilt series file + * Add a shlibs.local file for ia32-libs-gtk dep generation - in the + absence of a ia32-libs-gtk-dev package, this fixes the FTBFS + Thanks to Dan Callahan (Closes: #462198) + + -- Rob Andrews Mon, 28 Jan 2008 23:27:29 +0000 + +nspluginwrapper (0.9.91.5-1ubuntu1) gutsy; urgency=low + + [ Scott Kitterman ] + * Merge from Debian unstable. Remaining Ubuntu changes: + * debian/control: + - Changed maintainer field to Ubuntu MOTU Developers + + - Moved old maintainer to XSBC-Original-Maintainer: Rob Andrews + + - Removed ia32-libs-gtk from depends + - Changed Xs-Vcs-Bzr field to Xs-Vcs-Bzr: + http://code.launchpad.net/~ubuntu-core-dev/nspluginwrapper/ubuntu + + [ Philipp Kern ] + * debian/control: + - Removed the linux32 dependency; the corresponding binary is + provided by util-linux on Ubuntu. + + -- Philipp Kern Wed, 10 Oct 2007 22:47:28 +0200 + +nspluginwrapper (0.9.91.5-1) unstable; urgency=low + + * New upstream release + * Remove 003_fix_xembed_grab_keys.diff, as 0.9.91.5 fixes this issue + * Remove manual dependencies on ia32-libs, the build-dep covers this + issue + * Add 003_update_help_info.diff, specify that a plugin is needed when + using -u option, also update manpage accordingly (Closes: #436410) + + -- Rob Andrews Sun, 02 Sep 2007 11:38:43 +0100 + +nspluginwrapper (0.9.91.4-4) unstable; urgency=low + + * Change Priority: extra to "optional" + * Add patch 002_install_to_NSPLUGINDIR.patch from Ubuntu + (thanks Alexander Sack) + * Fix XEmbed issue where plugin was able to grab keystrokes + from other applications when browser had lost focus + - patch is 003_fix_xembed_grab_keys.diff + (Closes: #435912) + + -- Rob Andrews Sun, 19 Aug 2007 20:17:33 +0100 + +nspluginwrapper (0.9.91.4-3ubuntu2) gutsy; urgency=low + + * debian/patches/series: enable previously forgotten + 002_install_to_NSPLUGINDIR.patch. + + -- Alexander Sack Fri, 10 Aug 2007 13:27:39 +0200 + +nspluginwrapper (0.9.91.4-3ubuntu1) gutsy; urgency=low + + * debian/patches: added 002_install_to_NSPLUGINDIR.patch + * debian/patches/series: updated as needed + * debian/control: + - Changed maintainer field to Ubuntu MOTU Developers + + - Moved old maintainer to XSBC-Original-Maintainer: Rob Andrews + + - Removed ia32-libs-gtk from depends + - Added ia32-libs to depends + - Added gcc-multilib to build-deps + - Changed Xs-Vcs-Bzr field to Xs-Vcs-Bzr: + http://code.launchpad.net/~ubuntu-core-dev/nspluginwrapper/ubuntu + + [ Alexander Sack ] + * sponsor upload after merging latest changes to bzr. + + -- John Vivirito Mon, 02 Jul 2007 14:30:50 -0400 + +nspluginwrapper (0.9.91.4-3) unstable; urgency=low + + * Shift to using quilt, as it helps me revision control the Debian + packaging with git + * Really should be depending on gcc-multilib, not required yet but may + break build in future + * Add manual dependency on ia32-libs for the target package, since it is + not automatically determined + * Inherit "remove bashisms" patch from Ubuntu, to remove bashisms (oddly + enough!) - patch by Anders Kaseorg + * Add a -n option to the nspluginwrapper commandline to skip creation and + destruction of symlinks - this behaviour is more predictable when + packaging plugins for Debian and derivatives + + -- Rob Andrews Fri, 29 Jun 2007 22:06:02 +0100 + +nspluginwrapper (0.9.91.4-2ubuntu2) gutsy; urgency=low + + * utils/mkruntime.sh: applied anti-bashism patch by Anders + Kaseorg (LP #121066) + + [ Alexander Sack ] + * checked and sponsored upload + + -- John Vivirito Thu, 28 Jun 2007 08:06:24 -0400 + +nspluginwrapper (0.9.91.4-2ubuntu1) gutsy; urgency=low + + [ Alexander Sack ] + * src/npw-config.c: NSPLUGIN_DIR environment can override default + mozilla_system_dir and can specify custom install dir for created + wrapper library. + * debian/control: use MOTU as maintainer; drop ia32-libs-gtk from Depends + (since gutsy provided by ia32-libs). + + -- Alexander Sack Wed, 20 Jun 2007 14:00:05 +0200 + +nspluginwrapper (0.9.91.4-2) unstable; urgency=low + + * Add build dependency on g++-multilib + (Closes: #423131, thanks Pär Andersson) + + -- Rob Andrews Thu, 10 May 2007 12:17:09 -0400 + +nspluginwrapper (0.9.91.4-1) unstable; urgency=low + + * New upstream release + * Install into /usr/lib/nspluginwrapper/plugins and symlink to + browser-specific plugin paths (Closes: #417288) + * (to compliment the above) Remove symlinks to plugins on removal + Only operates on symlinks in global directorys, includes: + /usr/lib/firefox/plugins + /usr/lib/iceweasel/plugins + /usr/lib/mozilla/plugins + * Remove ia64 from the architecture list - there isn't a compiler available + to build i386 binaries on the architecture + * Explicitly set --with-lib32, as otherwise it assumes it to be /usr/lib + * Explicitly set --with-lib64, as otherwise it assumes it to be /usr/lib64 + * Not autoconf/automake, so don't need config.sub/config.guess + + -- Rob Andrews Wed, 11 Apr 2007 19:14:03 +0100 + +nspluginwrapper (0.9.91.3-1) unstable; urgency=low + + * New upstream release + + -- Rob Andrews Mon, 5 Mar 2007 14:44:48 +0000 + +nspluginwrapper (0.9.91.2-1) unstable; urgency=low + + * Initial release (Closes: #410061) + + -- Rob Andrews Wed, 14 Feb 2007 00:12:53 +0000 + --- nspluginwrapper-1.1.0.orig/debian/patches/008_disable_wmode.diff +++ nspluginwrapper-1.1.0/debian/patches/008_disable_wmode.diff @@ -0,0 +1,11 @@ +--- nspluginwrapper-1.1.0_old/src/npw-viewer.c 2008-09-19 03:39:07.000000000 +0100 ++++ nspluginwrapper-1.1.0/src/npw-viewer.c 2008-09-19 03:39:21.000000000 +0100 +@@ -62,7 +62,7 @@ + #define USE_XEMBED 1 + + // Define to allow windowless plugins +-#define ALLOW_WINDOWLESS_PLUGINS 1 ++#define ALLOW_WINDOWLESS_PLUGINS 0 + + // XXX unimplemented functions + #define UNIMPLEMENTED() npw_printf("WARNING: Unimplemented function %s at line %d\n", __func__, __LINE__) --- nspluginwrapper-1.1.0.orig/debian/patches/005_crash_in_visual_id.diff +++ nspluginwrapper-1.1.0/debian/patches/005_crash_in_visual_id.diff @@ -0,0 +1,33 @@ + +* Mon Aug 04 2008 Martin Stransky 1.1.0-5 + - Added fix for #456432 -(Windowless Crash) Flash 10 w/ Firefox 3 + +-- +--- + src/npw-rpc.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +Index: nspluginwrapper.ubuntu/src/npw-rpc.c +=================================================================== +--- nspluginwrapper.ubuntu.orig/src/npw-rpc.c 2008-09-02 14:23:10.000000000 +0200 ++++ nspluginwrapper.ubuntu/src/npw-rpc.c 2008-09-02 14:31:57.000000000 +0200 +@@ -376,17 +376,18 @@ + NPSetWindowCallbackStruct *ws_info = (NPSetWindowCallbackStruct *)p_value; + int error; + + if (ws_info) { + if ((error = rpc_message_send_uint32(message, 1)) < 0) + return error; + if ((error = rpc_message_send_int32(message, ws_info->type)) < 0) + return error; +- if ((error = rpc_message_send_uint32(message, XVisualIDFromVisual(ws_info->visual))) < 0) ++ uint32_t visual_id = ws_info->visual != NULL ? XVisualIDFromVisual(ws_info->visual) : 0; ++ if ((error = rpc_message_send_uint32(message, visual_id)) < 0) + return error; + if ((error = rpc_message_send_uint32(message, ws_info->colormap)) < 0) + return error; + if ((error = rpc_message_send_uint32(message, ws_info->depth)) < 0) + return error; + } + else { + if ((error = rpc_message_send_uint32(message, 0)) < 0) --- nspluginwrapper-1.1.0.orig/debian/patches/002_install_to_NSPLUGINDIR.diff +++ nspluginwrapper-1.1.0/debian/patches/002_install_to_NSPLUGINDIR.diff @@ -0,0 +1,22 @@ +Allow plugins to be installed to a directory specified by environment +variable NSPLUGIN_DIR. + +Patch from Alexander Sack. + + -- Rob Andrews Sat, 14 Jul 2007 18:45:00 +0100 + +Index: ubuntu-1.1.0/src/npw-config.c +=================================================================== +--- ubuntu-1.1.0.orig/src/npw-config.c 2008-07-31 02:43:39.000000000 +0200 ++++ ubuntu-1.1.0/src/npw-config.c 2008-07-31 02:44:08.000000000 +0200 +@@ -124,6 +124,10 @@ + static const char default_dir[] = LIBDIR "/mozilla/plugins"; + static const char *dir = NULL; + ++ char *plugin_dir = getenv("NSPLUGIN_DIR"); ++ if(plugin_dir) ++ return plugin_dir; ++ + if (dir == NULL) { + const char **dirs = NULL; + --- nspluginwrapper-1.1.0.orig/debian/patches/004_fix_threading.diff +++ nspluginwrapper-1.1.0/debian/patches/004_fix_threading.diff @@ -0,0 +1,17 @@ +Patch from svn r480, fixes SMP breakage. + + -- Rob Andrews Sat, 26 Jan 2008 03:01:31 +0000 + +Index: ubuntu-1.1.0/Makefile +=================================================================== +--- ubuntu-1.1.0.orig/Makefile 2008-07-31 02:42:48.000000000 +0200 ++++ ubuntu-1.1.0/Makefile 2008-07-31 02:45:50.000000000 +0200 +@@ -103,7 +103,7 @@ + npviewer_CFLAGS += -I$(LSB_INC_DIR)/glib-2.0 + npviewer_CFLAGS += -I$(LSB_INC_DIR)/gtk-2.0 + npviewer_LDFLAGS = $(LDFLAGS_32) -L$(LSB_OBJ_DIR) +-npviewer_LDFLAGS += -lgtk-x11-2.0 -lgdk-x11-2.0 -lgobject-2.0 -ldl -lglib-2.0 -lX11 -lXt ++npviewer_LDFLAGS += -lgtk-x11-2.0 -lgdk-x11-2.0 -lgobject-2.0 -ldl -lglib-2.0 -lgthread-2.0 -lX11 -lXt + else + npviewer_CFLAGS += $(GTK_CFLAGS) + npviewer_LDFLAGS = $(GTK_LDFLAGS) $(X_LDFLAGS) --- nspluginwrapper-1.1.0.orig/debian/patches/000_debian_make_symlinks.diff +++ nspluginwrapper-1.1.0/debian/patches/000_debian_make_symlinks.diff @@ -0,0 +1,160 @@ +Create the plugin wrapper in a global location and install a symlink into +the browser-specific plugin paths when installing globally. +Also removes the symlinks on uninstallation. + +Commandline option "-n" or "--nosymlink" doesn't perform any operations on +symlinks on installation and removal. + + -- Rob Andrews Fri, 29 Jun 2007 21:59:49 +0100 + +Index: ubuntu-1.1.0/src/npw-config.c +=================================================================== +--- ubuntu-1.1.0.orig/src/npw-config.c 2008-07-31 02:42:49.000000000 +0200 ++++ ubuntu-1.1.0/src/npw-config.c 2008-07-31 02:43:39.000000000 +0200 +@@ -43,6 +43,17 @@ + static bool g_verbose = false; + static const char NPW_CONFIG[] = "nspluginwrapper"; + ++/* On Debian systems, we install/remove symlinks from these paths. ++ * This information is used twice, so declare globally */ ++static bool g_dosymlink = true; ++static const char *debian_link_dirs[] = { ++ LIBDIR "/mozilla/plugins", ++ LIBDIR "/firefox/plugins", ++ LIBDIR "/iceweasel/plugins", ++ NULL, /* if this isn't here, it reads into whatever data is in memory after ++ possibly differing in behaviour to the same code in functions */ ++}; ++ + static void error(const char *format, ...) + { + va_list args; +@@ -152,7 +163,7 @@ + } + else if (access("/etc/debian_version", F_OK) == 0) { + static const char *debian_dirs[] = { +- "/usr/lib/mozilla/plugins", // XXX how unfortunate ++ LIBDIR "/nspluginwrapper/plugins", + }; + dirs = debian_dirs; + } +@@ -794,6 +805,49 @@ + printf(" into %s\n", d_plugin_path); + + free(plugin_data); ++ ++ /* Install symlinks on Debian systems */ ++ if (has_system_wide_wrapper_plugin(plugin_path, true) ++ && (access("/etc/debian_version", F_OK) == 0) ++ && (g_dosymlink == true)) ++ { ++ static const char *ldir = NULL; ++ const char **ldirs = NULL; ++ char *lname = NULL; ++ ++ ldirs = debian_link_dirs; ++ ++ while ((ldir = *ldirs++) != NULL) ++ { ++ if (access(ldir, F_OK) == 0) ++ { ++ /* Can write to this directory, make a symlink in it */ ++ if (g_verbose) ++ printf("And create symlink to plugin in %s: ", ldir); ++ ++ if ((lname = malloc(strlen(ldir) + strlen(NPW_WRAPPER_BASE) + strlen(plugin_base) + 3)) != NULL) ++ { ++ sprintf(lname, "%s/%s.%s", ldir, NPW_WRAPPER_BASE, plugin_base); ++ ++ if (symlink(d_plugin_path, lname) == 0) ++ { ++ if (g_verbose) ++ printf("done.\n"); ++ } ++ else ++ { ++ if (g_verbose) ++ printf("failed!\n"); ++ } ++ ++ free(lname); ++ } ++ else ++ if (g_verbose) ++ printf("*gulp* malloc() failed!\n"); ++ } ++ } ++ } + return 0; + } + +@@ -853,6 +907,48 @@ + if (unlink(plugin_path) < 0) + return 1; + ++ /* Remove links to the plugin on Debian systems */ ++ if ((access("/etc/debian_version", F_OK) == 0) && (g_dosymlink == true)) ++ { ++ static const char *ldir = NULL; ++ const char **ldirs = NULL; ++ char *lname = NULL; ++ char *plugin_base = strrchr(plugin_path, '/'); ++ char *lbuf = NULL; ++ ++ if (plugin_base == NULL) ++ return 1; ++ else ++ plugin_base++; ++ ++ ldirs = debian_link_dirs; ++ ++ while ((ldir = *ldirs++) != NULL) ++ { ++ if ((lname = malloc(strlen(ldir) + strlen(plugin_base) + 2)) == NULL) ++ return 1; ++ ++ sprintf(lname, "%s/%s", ldir, plugin_base); ++ lbuf = malloc(strlen(plugin_path) + 1); ++ ++ if (readlink(lname, lbuf, strlen(plugin_path)) > 0) ++ { ++ /* readlink doesn't null terminate */ ++ *(lbuf + strlen(plugin_path)) = 0; ++ ++ if (strcmp(lbuf, plugin_path) == 0) ++ { ++ unlink(lname); ++ if (g_verbose) ++ printf("Deleted symlink '%s' to this plugin.\n", lname); ++ } ++ } ++ ++ free(lname); ++ free(lbuf); ++ } ++ } ++ + return 0; + } + +@@ -993,6 +1089,12 @@ + return 0; + } + ++static int process_nolink(int argc, char *argv[]) ++{ ++ g_dosymlink = false; ++ return 0; ++} ++ + static int process_list(int argvc, char *argv[]) + { + const char **plugin_dirs = get_mozilla_plugin_dirs(); +@@ -1111,6 +1213,7 @@ + { 'v', "verbose", process_verbose, 0 }, + { 'a', "auto", process_auto, 0 }, + { 'l', "list", process_list, 1 }, ++ { 'n', "nosymlinks", process_nolink, 0 }, + { 'u', "update", process_update, 1 }, + { 'i', "install", process_install, 1 }, + { 'r', "remove", process_remove, 1 }, --- nspluginwrapper-1.1.0.orig/debian/patches/001_remove_bashisms.diff +++ nspluginwrapper-1.1.0/debian/patches/001_remove_bashisms.diff @@ -0,0 +1,28 @@ +Anti-bashism patch inherited from Ubuntu. +Author: Anders Kaseorg + + -- Rob Andrews Thu, 28 Jun 2007 18:08:54 +0100 + +Index: ubuntu-1.1.0/utils/mkruntime.sh +=================================================================== +--- ubuntu-1.1.0.orig/utils/mkruntime.sh 2008-07-31 02:42:49.000000000 +0200 ++++ ubuntu-1.1.0/utils/mkruntime.sh 2008-07-31 02:43:50.000000000 +0200 +@@ -12,15 +12,15 @@ + # - Check acroread5, something is missing while loading a PDF + # - Enough for Flash Player & PluginSDK npsimple.so + +-function error() { ++error() { + echo ${1+"$@"} > /dev/stderr + } + +-function status() { ++status() { + echo ${1+"$@"} > /dev/stderr + } + +-function run() { ++run() { + status " " ${1+"$@"} + ${1+"$@"} + } --- nspluginwrapper-1.1.0.orig/debian/patches/series +++ nspluginwrapper-1.1.0/debian/patches/series @@ -0,0 +1,9 @@ +000_debian_make_symlinks.diff +001_remove_bashisms.diff +002_install_to_NSPLUGINDIR.diff +003_update_help_info.diff +008_disable_wmode.diff +004_fix_threading.diff +005_crash_in_visual_id.diff +006_runtime-restart.diff +007_redhat_fork.diff --- nspluginwrapper-1.1.0.orig/debian/patches/007_redhat_fork.diff +++ nspluginwrapper-1.1.0/debian/patches/007_redhat_fork.diff @@ -0,0 +1,421 @@ +diff -up nspluginwrapper-1.1.0/src/npw-viewer.c.fork nspluginwrapper-1.1.0/src/npw-viewer.c +--- nspluginwrapper-1.1.0/src/npw-viewer.c.fork 2008-07-15 15:33:06.000000000 +0200 ++++ nspluginwrapper-1.1.0/src/npw-viewer.c 2008-07-15 15:42:07.000000000 +0200 +@@ -67,6 +67,20 @@ + // RPC global connections + rpc_connection_t *g_rpc_connection attribute_hidden = NULL; + ++// Viewer orignal pid - check against incorrect plugins ++pid_t viewer_pid = 0; ++ ++// Pid support routines ++void pid_set(void) ++{ ++ viewer_pid = getpid(); ++} ++ ++int pid_check(void) ++{ ++ return(viewer_pid == getpid()); ++} ++ + // Instance state information about the plugin + typedef struct _PluginInstance { + NPP instance; +@@ -581,6 +595,9 @@ static void + g_NPN_ForceRedraw(NPP instance) + { + D(bug("NPN_ForceRedraw instance=%p\n", instance)); ++ ++ if(!pid_check()) ++ return; + + UNIMPLEMENTED(); + } +@@ -615,9 +632,11 @@ invoke_NPN_GetURL(NPP instance, const ch + static NPError + g_NPN_GetURL(NPP instance, const char *url, const char *target) + { ++ if(!pid_check()) ++ return NPERR_INVALID_INSTANCE_ERROR; + if (instance == NULL) + return NPERR_INVALID_INSTANCE_ERROR; +- ++ + D(bug("NPN_GetURL instance=%p\n", instance)); + NPError ret = invoke_NPN_GetURL(instance, url, target); + D(bug(" return: %d [%s]\n", ret, string_of_NPError(ret))); +@@ -655,6 +674,9 @@ invoke_NPN_GetURLNotify(NPP instance, co + static NPError + g_NPN_GetURLNotify(NPP instance, const char *url, const char *target, void *notifyData) + { ++ if(!pid_check()) ++ return NPERR_INVALID_INSTANCE_ERROR; ++ + if (instance == NULL) + return NPERR_INVALID_INSTANCE_ERROR; + +@@ -743,8 +765,11 @@ get_real_netscape_window(NPP instance) + + static NPError + g_NPN_GetValue(NPP instance, NPNVariable variable, void *value) +-{ ++{ + D(bug("NPN_GetValue instance=%p, variable=%d [%08x]\n", instance, variable & 0xffff, variable)); ++ ++ if(!pid_check()) ++ return NPERR_INVALID_INSTANCE_ERROR; + + switch (variable) { + case NPNVxDisplay: +@@ -837,6 +862,9 @@ g_NPN_InvalidateRect(NPP instance, NPRec + { + if (instance == NULL || invalidRect == NULL) + return; ++ ++ if(!pid_check()) ++ return; + + D(bug("NPN_InvalidateRect instance=%p\n", instance)); + invoke_NPN_InvalidateRect(instance, invalidRect); +@@ -848,6 +876,9 @@ static void + g_NPN_InvalidateRegion(NPP instance, NPRegion invalidRegion) + { + D(bug("NPN_InvalidateRegion instance=%p\n", instance)); ++ ++ if(!pid_check()) ++ return; + + UNIMPLEMENTED(); + } +@@ -911,6 +942,8 @@ invoke_NPN_PostURL(NPP instance, const c + static NPError + g_NPN_PostURL(NPP instance, const char *url, const char *target, uint32 len, const char *buf, NPBool file) + { ++ if(!pid_check()) ++ return NPERR_INVALID_INSTANCE_ERROR; + if (instance == NULL) + return NPERR_INVALID_INSTANCE_ERROR; + +@@ -953,6 +986,9 @@ invoke_NPN_PostURLNotify(NPP instance, c + static NPError + g_NPN_PostURLNotify(NPP instance, const char *url, const char *target, uint32 len, const char *buf, NPBool file, void *notifyData) + { ++ if(!pid_check()) ++ return NPERR_INVALID_INSTANCE_ERROR; ++ + if (instance == NULL) + return NPERR_INVALID_INSTANCE_ERROR; + +@@ -967,6 +1003,9 @@ static void + g_NPN_ReloadPlugins(NPBool reloadPages) + { + D(bug("NPN_ReloadPlugins reloadPages=%d\n", reloadPages)); ++ ++ if(!pid_check()) ++ return; + + UNIMPLEMENTED(); + } +@@ -976,6 +1015,9 @@ static JRIEnv * + g_NPN_GetJavaEnv(void) + { + D(bug("NPN_GetJavaEnv\n")); ++ ++ if(!pid_check()) ++ return NULL; + + return NULL; + } +@@ -985,6 +1027,9 @@ static jref + g_NPN_GetJavaPeer(NPP instance) + { + D(bug("NPN_GetJavaPeer instance=%p\n", instance)); ++ ++ if(!pid_check()) ++ return NULL; + + return NULL; + } +@@ -1018,6 +1063,8 @@ invoke_NPN_RequestRead(NPStream *stream, + static NPError + g_NPN_RequestRead(NPStream *stream, NPByteRange *rangeList) + { ++ if(!pid_check()) ++ return NPERR_INVALID_INSTANCE_ERROR; + if (stream == NULL || stream->ndata == NULL || rangeList == NULL) + return NPERR_INVALID_PARAM; + +@@ -1066,10 +1113,13 @@ g_NPN_SetValue(NPP instance, NPPVariable + if (instance == NULL) + return NPERR_INVALID_INSTANCE_ERROR; + ++ if(!pid_check()) ++ return NPERR_INVALID_INSTANCE_ERROR; ++ + PluginInstance *plugin = PLUGIN_INSTANCE(instance); + if (plugin == NULL) + return NPERR_INVALID_INSTANCE_ERROR; +- ++ + D(bug("NPN_SetValue instance=%p, variable=%d\n", instance, variable)); + NPError ret = invoke_NPN_SetValue(plugin, variable, value); + D(bug(" return: %d [%s]\n", ret, string_of_NPError(ret))); +@@ -1102,6 +1152,9 @@ invoke_NPN_Status(NPP instance, const ch + static void + g_NPN_Status(NPP instance, const char *message) + { ++ if(!pid_check()) ++ return; ++ + D(bug("NPN_Status instance=%p\n", instance)); + invoke_NPN_Status(instance, message); + D(bug(" done\n")); +@@ -1130,6 +1183,11 @@ invoke_NPN_UserAgent(void) + static const char * + g_NPN_UserAgent(NPP instance) + { ++ if(!pid_check()) { ++ static char tmp_agent_string[] = "None"; ++ return tmp_agent_string; ++ } ++ + D(bug("NPN_UserAgent instance=%p\n", instance)); + if (g_user_agent == NULL) + g_user_agent = invoke_NPN_UserAgent(); +@@ -1212,6 +1270,8 @@ invoke_NPN_NewStream(NPP instance, NPMIM + static NPError + g_NPN_NewStream(NPP instance, NPMIMEType type, const char *target, NPStream **stream) + { ++ if(!pid_check()) ++ return NPERR_INVALID_INSTANCE_ERROR; + if (instance == NULL) + return NPERR_INVALID_INSTANCE_ERROR; + +@@ -1257,6 +1317,9 @@ invoke_NPN_DestroyStream(NPP instance, N + static NPError + g_NPN_DestroyStream(NPP instance, NPStream *stream, NPError reason) + { ++ if(!pid_check()) ++ return NPERR_INVALID_INSTANCE_ERROR; ++ + if (instance == NULL) + return NPERR_INVALID_INSTANCE_ERROR; + +@@ -1314,6 +1377,9 @@ invoke_NPN_Write(NPP instance, NPStream + static int32 + g_NPN_Write(NPP instance, NPStream *stream, int32 len, void *buf) + { ++ if(!pid_check()) ++ return -1; ++ + if (instance == NULL) + return -1; + +@@ -1350,6 +1416,8 @@ invoke_NPN_PushPopupsEnabledState(NPP in + static void + g_NPN_PushPopupsEnabledState(NPP instance, NPBool enabled) + { ++ if(!pid_check()) ++ return; + if (instance == NULL) + return; + +@@ -1381,6 +1449,8 @@ invoke_NPN_PopPopupsEnabledState(NPP ins + static void + g_NPN_PopPopupsEnabledState(NPP instance) + { ++ if(!pid_check()) ++ return; + if (instance == NULL) + return; + +@@ -1480,6 +1550,9 @@ invoke_NPN_CreateObject(NPP instance) + static NPObject * + g_NPN_CreateObject(NPP instance, NPClass *class) + { ++ if(!pid_check()) ++ return NULL; ++ + if (instance == NULL) + return NULL; + +@@ -1520,6 +1593,9 @@ invoke_NPN_RetainObject(NPObject *npobj) + static NPObject * + g_NPN_RetainObject(NPObject *npobj) + { ++ if(!pid_check()) ++ return NULL; ++ + if (npobj == NULL) + return NULL; + +@@ -1558,6 +1634,9 @@ invoke_NPN_ReleaseObject(NPObject *npobj + static void + g_NPN_ReleaseObject(NPObject *npobj) + { ++ if(!pid_check()) ++ return; ++ + if (npobj == NULL) + return; + +@@ -1605,6 +1684,9 @@ static bool + g_NPN_Invoke(NPP instance, NPObject *npobj, NPIdentifier methodName, + const NPVariant *args, uint32_t argCount, NPVariant *result) + { ++ if(!pid_check()) ++ return false; ++ + if (!instance || !npobj || !npobj->_class || !npobj->_class->invoke) + return false; + +@@ -1652,6 +1734,9 @@ static bool + g_NPN_InvokeDefault(NPP instance, NPObject *npobj, + const NPVariant *args, uint32_t argCount, NPVariant *result) + { ++ if(!pid_check()) ++ return false; ++ + if (!instance || !npobj || !npobj->_class || !npobj->_class->invokeDefault) + return false; + +@@ -1697,6 +1782,9 @@ invoke_NPN_Evaluate(NPP instance, NPObje + static bool + g_NPN_Evaluate(NPP instance, NPObject *npobj, NPString *script, NPVariant *result) + { ++ if(!pid_check()) ++ return false; ++ + if (!instance || !npobj) + return false; + +@@ -1746,6 +1834,9 @@ static bool + g_NPN_GetProperty(NPP instance, NPObject *npobj, NPIdentifier propertyName, + NPVariant *result) + { ++ if(!pid_check()) ++ return false; ++ + if (!instance || !npobj || !npobj->_class || !npobj->_class->getProperty) + return false; + +@@ -1792,6 +1883,9 @@ static bool + g_NPN_SetProperty(NPP instance, NPObject *npobj, NPIdentifier propertyName, + const NPVariant *value) + { ++ if(!pid_check()) ++ return false; ++ + if (!instance || !npobj || !npobj->_class || !npobj->_class->setProperty) + return false; + +@@ -1833,6 +1927,9 @@ invoke_NPN_RemoveProperty(NPP instance, + static bool + g_NPN_RemoveProperty(NPP instance, NPObject *npobj, NPIdentifier propertyName) + { ++ if(!pid_check()) ++ return false; ++ + if (!instance || !npobj || !npobj->_class || !npobj->_class->removeProperty) + return false; + +@@ -1874,6 +1971,9 @@ invoke_NPN_HasProperty(NPP instance, NPO + static bool + g_NPN_HasProperty(NPP instance, NPObject *npobj, NPIdentifier propertyName) + { ++ if(!pid_check()) ++ return false; ++ + if (!instance || !npobj || !npobj->_class || !npobj->_class->hasProperty) + return false; + +@@ -1915,6 +2015,9 @@ invoke_NPN_HasMethod(NPP instance, NPObj + static bool + g_NPN_HasMethod(NPP instance, NPObject *npobj, NPIdentifier methodName) + { ++ if(!pid_check()) ++ return false; ++ + if (!instance || !npobj || !npobj->_class || !npobj->_class->hasMethod) + return false; + +@@ -1950,6 +2053,9 @@ invoke_NPN_SetException(NPObject *npobj, + static void + g_NPN_SetException(NPObject *npobj, const NPUTF8 *message) + { ++ if(!pid_check()) ++ return; ++ + D(bug("NPN_SetException npobj=%p, message='%s'\n", npobj, message)); + invoke_NPN_SetException(npobj, message); + D(bug(" done\n")); +@@ -2011,6 +2117,8 @@ invoke_NPN_GetStringIdentifier(const NPU + static NPIdentifier + g_NPN_GetStringIdentifier(const NPUTF8 *name) + { ++ if(!pid_check()) ++ return NULL; + if (name == NULL) + return NULL; + +@@ -2060,6 +2168,9 @@ invoke_NPN_GetStringIdentifiers(const NP + static void + g_NPN_GetStringIdentifiers(const NPUTF8 **names, uint32_t nameCount, NPIdentifier *identifiers) + { ++ if(!pid_check()) ++ return; ++ + if (names == NULL) + return; + +@@ -2101,6 +2212,9 @@ invoke_NPN_GetIntIdentifier(int32_t inti + static NPIdentifier + g_NPN_GetIntIdentifier(int32_t intid) + { ++ if(!pid_check()) ++ return 0; ++ + D(bug("NPN_GetIntIdentifier intid=%d\n", intid)); + NPIdentifier ret = invoke_NPN_GetIntIdentifier(intid); + D(bug(" return: %p\n", ret)); +@@ -2137,6 +2251,9 @@ invoke_NPN_IdentifierIsString(NPIdentifi + static bool + g_NPN_IdentifierIsString(NPIdentifier identifier) + { ++ if(!pid_check()) ++ return false; ++ + D(bug("NPN_IdentifierIsString identifier=%p\n", identifier)); + bool ret = invoke_NPN_IdentifierIsString(identifier); + D(bug(" return: %d\n", ret)); +@@ -2173,6 +2290,9 @@ invoke_NPN_UTF8FromIdentifier(NPIdentifi + static NPUTF8 * + g_NPN_UTF8FromIdentifier(NPIdentifier identifier) + { ++ if(!pid_check()) ++ return NULL; ++ + D(bug("NPN_UTF8FromIdentifier identifier=%p\n", identifier)); + NPUTF8 *ret = invoke_NPN_UTF8FromIdentifier(identifier); + D(bug(" return: '%s'\n", ret)); +@@ -2210,6 +2330,9 @@ invoke_NPN_IntFromIdentifier(NPIdentifie + static int32_t + g_NPN_IntFromIdentifier(NPIdentifier identifier) + { ++ if(!pid_check()) ++ return 0; ++ + D(bug("NPN_IntFromIdentifier identifier=%p\n", identifier)); + int32_t ret = invoke_NPN_IntFromIdentifier(identifier); + D(bug(" return: %d\n", ret)); +@@ -3259,6 +3382,9 @@ static int do_main(int argc, char **argv + } + D(bug(" Plugin connection: %s\n", connection_path)); + ++ pid_set(); ++ D(bug(" Plugin viewer pid: %d\n", viewer_pid)); ++ + // Cleanup environment, the program may fork/exec a native shell + // script and having 32-bit libraries in LD_PRELOAD is not right, + // though not a fatal error --- nspluginwrapper-1.1.0.orig/debian/patches/006_runtime-restart.diff +++ nspluginwrapper-1.1.0/debian/patches/006_runtime-restart.diff @@ -0,0 +1,406 @@ +diff -up nspluginwrapper-1.1.0/src/npruntime.c.restart nspluginwrapper-1.1.0/src/npruntime.c +--- nspluginwrapper-1.1.0/src/npruntime.c.restart 2008-06-21 22:13:34.000000000 +0200 ++++ nspluginwrapper-1.1.0/src/npruntime.c 2008-07-08 14:10:19.000000000 +0200 +@@ -59,6 +59,14 @@ NPClass npclass_bridge = { + npclass_invoke_RemoveProperty + }; + ++int npclass_check(NPObject *npobj) ++{ ++ NPObjectInfo *p_info = npobject_info_lookup(npobj); ++ if(!p_info->valid) ++ npw_printf("ERROR: NPObject %p is not valid!\n",npobj); ++ return(p_info->valid); ++} ++ + // NPClass::Invalidate + int npclass_handle_Invalidate(rpc_connection_t *connection) + { +@@ -72,7 +80,7 @@ int npclass_handle_Invalidate(rpc_connec + return error; + } + +- if (npobj && npobj->_class && npobj->_class->invalidate) { ++ if (npobj && npobj->_class && npclass_check(npobj) && npobj->_class->invalidate) { + D(bug("NPClass::Invalidate(npobj %p)\n", npobj)); + npobj->_class->invalidate(npobj); + D(bug(" done\n")); +@@ -83,6 +91,9 @@ int npclass_handle_Invalidate(rpc_connec + + void npclass_invoke_Invalidate(NPObject *npobj) + { ++ if(!npclass_check(npobj)) ++ return; ++ + int error = rpc_method_invoke(g_rpc_connection, + RPC_METHOD_NPCLASS_INVALIDATE, + RPC_TYPE_NP_OBJECT, npobj, +@@ -117,7 +128,7 @@ int npclass_handle_HasMethod(rpc_connect + } + + uint32_t ret = 0; +- if (npobj && npobj->_class && npobj->_class->hasMethod) { ++ if (npobj && npobj->_class && npclass_check(npobj) && npobj->_class->hasMethod) { + D(bug("NPClass::HasMethod(npobj %p, name id %p)\n", npobj, name)); + ret = npobj->_class->hasMethod(npobj, name); + D(bug(" return: %d\n", ret)); +@@ -128,6 +139,9 @@ int npclass_handle_HasMethod(rpc_connect + + bool npclass_invoke_HasMethod(NPObject *npobj, NPIdentifier name) + { ++ if(!npclass_check(npobj)) ++ return false; ++ + int error = rpc_method_invoke(g_rpc_connection, + RPC_METHOD_NPCLASS_HAS_METHOD, + RPC_TYPE_NP_OBJECT, npobj, +@@ -171,7 +185,7 @@ int npclass_handle_Invoke(rpc_connection + uint32_t ret = 0; + NPVariant result; + VOID_TO_NPVARIANT(result); +- if (npobj && npobj->_class && npobj->_class->invoke) { ++ if (npobj && npobj->_class && npclass_check(npobj) && npobj->_class->invoke) { + D(bug("NPClass::Invoke(npobj %p, name id %p)\n", npobj, name)); + ret = npobj->_class->invoke(npobj, name, args, argCount, &result); + D(bug(" return: %d\n", ret)); +@@ -191,6 +205,9 @@ bool npclass_invoke_Invoke(NPObject *npo + if (result == NULL) + return false; + VOID_TO_NPVARIANT(*result); ++ ++ if(!npclass_check(npobj)) ++ return false; + + int error = rpc_method_invoke(g_rpc_connection, + RPC_METHOD_NPCLASS_INVOKE, +@@ -237,7 +254,7 @@ int npclass_handle_InvokeDefault(rpc_con + uint32_t ret = 0; + NPVariant result; + VOID_TO_NPVARIANT(result); +- if (npobj && npobj->_class && npobj->_class->invokeDefault) { ++ if (npobj && npobj->_class && npclass_check(npobj) && npobj->_class->invokeDefault) { + D(bug("NPClass::InvokeDefault(npobj %p)\n", npobj)); + ret = npobj->_class->invokeDefault(npobj, args, argCount, &result); + D(bug(" return: %d\n", ret)); +@@ -257,6 +274,9 @@ bool npclass_invoke_InvokeDefault(NPObje + if (result == NULL) + return false; + VOID_TO_NPVARIANT(*result); ++ ++ if(!npclass_check(npobj)) ++ return false; + + int error = rpc_method_invoke(g_rpc_connection, + RPC_METHOD_NPCLASS_INVOKE_DEFAULT, +@@ -299,7 +319,7 @@ int npclass_handle_HasProperty(rpc_conne + } + + uint32_t ret = 0; +- if (npobj && npobj->_class && npobj->_class->hasProperty) { ++ if (npobj && npobj->_class && npclass_check(npobj) && npobj->_class->hasProperty) { + D(bug("NPClass::HasProperty(npobj %p, name id %p)\n", npobj, name)); + ret = npobj->_class->hasProperty(npobj, name); + D(bug(" return: %d\n", ret)); +@@ -310,6 +330,9 @@ int npclass_handle_HasProperty(rpc_conne + + bool npclass_invoke_HasProperty(NPObject *npobj, NPIdentifier name) + { ++ if(!npclass_check(npobj)) ++ return false; ++ + int error = rpc_method_invoke(g_rpc_connection, + RPC_METHOD_NPCLASS_HAS_PROPERTY, + RPC_TYPE_NP_OBJECT, npobj, +@@ -350,7 +373,7 @@ int npclass_handle_GetProperty(rpc_conne + uint32_t ret = 0; + NPVariant result; + VOID_TO_NPVARIANT(result); +- if (npobj && npobj->_class && npobj->_class->getProperty) { ++ if (npobj && npobj->_class && npclass_check(npobj) && npobj->_class->getProperty) { + D(bug("NPClass::GetProperty(npobj %p, name id %p)\n", npobj, name)); + ret = npobj->_class->getProperty(npobj, name, &result); + D(bug(" return: %d\n", ret)); +@@ -367,7 +390,10 @@ bool npclass_invoke_GetProperty(NPObject + if (result == NULL) + return false; + VOID_TO_NPVARIANT(*result); +- ++ ++ if(!npclass_check(npobj)) ++ return false; ++ + int error = rpc_method_invoke(g_rpc_connection, + RPC_METHOD_NPCLASS_GET_PROPERTY, + RPC_TYPE_NP_OBJECT, npobj, +@@ -411,7 +437,7 @@ int npclass_handle_SetProperty(rpc_conne + } + + uint32_t ret = 0; +- if (npobj && npobj->_class && npobj->_class->setProperty) { ++ if (npobj && npobj->_class && npclass_check(npobj) && npobj->_class->setProperty) { + D(bug("NPClass::SetProperty(npobj %p, name id %p)\n", npobj, name)); + ret = npobj->_class->setProperty(npobj, name, &value); + D(bug(" return: %d\n", ret)); +@@ -426,6 +452,9 @@ bool npclass_invoke_SetProperty(NPObject + { + if (value == NULL) + return false; ++ ++ if(!npclass_check(npobj)) ++ return false; + + int error = rpc_method_invoke(g_rpc_connection, + RPC_METHOD_NPCLASS_SET_PROPERTY, +@@ -468,7 +497,7 @@ int npclass_handle_RemoveProperty(rpc_co + } + + uint32_t ret = 0; +- if (npobj && npobj->_class && npobj->_class->removeProperty) { ++ if (npobj && npobj->_class && npclass_check(npobj) && npobj->_class->removeProperty) { + D(bug("NPClass::RemoveProperty(npobj %p, name id %p)\n", npobj, name)); + ret = npobj->_class->removeProperty(npobj, name); + D(bug(" return: %d\n", ret)); +@@ -479,6 +508,9 @@ int npclass_handle_RemoveProperty(rpc_co + + bool npclass_invoke_RemoveProperty(NPObject *npobj, NPIdentifier name) + { ++ if(!npclass_check(npobj)) ++ return false; ++ + int error = rpc_method_invoke(g_rpc_connection, + RPC_METHOD_NPCLASS_REMOVE_PROPERTY, + RPC_TYPE_NP_OBJECT, npobj, +@@ -513,6 +545,7 @@ NPObjectInfo *npobject_info_new(NPObject + static uint32_t id; + npobj_info->npobj = npobj; + npobj_info->npobj_id = ++id; ++ npobj_info->valid = 1; + } + return npobj_info; + } +@@ -638,3 +671,14 @@ NPObject *npobject_lookup(uint32_t npobj + { + return g_hash_table_lookup(g_npobject_ids, (void *)(uintptr_t)npobj_id); + } ++ ++static void npruntime_deactivate_func(gpointer key, gpointer value, gpointer user_data) ++{ ++ NPObjectInfo *p_info = (NPObjectInfo *)value; ++ p_info->valid = 0; ++} ++ ++void npruntime_deactivate(void) ++{ ++ g_hash_table_foreach(g_npobjects, npruntime_deactivate_func, NULL); ++} +diff -up nspluginwrapper-1.1.0/src/npruntime-impl.h.restart nspluginwrapper-1.1.0/src/npruntime-impl.h +--- nspluginwrapper-1.1.0/src/npruntime-impl.h.restart 2008-06-21 22:13:34.000000000 +0200 ++++ nspluginwrapper-1.1.0/src/npruntime-impl.h 2008-07-08 14:10:19.000000000 +0200 +@@ -25,6 +25,7 @@ + typedef struct { + NPObject *npobj; + uint32_t npobj_id; ++ uint32_t valid; + } NPObjectInfo; + + extern NPObjectInfo *npobject_info_new(NPObject *npobj) attribute_hidden; +@@ -63,4 +64,7 @@ extern int npclass_handle_Invalidate(rpc + struct _NPNetscapeFuncs; + extern void npruntime_init_callbacks(struct _NPNetscapeFuncs *mozilla_funcs); + ++// Deactivate all NPObject instances ++extern void npruntime_deactivate(void); ++ + #endif /* NPRUNTIME_IMPL_H */ +diff -up nspluginwrapper-1.1.0/src/npw-wrapper.c.restart nspluginwrapper-1.1.0/src/npw-wrapper.c +--- nspluginwrapper-1.1.0/src/npw-wrapper.c.restart 2008-07-08 14:10:19.000000000 +0200 ++++ nspluginwrapper-1.1.0/src/npw-wrapper.c 2008-07-08 14:10:19.000000000 +0200 +@@ -107,7 +107,11 @@ typedef struct _StreamInstance { + // Prototypes + static void plugin_init(int is_NP_Initialize); + static void plugin_exit(void); +-static NPError plugin_restart_if_needed(void); ++ ++static void plugin_kill(rpc_connection_t *connection); ++static NPError plugin_start(void); ++static NPError plugin_start_if_needed(void); ++static int plugin_killed = 0; + + /* + * Notes concerning NSPluginWrapper recovery model. +@@ -126,10 +130,8 @@ static NPError plugin_restart_if_needed( + * connection and thus can fail early/gracefully in subsequent calls + * to NPP_*() functions. + * +- * TODO: make NPRuntime aware of per-plugin connections? This +- * shouldn't matter from the Wrapper side because npruntime requests +- * come from the Viewer side (see NPN_*() handlers). XXX: even with a +- * running script (NPClass handlers)? ++ * All active NPRuntime objects are marked as inactive and ++ * are not processed. + */ + + // Minimal time between two plugin restarts in sec +@@ -1361,7 +1363,7 @@ g_NPP_New(NPMIMEType mime_type, NPP inst + return NPERR_INVALID_INSTANCE_ERROR; + + // Check if we need to restart the plug-in +- NPError ret = plugin_restart_if_needed(); ++ NPError ret = plugin_start_if_needed(); + if (ret != NPERR_NO_ERROR) + return ret; + +@@ -2870,6 +2872,9 @@ static void plugin_init(int is_NP_Initia + return; + } + ++ // Set error handler - stop plugin if there's a connection error ++ rpc_connection_error_callback_set(g_rpc_connection, plugin_kill); ++ + g_plugin.initialized = 1 + is_NP_Initialize; + D(bug("--- INIT ---\n")); + } +@@ -2942,17 +2947,39 @@ static void __attribute__((destructor)) + } + } + +-static NPError plugin_restart(void) ++static void plugin_kill(rpc_connection_t *connection) + { + if (g_plugin.is_wrapper) +- return NPERR_NO_ERROR; ++ return; + +- // Shut it down ++ D(bug("plugin_kill, connection %p\n",connection)); ++ ++ // Kill viewer and plugin + plugin_exit(); ++ ++ // Clear-up + g_plugin.initialized = 0; + g_plugin.viewer_pid = -1; + g_plugin.is_wrapper = 0; + ++ npruntime_deactivate(); ++ ++ // Set the kill flag ++ plugin_killed = 1; ++} ++ ++static NPError plugin_start(void) ++{ ++ D(bug("plugin_start\n")); ++ ++ if(!plugin_killed) { ++ // Plugin is still active ++ // terminate it before the restart ++ D(bug("plugin_start: plugin_killed = 0!\n")); ++ plugin_kill(g_rpc_connection); ++ } ++ plugin_killed = 0; ++ + // And start it again + plugin_init(1); + if (g_plugin.initialized <= 0) +@@ -2961,7 +2988,7 @@ static NPError plugin_restart(void) + return invoke_NP_Initialize(npapi_version); + } + +-static NPError plugin_restart_if_needed(void) ++static NPError plugin_start_if_needed(void) + { + if (rpc_status(g_rpc_connection) != RPC_STATUS_ACTIVE) { + static time_t last_restart = 0; +@@ -2971,7 +2998,7 @@ static NPError plugin_restart_if_needed( + last_restart = now; + + D(bug("Restart plugins viewer\n")); +- NPError ret = plugin_restart(); ++ NPError ret = plugin_start(); + D(bug(" return: %d [%s]\n", ret, string_of_NPError(ret))); + return ret; + } +diff -up nspluginwrapper-1.1.0/src/rpc.c.restart nspluginwrapper-1.1.0/src/rpc.c +--- nspluginwrapper-1.1.0/src/rpc.c.restart 2008-07-06 21:54:45.000000000 +0200 ++++ nspluginwrapper-1.1.0/src/rpc.c 2008-07-08 14:18:41.000000000 +0200 +@@ -427,6 +427,7 @@ struct rpc_connection { + pthread_t server_thread; + rpc_map_t *types; + rpc_map_t *methods; ++ rpc_error_callback_t callback_error; + }; + + // Increment connection reference count +@@ -446,6 +447,29 @@ void rpc_connection_unref(rpc_connection + } + } + ++// Set error callback ++void rpc_connection_error_callback_set(rpc_connection_t *connection, ++ rpc_error_callback_t callback) ++{ ++ if (connection == NULL) ++ return; ++ if (connection->callback_error != NULL) ++ return; ++ connection->callback_error = callback; ++} ++ ++// Call error callback if the connection is closed ++static void rpc_connection_error_callback_call(rpc_connection_t *connection) ++{ ++ if (connection == NULL) ++ return; ++ if (connection->callback_error == NULL) ++ return; ++ ++ (connection->callback_error)(connection); ++ connection->callback_error = NULL; ++} ++ + // Returns connection status + static inline int _rpc_status(rpc_connection_t *connection) + { +@@ -484,6 +508,11 @@ static inline int rpc_error(rpc_connecti + assert(error < 0); + assert(connection != NULL); + _rpc_set_status(connection, error); ++ ++ if(_rpc_status(connection) == RPC_STATUS_CLOSED || _rpc_status(connection) == RPC_STATUS_BROKEN) { ++ rpc_connection_error_callback_call(connection); ++ } ++ + return error; + } + +@@ -566,6 +595,7 @@ rpc_connection_t *rpc_init_server(const + connection->status = RPC_STATUS_CLOSED; + connection->socket = -1; + connection->server_thread_active = 0; ++ connection->callback_error = NULL; + if ((connection->types = rpc_map_new_full((free))) == NULL) { + rpc_exit(connection); + return NULL; +@@ -623,6 +653,7 @@ rpc_connection_t *rpc_init_client(const + connection->refcnt = 1; + connection->status = RPC_STATUS_CLOSED; + connection->server_socket = -1; ++ connection->callback_error = NULL; + if ((connection->types = rpc_map_new_full((free))) == NULL) { + rpc_exit(connection); + return NULL; +diff -up nspluginwrapper-1.1.0/src/rpc.h.restart nspluginwrapper-1.1.0/src/rpc.h +--- nspluginwrapper-1.1.0/src/rpc.h.restart 2008-06-21 22:13:34.000000000 +0200 ++++ nspluginwrapper-1.1.0/src/rpc.h 2008-07-08 14:10:19.000000000 +0200 +@@ -122,4 +122,10 @@ extern int rpc_method_send_reply(rpc_con + } + #endif + ++// This callback is called when the connection is closed or broken ++typedef void (*rpc_error_callback_t)(rpc_connection_t *connection); ++ ++// Set callback for a connection ++void rpc_connection_error_callback_set(rpc_connection_t *connection, rpc_error_callback_t callback); ++ + #endif /* RPC_H */ --- nspluginwrapper-1.1.0.orig/debian/patches/003_update_help_info.diff +++ nspluginwrapper-1.1.0/debian/patches/003_update_help_info.diff @@ -0,0 +1,17 @@ +Fix the abstract for the '-u' option. + + -- Rob Andrews Sun, 02 Sep 2007 11:58:27 +0100 + +Index: ubuntu-1.1.0/src/npw-config.c +=================================================================== +--- ubuntu-1.1.0.orig/src/npw-config.c 2008-07-31 02:44:38.000000000 +0200 ++++ ubuntu-1.1.0/src/npw-config.c 2008-07-31 02:44:41.000000000 +0200 +@@ -1069,7 +1069,7 @@ + printf(" -v --verbose flag: set verbose mode\n"); + printf(" -a --auto flag: set automatic mode for plugins discovery\n"); + printf(" -l --list list plugins currently installed\n"); +- printf(" -u --update update plugin(s) currently installed\n"); ++ printf(" -u --update [FILE(S)] update plugin(s) currently installed\n"); + printf(" -i --install [FILE(S)] install plugin(s)\n"); + printf(" -r --remove [FILE(S)] remove plugin(s)\n"); + printf("\n");