Hi, can you have a look at this, before I can push it to FDO git?
>From fef8de569a7268bed272105649941b9dac5f4f98 Mon Sep 17 00:00:00 2001 From: Peter Hatina <phat...@redhat.com> Date: Mon, 2 Apr 2012 12:11:20 +0200 Subject: [PATCH 1/4] remove unused class member --- SpiceXPI/src/plugin/plugin.h | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/SpiceXPI/src/plugin/plugin.h b/SpiceXPI/src/plugin/plugin.h index 42e2a2d..0496c5c 100644 --- a/SpiceXPI/src/plugin/plugin.h +++ b/SpiceXPI/src/plugin/plugin.h @@ -182,7 +182,6 @@ private: NPBool m_initialized; NPWindow *m_window; - PRBool m_fIPC; std::string m_host_ip; std::string m_port; std::string m_password; -- 1.7.7.6 ---------------------------------------- >From c4ffd800d665b20b89022c3707c2665a8384d6ba Mon Sep 17 00:00:00 2001 From: Peter Hatina <phat...@redhat.com> Date: Mon, 2 Apr 2012 12:13:25 +0200 Subject: [PATCH 2/4] check string length before calling strcpy --- SpiceXPI/src/plugin/controller.cpp | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/SpiceXPI/src/plugin/controller.cpp b/SpiceXPI/src/plugin/controller.cpp index 23c853b..4c6ce9f 100644 --- a/SpiceXPI/src/plugin/controller.cpp +++ b/SpiceXPI/src/plugin/controller.cpp @@ -96,6 +96,8 @@ int SpiceController::Connect() struct sockaddr_un remote; remote.sun_family = AF_UNIX; + if (m_name.length() + 1 > sizeof(remote.sun_path)) + return -1; strcpy(remote.sun_path, m_name.c_str()); int rc = connect(m_client_socket, (struct sockaddr *) &remote, strlen(remote.sun_path) + sizeof(remote.sun_family)); -- 1.7.7.6 ---------------------------------------- >From f12fe522d7bc9c765a7d9c7784533c31354c2c5c Mon Sep 17 00:00:00 2001 From: Peter Hatina <phat...@redhat.com> Date: Mon, 2 Apr 2012 12:14:59 +0200 Subject: [PATCH 3/4] initialize nsPluginInstance --- SpiceXPI/src/plugin/plugin.cpp | 14 +++++++++++--- 1 files changed, 11 insertions(+), 3 deletions(-) diff --git a/SpiceXPI/src/plugin/plugin.cpp b/SpiceXPI/src/plugin/plugin.cpp index 25a098b..2274b63 100644 --- a/SpiceXPI/src/plugin/plugin.cpp +++ b/SpiceXPI/src/plugin/plugin.cpp @@ -185,15 +185,20 @@ void NS_DestroyPluginInstance(nsPluginInstanceBase *aPlugin) nsPluginInstance::nsPluginInstance(NPP aInstance): nsPluginInstanceBase(), m_pid_controller(-1), + m_connected_status(-2), m_instance(aInstance), - m_initialized(PR_FALSE), + m_initialized(PR_TRUE), + m_window(NULL), + m_fullscreen(PR_FALSE), + m_smartcard(PR_FALSE), + m_admin_console(PR_FALSE), + m_no_taskmgr_execution(PR_FALSE), + m_send_ctrlaltdel(PR_TRUE), m_scriptable_peer(NULL) { // create temporary directory in /tmp char tmp_dir[] = "/tmp/spicec-XXXXXX"; m_tmp_dir = mkdtemp(tmp_dir); - - m_connected_status = -2; } nsPluginInstance::~nsPluginInstance() @@ -225,6 +230,9 @@ NPBool nsPluginInstance::init(NPWindow *aWindow) m_dynamic_menu.clear(); m_number_of_monitors.clear(); m_guest_host_name.clear(); + m_hot_keys.clear(); + m_language.clear(); + m_trust_store_file.clear(); m_fullscreen = PR_FALSE; m_smartcard = PR_FALSE; -- 1.7.7.6 ---------------------------------------- >From 4060959b7df82a060408984ea7c0e89b266f7c56 Mon Sep 17 00:00:00 2001 From: Peter Hatina <phat...@redhat.com> Date: Mon, 2 Apr 2012 12:17:16 +0200 Subject: [PATCH 4/4] tmp files owned by current user --- SpiceXPI/src/plugin/plugin.cpp | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/SpiceXPI/src/plugin/plugin.cpp b/SpiceXPI/src/plugin/plugin.cpp index 2274b63..fd2e0ed 100644 --- a/SpiceXPI/src/plugin/plugin.cpp +++ b/SpiceXPI/src/plugin/plugin.cpp @@ -617,7 +617,9 @@ void nsPluginInstance::Connect() FILE *fp; int fd = -1; char trust_store_template[] = "/tmp/truststore.pem-XXXXXX"; + mode_t prev_umask = umask(0177); fd = mkstemp(trust_store_template); + umask(prev_umask); m_trust_store_file = trust_store_template; if (fd != -1) -- 1.7.7.6 -- Peter Hatina EMEA ENG-Desktop Development Red Hat Czech, Brno _______________________________________________ Spice-devel mailing list Spice-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/spice-devel