rpms/beagle/F-10 beagle-0.3.8-tmp-permissions.patch, NONE, 1.1 beagle.spec, 1.154, 1.155

Adel Gadllah drago01 at fedoraproject.org
Sun Dec 28 14:30:54 UTC 2008


Author: drago01

Update of /cvs/pkgs/rpms/beagle/F-10
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv4107

Modified Files:
	beagle.spec 
Added Files:
	beagle-0.3.8-tmp-permissions.patch 
Log Message:
backport upstream fix for RH 465358

beagle-0.3.8-tmp-permissions.patch:

--- NEW FILE beagle-0.3.8-tmp-permissions.patch ---
diff -upNr beagle-0.3.8.orign/Filters/FilterArchive.cs beagle-0.3.8/Filters/FilterArchive.cs
--- beagle-0.3.8.orign/Filters/FilterArchive.cs	2008-06-12 02:20:07.000000000 +0200
+++ beagle-0.3.8/Filters/FilterArchive.cs	2008-12-28 15:28:54.000000000 +0100
@@ -227,12 +227,17 @@ namespace Beagle.Filters {
 				return null;
 
 			string filename = FileSystem.GetTempFileName (extension);
-			FileStream file_stream = File.OpenWrite (filename);
+			FileStream file_stream = new FileStream (filename, FileMode.OpenOrCreate, FileAccess.Write, FileShare.ReadWrite); // FileShare.ReadWrite needed for setting the mtime
+
+			// When we dump the contents of an indexable into a file, we
+			// expect to use it again soon.
+			FileAdvise.PreLoad (file_stream);
 
 			//Log.Debug ("Storing archive contents in {0}", filename);
-			
-			Mono.Unix.Native.Syscall.chmod (filename, (Mono.Unix.Native.FilePermissions) 384); // 384 is 0600
-			
+
+			File.SetLastWriteTimeUtc (filename, mtime); // change this before making read-only
+			Mono.Unix.Native.Syscall.chmod (filename, Mono.Unix.Native.FilePermissions.S_IRUSR);
+
 			BufferedStream buffered_stream = new BufferedStream (file_stream);
 
 			byte [] buffer = new byte [8192];
@@ -286,14 +291,10 @@ namespace Beagle.Filters {
 			buffered_stream.Close ();
 
 			if (skip_file) {
-				File.Delete (filename);
+				FileSystem.PosixDelete (filename);
 				return null;
 			}
 
-			File.SetLastWriteTimeUtc (filename, mtime);
-
-			Mono.Unix.Native.Syscall.chmod (filename, (Mono.Unix.Native.FilePermissions) 256); // 256 is 0400
-
 			return filename;
 		}
 


Index: beagle.spec
===================================================================
RCS file: /cvs/pkgs/rpms/beagle/F-10/beagle.spec,v
retrieving revision 1.154
retrieving revision 1.155
diff -u -r1.154 -r1.155
--- beagle.spec	8 Nov 2008 18:44:44 -0000	1.154
+++ beagle.spec	28 Dec 2008 14:30:23 -0000	1.155
@@ -1,6 +1,6 @@
 Name:		beagle
 Version:	0.3.8
-Release:	13%{?dist}
+Release:	14%{?dist}
 Summary:	The Beagle Search Infrastructure
 Group:		User Interface/Desktops
 # see COPYING for details
@@ -61,6 +61,8 @@
 Patch10: beagle-0.3.8-libgnome-desktop-soname.patch
 #svn commit r4855
 Patch11: beagle-0.3.8-category-crash.patch
+#svn commit 4899, fixes RH #465358
+Patch12: beagle-0.3.8-tmp-permissions.patch
 # Mono is not available on these arches 
 ExcludeArch: s390 s390x sparc64 ppc64
 
@@ -153,6 +155,7 @@
 %patch9 -p1 -b .desktop-parser
 %patch10 -p1 -b .gnome-desktop
 %patch11 -p1 -b .category-crash
+%patch12 -p1 -b .tmp-leak
 
 %build
 autoconf
@@ -344,6 +347,9 @@
 %{_libdir}/pkgconfig/beagle*.pc
 
 %changelog
+* Sun Dec 28 2008 Adel Gadllah <adel.gadllah at gmail.com> - 0.3.8-14
+- Fix tmp file leak, RH #465358
+
 * Sat Nov 08 2008 Adel Gadllah <adel.gadllah at gmail.com> - 0.3.8-13
 - Fix patch to apply
 




More information about the fedora-extras-commits mailing list