# HG changeset patch # User Jiri Vanek # Date 1385725390 -3600 # Node ID 35f4d27451fd4dc29eeadafd2833d7b0d766975e # Parent 461eb0b77b5312ce4c4736aafe07b3e0411355c5 Pipes moved into XDG_RUNTIME_DIR diff -r 461eb0b77b53 -r 35f4d27451fd ChangeLog --- a/ChangeLog Wed Nov 27 14:14:14 2013 +0100 +++ b/ChangeLog Fri Nov 29 12:43:10 2013 +0100 @@ -1,3 +1,14 @@ +2013-11-29 Jiri Vanek + + Pipes moved into XDG_RUNTIME_DIR + * plugin/icedteanp/IcedTeaNPPlugin.cc: (initialize_data_directory) logic + responsible for tmp dir path moved into (getTmpPath) and (data_directory) + initialized from (getRuntimePath) rather. + * plugin/icedteanp/IcedTeaPluginUtils.cc: (getTmpPath) new function, + provides path to tmp dir. (getRuntimePath) new function resolving + XDG_RUNTIME_DIR value, returning (getTmpPath) as fallback. + * plugin/icedteanp/IcedTeaPluginUtils.h: declared new two methods. + 2013-11-26 Jiri Vanek * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: (getManifestAttribute) diff -r 461eb0b77b53 -r 35f4d27451fd NEWS --- a/NEWS Wed Nov 27 14:14:14 2013 +0100 +++ b/NEWS Fri Nov 29 12:43:10 2013 +0100 @@ -22,6 +22,7 @@ - PR1473 - javaws should not depend on name of local file * Plugin - PR854: Resizing an applet several times causes 100% CPU load + - Pipes moved into XDG_RUNTIME_DIR * Security Updates - CVE-2012-4540, RH869040: Heap-based buffer overflow after triggering event attached to applet diff -r 461eb0b77b53 -r 35f4d27451fd plugin/icedteanp/IcedTeaNPPlugin.cc --- a/plugin/icedteanp/IcedTeaNPPlugin.cc Wed Nov 27 14:14:14 2013 +0100 +++ b/plugin/icedteanp/IcedTeaNPPlugin.cc Fri Nov 29 12:43:10 2013 +0100 @@ -1886,24 +1886,7 @@ // Make sure the plugin data directory exists, creating it if // necessary. - const char* tmpdir_env = getenv("TMPDIR"); - if (tmpdir_env != NULL && g_file_test (tmpdir_env, - (GFileTest) (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))) - { - data_directory = tmpdir_env; - } - else if (g_file_test (P_tmpdir, - (GFileTest) (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))) - { - data_directory = P_tmpdir; - } - else - { - // If TMPDIR and P_tmpdir do not exist, try /tmp directly - data_directory = "/tmp"; - } - - data_directory += "/icedteaplugin-"; + data_directory = IcedTeaPluginUtilities::getRuntimePath() + "/icedteaplugin-"; if (getenv("USER") != NULL) data_directory += getenv("USER"); diff -r 461eb0b77b53 -r 35f4d27451fd plugin/icedteanp/IcedTeaPluginUtils.cc --- a/plugin/icedteanp/IcedTeaPluginUtils.cc Wed Nov 27 14:14:14 2013 +0100 +++ b/plugin/icedteanp/IcedTeaPluginUtils.cc Fri Nov 29 12:43:10 2013 +0100 @@ -1074,6 +1074,36 @@ } +std::string IcedTeaPluginUtilities::getTmpPath(){ + const char* tmpdir_env = getenv("TMPDIR"); + if (tmpdir_env != NULL && g_file_test (tmpdir_env, + (GFileTest) (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))) + { + return std::string(tmpdir_env); + } + else if (g_file_test (P_tmpdir, + (GFileTest) (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))) + { + return std::string(P_tmpdir); + } + else + { + // If TMPDIR and P_tmpdir do not exist, try /tmp directly + return "/tmp"; + } +} + +std::string IcedTeaPluginUtilities::getRuntimePath(){ + const char* rntdir_env = getenv("XDG_RUNTIME_DIR"); + if (rntdir_env != NULL && g_file_test (rntdir_env, + (GFileTest) (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))) + { + return std::string(rntdir_env); + } + return IcedTeaPluginUtilities::getTmpPath(); +} + + /****************************************** * Begin JavaMessageSender implementation * ****************************************** diff -r 461eb0b77b53 -r 35f4d27451fd plugin/icedteanp/IcedTeaPluginUtils.h --- a/plugin/icedteanp/IcedTeaPluginUtils.h Wed Nov 27 14:14:14 2013 +0100 +++ b/plugin/icedteanp/IcedTeaPluginUtils.h Fri Nov 29 12:43:10 2013 +0100 @@ -286,7 +286,8 @@ /*cutting whitespaces from end and start of string*/ static void trim(std::string& str); static bool file_exists(std::string filename); - + static std::string getTmpPath(); + static std::string getRuntimePath(); }; /*