rpms/kdelibs4/F-8 kdelibs-4.1.3-kde#161117.patch, NONE, 1.1 kdelibs-4.1.3-policykit-workaround.patch, NONE, 1.1 kdelibs4.spec, 1.41, 1.42 kdelibs-4.0.2-policykit-workaround.patch, 1.2, NONE

Kevin Kofler kkofler at fedoraproject.org
Mon Dec 8 01:15:54 UTC 2008


Author: kkofler

Update of /cvs/pkgs/rpms/kdelibs4/F-8
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv28904/F-8

Modified Files:
	kdelibs4.spec 
Added Files:
	kdelibs-4.1.3-kde#161117.patch 
	kdelibs-4.1.3-policykit-workaround.patch 
Removed Files:
	kdelibs-4.0.2-policykit-workaround.patch 
Log Message:
Sync from kdelibs/F-9:

* Mon Dec 08 2008 Kevin Kofler <Kevin at tigcc.ticalc.org> 4.1.3-4
- restore NTFS workaround which accidentally got dropped in the 4.1.3 update

* Thu Nov 20 2008 Rex Dieter <rdieter at fedoraproject.org> 4.1.3-3
- unmess Utilities menu (kdebug:161117)

kdelibs-4.1.3-kde#161117.patch:

--- NEW FILE kdelibs-4.1.3-kde#161117.patch ---
--- branches/KDE/4.1/kdelibs/kded/applications.menu	2008/07/09 10:18:33	829867
+++ branches/KDE/4.1/kdelibs/kded/applications.menu	2008/11/20 18:09:13	886953
@@ -393,16 +393,16 @@
 		<Name>Utilities</Name>
 		<Directory>kde-utilities.directory</Directory>
 		<Include>
-			<Or>
+			<And>
 				<Category>Utility</Category>
-				<Category>TextEditor</Category>
-				<Category>Accessibility</Category>
-				<Category>X-KDE-Utilities-Desktop</Category>
-				<Category>X-KDE-Utilities-File</Category>
-				<Category>X-KDE-Utilities-Peripherals</Category>
-				<Category>X-KDE-Utilities-PIM</Category>
-				<Category>X-KDE-More</Category>
-			</Or>
+				<Not><Category>X-KDE-More</Category></Not>
+			</And>
+			<Category>TextEditor</Category>
+			<Category>Accessibility</Category>
+			<Category>X-KDE-Utilities-Desktop</Category>
+			<Category>X-KDE-Utilities-File</Category>
+			<Category>X-KDE-Utilities-Peripherals</Category>
+			<Category>X-KDE-Utilities-PIM</Category>
 		</Include>
 		<Menu>
 			<Name>XUtilities</Name>

kdelibs-4.1.3-policykit-workaround.patch:

--- NEW FILE kdelibs-4.1.3-policykit-workaround.patch ---
diff -ur kdelibs-4.1.3/solid/solid/backends/hal/halstorageaccess.cpp kdelibs-4.1.3-policykit-workaround/solid/solid/backends/hal/halstorageaccess.cpp
--- kdelibs-4.1.3/solid/solid/backends/hal/halstorageaccess.cpp	2008-10-30 14:24:05.000000000 +0100
+++ kdelibs-4.1.3-policykit-workaround/solid/solid/backends/hal/halstorageaccess.cpp	2008-12-08 02:07:20.000000000 +0100
@@ -17,10 +17,13 @@
 
 */
 
+#include <config-prefix.h> // for LIBEXEC_INSTALL_DIR
+
 #include "halstorageaccess.h"
 
 #include <QtCore/QLocale>
 #include <QtCore/QDebug>
+#include <QtCore/QProcess>
 #include <QtDBus/QDBusConnection>
 #include <QtDBus/QDBusInterface>
 #include <QtDBus/QDBusReply>
