[kdelibs/f15] solid hardware does not detect NFS drives, related to halectomy (#751879) Fix fd leak in KLockFile (

Rex Dieter rdieter at fedoraproject.org
Mon Nov 14 15:29:26 UTC 2011


commit 504faef7f5f3f29b22864e5b5285d3cac300d26d
Author: Rex Dieter <rdieter at fedoraproject.org>
Date:   Mon Nov 14 09:29:23 2011 -0600

    solid hardware does not detect NFS drives, related to halectomy (#751879)
    Fix fd leak in KLockFile (#753709)

 kdelibs-4.5.90-halectomy.patch         |  107 --------------------------------
 kdelibs-fix_fd_leak_in_klockfile.patch |   50 +++++++++++++++
 kdelibs.spec                           |   18 ++++--
 3 files changed, 62 insertions(+), 113 deletions(-)
---
diff --git a/kdelibs-fix_fd_leak_in_klockfile.patch b/kdelibs-fix_fd_leak_in_klockfile.patch
new file mode 100644
index 0000000..78220f4
--- /dev/null
+++ b/kdelibs-fix_fd_leak_in_klockfile.patch
@@ -0,0 +1,50 @@
+commit 865e5fa4108bb3f470b9424ec34dc573d97e2473
+Author: David Faure <faure at kde.org>
+Date:   Wed Aug 24 10:29:09 2011 +0200
+
+    Fix fd leak in KLockFile
+    
+    Didn't expect that after open(fd), QFile::close doesn't close the fd :)
+
+diff --git a/kdecore/io/klockfile_unix.cpp b/kdecore/io/klockfile_unix.cpp
+index fa2eda4..93e92e2 100644
+--- a/kdecore/io/klockfile_unix.cpp
++++ b/kdecore/io/klockfile_unix.cpp
+@@ -78,6 +78,7 @@ public:
+         : staleTime(30), // 30 seconds
+           isLocked(false),
+           linkCountSupport(true),
++          mustCloseFd(false),
+           m_pid(-1),
+           m_componentData(c)
+     {
+@@ -102,6 +103,7 @@ public:
+     int staleTime;
+     bool isLocked;
+     bool linkCountSupport;
++    bool mustCloseFd;
+     QTime staleTimer;
+     KDE_struct_stat statBuf;
+     int m_pid;
+@@ -285,7 +287,10 @@ KLockFile::LockResult KLockFile::Private::lockFileOExcl(KDE_struct_stat &st_buf)
+     if (!m_file.open(fd, QIODevice::WriteOnly)) {
+         return LockError;
+     }
++    mustCloseFd = true;
+     writeIntoLockFile(m_file, m_componentData);
++
++    // stat to get the modification time
+     const int result = KDE_lstat(QFile::encodeName(m_fileName), &st_buf);
+     if (result != 0)
+         return KLockFile::LockError;
+@@ -476,6 +481,10 @@ void KLockFile::unlock()
+   if (d->isLocked)
+   {
+      ::unlink(QFile::encodeName(d->m_fileName));
++      if (d->mustCloseFd) {
++         close(d->m_file.handle());
++         d->mustCloseFd = false;
++     }
+      d->m_file.close();
+      d->m_pid = -1;
+      d->isLocked = false;
diff --git a/kdelibs.spec b/kdelibs.spec
index dc6f9ed..212e9bc 100644
--- a/kdelibs.spec
+++ b/kdelibs.spec
@@ -20,7 +20,7 @@
 
 Summary: KDE Libraries
 Version: 4.6.5
-Release: 7%{?dist}
+Release: 8%{?dist}
 
 Name: kdelibs
 Epoch: 6
@@ -122,6 +122,10 @@ Patch103: kdelibs-4.6.5-kconfig_sync-1.patch
 Patch104: kdelibs-4.6.5-kconfig_sync-2.patch
 Patch105: kdelibs-4.6.5-kconfig_sync-3.patch
 
+## 4.7 upstream
+# https://projects.kde.org/projects/kde/kdelibs/repository/revisions/865e5fa4108bb3f470b9424ec34dc573d97e2473
+Patch150: kdelibs-fix_fd_leak_in_klockfile.patch
+
 
 ## security fix
 # Not Upstreamed? why not ? -- Rex
@@ -131,8 +135,6 @@ Patch201: kdelibs-4.6.5-CVE-2011-3365-kio.patch
 Patch202: kdelibs-4.6.5-CVE-2011-3365-kssl.patch
 
 ## Fedora specific patches
-# make forcefully hal-free build
-Patch300: kdelibs-4.5.90-halectomy.patch
 
 # force upgrade of apps using the discontinued KatePart Smart* interfaces to
 # versions using the new Moving* interfaces instead
@@ -312,15 +314,15 @@ sed -i -e "s|@@VERSION_RELEASE@@|%{version}-%{release}|" kio/kio/kprotocolmanage
 %patch104 -p1 -b .kconfig_sync-2
 %patch105 -p1 -b .kconfig_sync-3
 
+# 4.7 backported patches
+%patch150 -p1 -b .fix_leak_in_klockfile
+
 # security fix
 %patch200 -p1 -b .CVE-2009-2702
 %patch201 -p1 -b .CVE-2011-3365-kio
 %patch202 -p1 -b .CVE-2011-3365-kssl
 
 # Fedora patches
-%if 0%{?halectomy}
-%patch300 -p0 -b .halectomy
-%endif
 
 
 %build
@@ -568,6 +570,10 @@ rm -rf %{buildroot}
 
 
 %changelog
+* Mon Nov 14 2011 Rex Dieter <rdieter at fedoraproject.org> 4.6.5-8
+- solid hardware does not detect NFS drives, related to halectomy (#751879)
+- Fix fd leak in KLockFile (#753709)
+
 * Tue Oct 11 2011 Rex Dieter <rdieter at fedoraproject.org> 4.6.5-7
 - KConfig fails to sync on VFAT, CIFS, and EncFS (#730721,kde#203554)
 


More information about the scm-commits mailing list