Mercurial > hg > release > icedtea6-1.7
changeset 1906:caf319401914
Changed FIFO file location from /tmp/$user-... to
/tmp/icedteaplugin-$user/$pid-...
2010-03-22 Deepak Bhole <dbhole@redhat.com>
* plugin/icedteanp/IcedTeaNPPlugin.cc
(start_jvm_if_needed): Change pipe file name format.
(NP_Initialize): Put FIFO pipe in a separate per-user directory.
author | Deepak Bhole <dbhole@redhat.com> |
---|---|
date | Mon, 22 Mar 2010 15:34:55 -0400 |
parents | 22539a0f31fe |
children | cd90c47cdc63 |
files | ChangeLog plugin/icedteanp/IcedTeaNPPlugin.cc |
diffstat | 2 files changed, 37 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Fri Jun 04 14:26:12 2010 +0100 +++ b/ChangeLog Mon Mar 22 15:34:55 2010 -0400 @@ -1,3 +1,9 @@ +2010-03-22 Deepak Bhole <dbhole@redhat.com> + + * plugin/icedteanp/IcedTeaNPPlugin.cc + (start_jvm_if_needed): Change pipe file name format. + (NP_Initialize): Put FIFO pipe in a separate per-user directory. + 2010-03-19 Deepak Bhole <dbhole@redhat.com> PR icedtea/166:
--- a/plugin/icedteanp/IcedTeaNPPlugin.cc Fri Jun 04 14:26:12 2010 +0100 +++ b/plugin/icedteanp/IcedTeaNPPlugin.cc Mon Mar 22 15:34:55 2010 -0400 @@ -434,8 +434,8 @@ // pipe. // in_pipe_name - in_pipe_name = g_strdup_printf ("%s/%s-icedteanp-appletviewer-to-plugin", - data_directory, getenv ("USER")); + in_pipe_name = g_strdup_printf ("%s/%d-icedteanp-appletviewer-to-plugin", + data_directory, getpid()); if (!in_pipe_name) { PLUGIN_ERROR ("Failed to create input pipe name."); @@ -461,8 +461,8 @@ // output pipe. // out_pipe_name - out_pipe_name = g_strdup_printf ("%s/%s-icedteanp-plugin-to-appletviewer", - data_directory, getenv ("USER")); + out_pipe_name = g_strdup_printf ("%s/%d-icedteanp-plugin-to-appletviewer", + data_directory, getpid()); if (!out_pipe_name) { @@ -1992,7 +1992,33 @@ } - // If that doesn't exit, bail + data_directory = g_strconcat (data_directory, "/icedteaplugin-", getenv("USER"), NULL); + + if (!data_directory) + { + PLUGIN_ERROR ("Failed to create data directory name."); + return NPERR_OUT_OF_MEMORY_ERROR; + } + + // Now create a icedteaplugin subdir + if (!g_file_test (data_directory, + (GFileTest) (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))) + { + int file_error = 0; + + file_error = g_mkdir (data_directory, 0700); + if (file_error != 0) + { + PLUGIN_ERROR_THREE ("Failed to create data directory", + data_directory, + strerror (errno)); + np_error = NPERR_GENERIC_ERROR; + goto cleanup_data_directory; + } + } + + + // If data directory doesn't exit by this point, bail if (!g_file_test (data_directory, (GFileTest) (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))) {