[Spice-devel] [PATCH spice-gtk] option: check that default ca-file exists

Marc-André Lureau marcandre.lureau at gmail.com
Thu Apr 24 06:45:34 PDT 2014


Don't set default ca-file path if the file doesn't exists.
---
 gtk/spice-option.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gtk/spice-option.c b/gtk/spice-option.c
index 2d03912..0a0f9ef 100644
--- a/gtk/spice-option.c
+++ b/gtk/spice-option.c
@@ -226,6 +226,8 @@ void spice_set_session_option(SpiceSession *session)
         if (!homedir)
             homedir = g_get_home_dir();
         ca_file = g_build_filename(homedir, ".spicec", "spice_truststore.pem", NULL);
+        if (!g_file_test(ca_file, G_FILE_TEST_IS_REGULAR))
+            g_clear_pointer(&ca_file, g_free);
     }
 
     if (disable_effects) {
-- 
1.8.5.3



More information about the Spice-devel mailing list