To avoid any problems with saving the whitelist file (permission denied,
etc), we have decided to store all the plugin data in ~/.gcjwebplugin.
2006-06-08 Lillian Angel <[EMAIL PROTECTED]>
* native/plugin/Makefile.am:
Changed DATA_DIRECTORY to be ~/.gcjwebplugin.
* native/plugin/gcjwebplugin.cc:
Changed all instances of PLUGIN_DATA_DIRECTORY
to DATA_DIRECTORY.
Index: native/plugin/Makefile.am
===================================================================
RCS file: /cvsroot/classpath/classpath/native/plugin/Makefile.am,v
retrieving revision 1.2
diff -u -r1.2 Makefile.am
--- native/plugin/Makefile.am 5 Jun 2006 14:20:00 -0000 1.2
+++ native/plugin/Makefile.am 8 Jun 2006 20:25:50 -0000
@@ -4,7 +4,7 @@
libgcjwebplugin_la_CXXFLAGS = \
-Wall -DAPPLETVIEWER_EXECUTABLE="\"$(bindir)/appletviewer\"" \
- -DPLUGIN_DATA_DIRECTORY="\"$(PLUGIN_DIR)/gcjwebplugin-data\"" \
+ -DDATA_DIRECTORY="\"$(HOME)/.gcjwebplugin\"" \
$(MOZILLA_CFLAGS) $(GLIB_CFLAGS) $(GTK_CFLAGS)
libgcjwebplugin_la_LDFLAGS = -avoid-version \
Index: native/plugin/gcjwebplugin.cc
===================================================================
RCS file: /cvsroot/classpath/classpath/native/plugin/gcjwebplugin.cc,v
retrieving revision 1.7
diff -u -r1.7 gcjwebplugin.cc
--- native/plugin/gcjwebplugin.cc 8 Jun 2006 15:59:20 -0000 1.7
+++ native/plugin/gcjwebplugin.cc 8 Jun 2006 20:25:50 -0000
@@ -120,7 +120,7 @@
// Security dialog messages.
#define RESPONSE_TRUST_APPLET "Trust Applet"
#define RESPONSE_TRUST_APPLET_ADD_TO_LIST "Trust Applet and Add to Whitelist"
-#define WHITELIST_FILENAME PLUGIN_DATA_DIRECTORY "/whitelist.txt"
+#define WHITELIST_FILENAME DATA_DIRECTORY "/whitelist.txt"
#define SECURITY_WARNING \
"%s wants to load an applet.\n" \
"GNU Classpath's security implementation is not complete.\n" \
@@ -326,7 +326,7 @@
// pipe.
// data->in_pipe_name
- data->in_pipe_name = g_strdup_printf (PLUGIN_DATA_DIRECTORY
+ data->in_pipe_name = g_strdup_printf (DATA_DIRECTORY
"/gcj-%s-appletviewer-to-plugin",
data->instance_string);
if (!data->in_pipe_name)
@@ -349,7 +349,7 @@
// output pipe.
// data->out_pipe_name
- data->out_pipe_name = g_strdup_printf (PLUGIN_DATA_DIRECTORY
+ data->out_pipe_name = g_strdup_printf (DATA_DIRECTORY
"/gcj-%s-plugin-to-appletviewer",
data->instance_string);
@@ -1608,16 +1608,16 @@
// Make sure the plugin data directory exists, creating it if
// necessary.
- if (!g_file_test (PLUGIN_DATA_DIRECTORY,
+ if (!g_file_test (DATA_DIRECTORY,
(GFileTest) (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR)))
{
int file_error = 0;
- file_error = g_mkdir (PLUGIN_DATA_DIRECTORY, 0700);
+ file_error = g_mkdir (DATA_DIRECTORY, 0700);
if (file_error != 0)
{
PLUGIN_ERROR_TWO ("Failed to create data directory "
- PLUGIN_DATA_DIRECTORY " ",
+ DATA_DIRECTORY " ",
strerror (errno));
return NPERR_GENERIC_ERROR;
}