Blame SOURCES/libgsf-gnome-695907-selinux-use-tmpdir-for-tmpfile.patch

c9104b
--- libgsf-1.14.26/thumbnailer/main.c	2013-03-15 11:52:30.534080736 +0000
c9104b
+++ libgsf-1.14.26/thumbnailer/main.c	2013-03-15 12:03:26.380766098 +0000
c9104b
@@ -97,14 +97,19 @@
c9104b
 static void
c9104b
 write_thumbnail (const char *filename, gconstpointer data, gsize size, int thumb_size)
c9104b
 {
c9104b
+	GError *error = NULL;
c9104b
 	char *tmp_name;
c9104b
 	int fd;
c9104b
 	FILE *file;
c9104b
 
c9104b
-	tmp_name = g_strdup_printf ("%s.XXXXXX", filename);
c9104b
-	fd = g_mkstemp (tmp_name);
c9104b
-	if (fd == -1) {
c9104b
-		perror ("Could not create temporary file");
c9104b
+	fd = g_file_open_tmp("gsf-thumbnailer-XXXXXX", &tmp_name, &error);
c9104b
+	if(error) {
c9104b
+		if(error->message) {
c9104b
+			g_printerr ("error: %s\n", error->message);
c9104b
+		} else {
c9104b
+			g_printerr ("error: %s\n", "Could not create tmp file");
c9104b
+		}
c9104b
+		g_error_free(error);
c9104b
 		exit (EXIT_FAILURE);
c9104b
 	}
c9104b