summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLillian Angel <langel@redhat.com>2006-06-13 21:39:21 +0000
committerLillian Angel <langel@redhat.com>2006-06-13 21:39:21 +0000
commit786d4fe8a620f620b2de25fe695c2103cc76a365 (patch)
treefc2adf8ce09aa4983f4f3190fc6e428f676cb79c
parenta1d74a884b882b1968c3a3ffc93c3a4ef2caa627 (diff)
downloadclasspath-786d4fe8a620f620b2de25fe695c2103cc76a365.tar.gz
2006-06-13 Lillian Angel <langel@redhat.com>
* 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.
-rw-r--r--ChangeLog7
-rw-r--r--native/plugin/gcjwebplugin.cc44
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 <langel@redhat.com>
+
+ * 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 <david.gilbert@object-refinery.com>
* 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;