@@ -137,11 +140,21 @@
 {
     // TODO: Better error reporting here
     if (m_setupInProgress) {
+        if (error.name() == "org.freedesktop.Hal.Device.PermissionDeniedByPolicy") {
+            if (callPrivilegedMount())
+              return;
+            // if we fail to run kdesu, fall through and emit the original PermissionDeniedByPolicy error
+        }
         m_setupInProgress = false;
         emit setupDone(Solid::UnauthorizedOperation,
                        error.name()+": "+error.message(),
                        m_device->udi());
     } else if (m_teardownInProgress) {
+        if (error.name() == "org.freedesktop.Hal.Device.PermissionDeniedByPolicy") {
+            if (callPrivilegedUnmount())
+              return;
+            // if we fail to run kdesu, fall through and emit the original PermissionDeniedByPolicy error
+        }
         m_teardownInProgress = false;
         emit teardownDone(Solid::UnauthorizedOperation,
                           error.name()+": "+error.message(),
@@ -241,7 +254,8 @@
 #else
     QString uid="uid=";
 #endif
-    if (halOptions.contains(uid)) {
+    if (halOptions.contains(uid)
+        && (fstype == "vfat" || fstype == "iso9660" || fstype == "hfs" || fstype == "udf")) {
         options << uid+QString::number(::getuid());
     }
 
@@ -297,6 +311,59 @@
                               SLOT(slotDBusError(const QDBusError &)));
 }
 
+bool Solid::Backends::Hal::StorageAccess::callPrivilegedMount()
+{
+    QString udi = m_device->udi();
+    QString options;
+    QStringList halOptions = m_device->property("volume.mount.valid_options").toStringList();
+    QString fstype = m_device->property("volume.fstype").toString();
+
+    if (halOptions.contains("uid=")
+        && (fstype == "vfat" || fstype == "iso9660" || fstype == "hfs" || fstype == "udf")) {
+        options = "uid="+QString::number(::getuid());
+    }
+
+    m_process = new QProcess(this);
+
+    connect(m_process, SIGNAL(finished(int, QProcess::ExitStatus)),
+            this, SLOT(slotProcessFinished(int, QProcess::ExitStatus)));
+
+    m_process->start(LIBEXEC_INSTALL_DIR "/kdesu", QStringList() << "-d" << "-t"
+        << "--noignorebutton" << "-c"
+        << QString::fromLatin1("dbus-send  --system --print-reply --dest=org.freedesktop.Hal %1 "
+                               "org.freedesktop.Hal.Device.Volume.Mount string: string: "
+                               "array:string:%2").arg(udi).arg(options));
+
+    if (m_process->waitForStarted()) {
+        return true;
+    } else {
+        delete m_process;
+        return false;
+    }
+}
+
+bool Solid::Backends::Hal::StorageAccess::callPrivilegedUnmount()
+{
+    QString udi = m_device->udi();
+
+    m_process = new QProcess(this);
+
+    connect(m_process, SIGNAL(finished(int, QProcess::ExitStatus)),
+            this, SLOT(slotProcessFinished(int, QProcess::ExitStatus)));
+
+    m_process->start(LIBEXEC_INSTALL_DIR "/kdesu", QStringList() << "-d" << "-t"
+        << "--noignorebutton" << "-c"
+        << QString::fromLatin1("dbus-send  --system --print-reply --dest=org.freedesktop.Hal %1 "
+                               "org.freedesktop.Hal.Device.Volume.Unmount array:string:").arg(udi));
+
+    if (m_process->waitForStarted()) {
+        return true;
+    } else {
+        delete m_process;
+        return false;
+    }
+}
+
 bool Solid::Backends::Hal::StorageAccess::callSystemMount()
 {
     const QString device = m_device->property("block.device").toString();
diff -ur kdelibs-4.1.3/solid/solid/backends/hal/halstorageaccess.h kdelibs-4.1.3-policykit-workaround/solid/solid/backends/hal/halstorageaccess.h
--- kdelibs-4.1.3/solid/solid/backends/hal/halstorageaccess.h	2008-05-21 13:07:38.000000000 +0200
+++ kdelibs-4.1.3-policykit-workaround/solid/solid/backends/hal/halstorageaccess.h	2008-12-08 02:05:21.000000000 +0100
@@ -69,6 +69,9 @@
     bool callSystemMount();
     bool callSystemUnmount();
 
+    bool callPrivilegedMount();
+    bool callPrivilegedUnmount();
+
     bool requestPassphrase();
     void callCryptoSetup(const QString &passphrase);
     bool callCryptoTeardown();


Index: kdelibs4.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kdelibs4/F-8/kdelibs4.spec,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -r1.41 -r1.42
--- kdelibs4.spec	12 Nov 2008 22:13:39 -0000	1.41
+++ kdelibs4.spec	8 Dec 2008 01:15:23 -0000	1.42
@@ -2,7 +2,7 @@
 
 Summary: K Desktop Environment 4 - Libraries
 Version: 4.1.3
-Release: 2%{?dist}
+Release: 4%{?dist}
 
 %if 0%{?fedora} > 8
 Name: kdelibs
@@ -68,8 +68,8 @@
 # don't cache kdeglobals paths because they change after profile directories
 # are loaded from kde4rc
 Patch10: kdelibs-4.0.2-no-cache-kdeglobals-paths.patch
-# workaround for policykit
-Patch11: kdelibs-4.0.2-policykit-workaround.patch
+# workarounds for policykit and NTFS
+Patch11: kdelibs-4.1.3-policykit-workaround.patch
 Patch12: kdelibs-4.1.0-xdg-menu.patch
 # patch KStandardDirs to use %{_libexecdir}/kde4 instead of %{_libdir}/kde4/libexec
 Patch14: kdelibs-4.0.85-libexecdir.patch
@@ -78,6 +78,8 @@
 Patch20: kdelibs-4.1.1-cmake.patch
 
 ## upstream patches
+# unmess Utilities menu
+Patch100: kdelibs-4.1.3-kde#161117.patch
 Patch103: kdelibs-4.1.2-kde#172182-http_cache_cleaner.patch
 
 BuildRequires: qt4-devel >= 4.4.0
@@ -204,6 +206,7 @@
 %patch20 -p1 -b .cmake
 
 ## upstream patches
+%patch100 -p4 -b .kde#161117
 %patch103 -p1 -b .kde#172182-http_cache_cleaner
 
 
@@ -365,6 +368,12 @@
 
 
 %changelog
+* Mon Dec 08 2008 Kevin Kofler <Kevin at tigcc.ticalc.org> 4.1.3-4
+- restore NTFS workaround which accidentally got dropped in the 4.1.3 update
+
+* Thu Nov 20 2008 Rex Dieter <rdieter at fedoraproject.org> 4.1.3-3
+- unmess Utilities menu (kdebug:161117)
+
 * Fri Nov 07 2008 Rex Dieter <rdieter at fedoraproject.org> 4.1.3-2
 - backport http_cache_cleaner fix (kdebug:172182)
 


--- kdelibs-4.0.2-policykit-workaround.patch DELETED ---




More information about the fedora-extras-commits mailing list