From f1f28dada34524accd11ead4dc6abc0950958952 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Wed, 13 Jan 2010 18:05:23 +0000 Subject: [PATCH] forgotten mktemp call in composer code --- evolution-2.29.5-mktemp.patch | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/evolution-2.29.5-mktemp.patch b/evolution-2.29.5-mktemp.patch index 526e242..c3d0861 100644 --- a/evolution-2.29.5-mktemp.patch +++ b/evolution-2.29.5-mktemp.patch @@ -1,3 +1,34 @@ +diff --git a/composer/e-composer-autosave.c b/composer/e-composer-autosave.c +index a289866..f783e6c 100644 +--- a/composer/e-composer-autosave.c ++++ b/composer/e-composer-autosave.c +@@ -91,6 +91,7 @@ static gboolean + composer_autosave_state_open (AutosaveState *state) + { + gchar *path; ++ gint fd; + + if (state->file != NULL) + return TRUE; +@@ -100,13 +101,16 @@ composer_autosave_state_open (AutosaveState *state) + + /* Since GIO doesn't have support for creating temporary files + * from a template (and in a given directory), we have to use +- * mktemp(), which brings a small risk of overwriting another ++ * g_mkstemp(), which brings a small risk of overwriting another + * autosave file. The risk is, however, miniscule. */ +- if (mktemp (path) == NULL) { ++ fd = g_mkstemp (path) ++ if (fd == -1) { + g_free (path); + return FALSE; + } + ++ close (fd); ++ + /* Create the GFile */ + state->file = g_file_new_for_path (path); + g_free (path); diff --git a/e-util/e-mktemp.c b/e-util/e-mktemp.c index 509b312..15b5668 100644 --- a/e-util/e-mktemp.c