From 786d4fe8a620f620b2de25fe695c2103cc76a365 Mon Sep 17 00:00:00 2001 From: Lillian Angel Date: Tue, 13 Jun 2006 21:39:21 +0000 Subject: 2006-06-13 Lillian Angel * native/plugin/gcjwebplugin.cc (NP_Initialize): Removed code to create whitelist file. (GCJ_New): Added code to create whitelist file. (plugin_user_trusts_documentbase): Fixed error message. --- ChangeLog | 7 +++++++ native/plugin/gcjwebplugin.cc | 44 +++++++++++++++++++++---------------------- 2 files changed, 29 insertions(+), 22 deletions(-) diff --git a/ChangeLog b/ChangeLog index 07eaba6c9..5d00e5a78 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-06-13 Lillian Angel + + * native/plugin/gcjwebplugin.cc + (NP_Initialize): Removed code to create whitelist file. + (GCJ_New): Added code to create whitelist file. + (plugin_user_trusts_documentbase): Fixed error message. + 2006-06-13 David Gilbert * javax/swing/plaf/metal/MetalIconFactory.java diff --git a/native/plugin/gcjwebplugin.cc b/native/plugin/gcjwebplugin.cc index ad65c7ef1..1202c4719 100644 --- a/native/plugin/gcjwebplugin.cc +++ b/native/plugin/gcjwebplugin.cc @@ -323,14 +323,34 @@ GCJ_New (NPMIMEType pluginType, NPP instance, uint16 mode, " Browser not Mozilla-based?"); goto cleanup_appletviewer_mutex; } + + // Open the user's documentbase whitelist. + whitelist_file = g_io_channel_new_file (whitelist_filename, + "a+", &channel_error); + if (!whitelist_file) + { + if (channel_error) + { + PLUGIN_ERROR_THREE ("Failed to open whitelist file", + whitelist_filename, + channel_error->message); + g_error_free (channel_error); + channel_error = NULL; + } + else + PLUGIN_ERROR_TWO ("Failed to open whitelist file", + whitelist_filename); + return NPERR_GENERIC_ERROR; + } + if (!plugin_user_trusts_documentbase (documentbase)) { PLUGIN_ERROR ("User does not trust applet."); np_error = NPERR_GENERIC_ERROR; goto cleanup_appletviewer_mutex; } - + // Create appletviewer-to-plugin pipe which we refer to as the input // pipe. @@ -959,7 +979,7 @@ plugin_user_trusts_documentbase (char* documentbase) channel_error = NULL; } else - PLUGIN_ERROR ("Failed to open whitelist file."); + PLUGIN_ERROR ("Failed to read line from whitelist file."); g_free (whitelist_entry); whitelist_entry = NULL; break; @@ -1632,26 +1652,6 @@ NP_Initialize (NPNetscapeFuncs* browserTable, NPPluginFuncs* pluginTable) } } - // Open the user's documentbase whitelist. - whitelist_file = g_io_channel_new_file (whitelist_filename, - "a+", &channel_error); - if (!whitelist_file) - { - if (channel_error) - { - PLUGIN_ERROR_THREE ("Failed to open whitelist file", - whitelist_filename, - channel_error->message); - g_error_free (channel_error); - channel_error = NULL; - } - else - PLUGIN_ERROR_TWO ("Failed to open whitelist file", - whitelist_filename); - - return NPERR_GENERIC_ERROR; - } - // Store in a local table the browser functions that we may use. browserFunctions.version = browserTable->version; browserFunctions.size = browserTable->size; -- cgit v1.2.1