rpms/nspluginwrapper/devel nspluginwrapper-1.1.4-fork.patch, NONE, 1.1 nspluginwrapper.spec, 1.66, 1.67 nspluginwrapper-1.1.0-fork.patch, 1.2, NONE
Martin Stransky
stransky at fedoraproject.org
Wed Nov 12 12:10:43 UTC 2008
- Previous message (by thread): rpms/mod_fcgid/devel mod_fcgid.spec,1.14,1.15
- Next message (by thread): rpms/xorg-x11-drv-radeonhd/F-9 .cvsignore, 1.37, 1.38 sources, 1.37, 1.38 xorg-x11-drv-radeonhd-README.fedora, 1.35, 1.36 xorg-x11-drv-radeonhd.spec, 1.45, 1.46
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: stransky
Update of /cvs/pkgs/rpms/nspluginwrapper/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv31260
Modified Files:
nspluginwrapper.spec
Added Files:
nspluginwrapper-1.1.4-fork.patch
Removed Files:
nspluginwrapper-1.1.0-fork.patch
Log Message:
Recreated for patch
nspluginwrapper-1.1.4-fork.patch:
--- NEW FILE nspluginwrapper-1.1.4-fork.patch ---
diff -up nspluginwrapper-1.1.4/src/npw-viewer.c.fork nspluginwrapper-1.1.4/src/npw-viewer.c
--- nspluginwrapper-1.1.4/src/npw-viewer.c.fork 2008-11-04 00:08:58.000000000 +0100
+++ nspluginwrapper-1.1.4/src/npw-viewer.c 2008-11-12 13:06:05.000000000 +0100
@@ -62,6 +62,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 {
NPW_DECL_PLUGIN_INSTANCE;
@@ -583,6 +597,9 @@ static void
g_NPN_ForceRedraw(NPP instance)
{
D(bug("NPN_ForceRedraw instance=%p\n", instance));
+
+ if(!pid_check())
+ return;
NPW_UNIMPLEMENTED();
}
@@ -617,9 +634,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)));
@@ -657,6 +676,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;
@@ -732,8 +754,11 @@ g_NPN_GetValue_real(NPP instance, NPNVar
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:
@@ -814,6 +839,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);
@@ -825,6 +853,9 @@ static void
g_NPN_InvalidateRegion(NPP instance, NPRegion invalidRegion)
{
D(bug("NPN_InvalidateRegion instance=%p\n", instance));
+
+ if(!pid_check())
+ return;
NPW_UNIMPLEMENTED();
}
@@ -890,6 +921,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;
@@ -932,6 +965,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;
@@ -946,6 +982,9 @@ static void
g_NPN_ReloadPlugins(NPBool reloadPages)
{
D(bug("NPN_ReloadPlugins reloadPages=%d\n", reloadPages));
+
+ if(!pid_check())
+ return;
NPW_UNIMPLEMENTED();
}
@@ -955,6 +994,9 @@ static JRIEnv *
g_NPN_GetJavaEnv(void)
{
D(bug("NPN_GetJavaEnv\n"));
+
+ if(!pid_check())
+ return NULL;
return NULL;
}
@@ -964,6 +1006,9 @@ static jref
g_NPN_GetJavaPeer(NPP instance)
{
D(bug("NPN_GetJavaPeer instance=%p\n", instance));
+
+ if(!pid_check())
+ return NULL;
return NULL;
}
@@ -997,6 +1042,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;
@@ -1045,10 +1092,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)));
@@ -1081,6 +1131,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"));
@@ -1109,6 +1162,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();
@@ -1191,6 +1249,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;
@@ -1236,6 +1296,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;
@@ -1293,6 +1356,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;
@@ -1329,6 +1395,8 @@ invoke_NPN_PushPopupsEnabledState(NPP in
static void
g_NPN_PushPopupsEnabledState(NPP instance, NPBool enabled)
{
+ if(!pid_check())
+ return;
if (instance == NULL)
return;
@@ -1360,6 +1428,8 @@ invoke_NPN_PopPopupsEnabledState(NPP ins
static void
g_NPN_PopPopupsEnabledState(NPP instance)
{
+ if(!pid_check())
+ return;
if (instance == NULL)
return;
@@ -1403,6 +1473,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;
@@ -1443,6 +1516,9 @@ invoke_NPN_RetainObject(NPObject *npobj)
static NPObject *
g_NPN_RetainObject(NPObject *npobj)
{
+ if(!pid_check())
+ return NULL;
+
if (npobj == NULL)
return NULL;
@@ -1481,6 +1557,9 @@ invoke_NPN_ReleaseObject(NPObject *npobj
static void
g_NPN_ReleaseObject(NPObject *npobj)
{
+ if(!pid_check())
+ return;
+
if (npobj == NULL)
return;
@@ -1528,6 +1607,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;
@@ -1575,6 +1657,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;
@@ -1620,6 +1705,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;
@@ -1669,6 +1757,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;
@@ -1715,6 +1806,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;
@@ -1756,6 +1850,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;
@@ -1797,6 +1894,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;
@@ -1838,6 +1938,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;
@@ -1873,6 +1976,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"));
@@ -1917,6 +2023,8 @@ invoke_NPN_GetStringIdentifier(const NPU
static NPIdentifier
g_NPN_GetStringIdentifier(const NPUTF8 *name)
{
+ if(!pid_check())
+ return NULL;
if (name == NULL)
return NULL;
@@ -1966,6 +2074,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;
@@ -2007,6 +2118,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));
@@ -2043,6 +2157,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));
@@ -2079,6 +2196,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));
@@ -2116,6 +2236,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));
@@ -3208,6 +3331,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
Index: nspluginwrapper.spec
===================================================================
RCS file: /cvs/pkgs/rpms/nspluginwrapper/devel/nspluginwrapper.spec,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -r1.66 -r1.67
--- nspluginwrapper.spec 12 Nov 2008 11:56:53 -0000 1.66
+++ nspluginwrapper.spec 12 Nov 2008 12:10:13 -0000 1.67
@@ -74,7 +74,7 @@
Patch2: nspluginwrapper-1.1.4-configure.patch
Patch3: nspluginwrapper-1.1.4-directory.patch
Patch10: nspluginwrapper-1.1.4-runtime-restart.patch
-Patch11: nspluginwrapper-1.1.0-fork.patch
+Patch11: nspluginwrapper-1.1.4-fork.patch
Patch12: nspluginwrapper-0.9.91.5-shutdown.patch
Patch13: nspluginwrapper-1.1.12-event.patch
Patch14: nspluginwrapper-1.1.4-params.patch
--- nspluginwrapper-1.1.0-fork.patch DELETED ---
- Previous message (by thread): rpms/mod_fcgid/devel mod_fcgid.spec,1.14,1.15
- Next message (by thread): rpms/xorg-x11-drv-radeonhd/F-9 .cvsignore, 1.37, 1.38 sources, 1.37, 1.38 xorg-x11-drv-radeonhd-README.fedora, 1.35, 1.36 xorg-x11-drv-radeonhd.spec, 1.45, 1.46
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the fedora-extras-commits
mailing list