[kde-workspace/f18] fix kcmdatetimehelper search path so hwclock and zic are found (#906854)
Kevin Kofler
kkofler at fedoraproject.org
Sat Feb 2 02:10:05 UTC 2013
commit 7d28ba9b9e56b569fe88be3fc79dd928f989eee6
Author: Kevin Kofler <Kevin at tigcc.ticalc.org>
Date: Sat Feb 2 03:09:17 2013 +0100
fix kcmdatetimehelper search path so hwclock and zic are found (#906854)
* Sat Feb 02 2013 Kevin Kofler <Kevin at tigcc.ticalc.org> - 4.9.5-6
- fix kcmdatetimehelper search path so hwclock and zic are found (#906854)
kde-workspace-4.10.0-#906854.patch | 58 ++++++++++++++++++++++++++++++++++++
kde-workspace.spec | 9 +++++-
2 files changed, 66 insertions(+), 1 deletions(-)
---
diff --git a/kde-workspace-4.10.0-#906854.patch b/kde-workspace-4.10.0-#906854.patch
new file mode 100644
index 0000000..4ab6fc9
--- /dev/null
+++ b/kde-workspace-4.10.0-#906854.patch
@@ -0,0 +1,58 @@
+From 70505b9c7871b174e6f5bf1fb3d17b4e5fab14af Mon Sep 17 00:00:00 2001
+Message-Id: <70505b9c7871b174e6f5bf1fb3d17b4e5fab14af.1359767724.git.kevin.kofler at chello.at>
+From: Kevin Kofler <kevin.kofler at chello.at>
+Date: Sat, 2 Feb 2013 01:59:45 +0100
+Subject: [PATCH] kcmdatetimehelper: Hardcode PATH because $PATH is empty
+ here.
+
+Unfortunately, we cannot rely on the $PATH environment variable in KAuth
+helpers, because D-Bus activation clears it. So we have to use a
+reasonable default for the KStandardDirs::findExe search path, and
+actually use the return value of KStandardDirs::findExe in the calls to
+KProcess::execute.
+---
+ kcontrol/dateandtime/helper.cpp | 14 ++++++++++----
+ 1 files changed, 10 insertions(+), 4 deletions(-)
+
+diff --git a/kcontrol/dateandtime/helper.cpp b/kcontrol/dateandtime/helper.cpp
+index 5a946d8..9168db3 100644
+--- a/kcontrol/dateandtime/helper.cpp
++++ b/kcontrol/dateandtime/helper.cpp
+@@ -48,6 +48,10 @@
+ #include <sys/stat.h>
+ #endif
+
++// We cannot rely on the $PATH environment variable, because D-Bus activation
++// clears it. So we have to use a reasonable default.
++static const QString exePath = QLatin1String("/usr/sbin:/usr/bin:/sbin:/bin");
++
+ int ClockHelper::ntp( const QStringList& ntpServers, bool ntpEnabled,
+ const QString& ntpUtility )
+ {
+@@ -96,8 +100,9 @@ int ClockHelper::date( const QString& newdate, const QString& olddate )
+ return DateError;
+ }
+
+- if (!KStandardDirs::findExe("hwclock").isEmpty()) {
+- KProcess::execute("hwclock", QStringList() << "--systohc");
++ QString hwclock = KStandardDirs::findExe("hwclock", exePath);
++ if (!hwclock.isEmpty()) {
++ KProcess::execute(hwclock, QStringList() << "--systohc");
+ }
+ return 0;
+ }
+@@ -172,8 +177,9 @@ int ClockHelper::tz( const QString& selectedzone )
+ #else
+ QString tz = "/usr/share/zoneinfo/" + selectedzone;
+
+- if( !KStandardDirs::findExe( "zic" ).isEmpty()) {
+- KProcess::execute("zic", QStringList() << "-l" << selectedzone);
++ QString zic = KStandardDirs::findExe("zic", exePath);
++ if (!zic.isEmpty()) {
++ KProcess::execute(zic, QStringList() << "-l" << selectedzone);
+ } else if (!QFile::remove("/etc/localtime")) {
+ ret |= TimezoneError;
+ } else if (!QFile::copy(tz, "/etc/localtime")) {
+--
+1.7.7.6
+
diff --git a/kde-workspace.spec b/kde-workspace.spec
index 57e4f50..f0d5536 100644
--- a/kde-workspace.spec
+++ b/kde-workspace.spec
@@ -11,7 +11,7 @@
Summary: KDE Workspace
Name: kde-workspace
Version: 4.9.5
-Release: 5%{?dist}
+Release: 6%{?dist}
License: GPLv2
URL: https://projects.kde.org/projects/kde/kde-workspace
@@ -117,6 +117,9 @@ Patch57: kde-workspace-4.8.0-bug796969.patch
# Support for systemd AND ConsoleKit in kworkspace
Patch62: kde-workspace-4.9.3-systemd-displaymanager.patch
+# fix kcmdatetimehelper search path so hwclock and zic are found (#906854)
+Patch63: kde-workspace-4.10.0-#906854.patch
+
## upstream patches
## plasma active patches
@@ -455,6 +458,7 @@ Requires: akonadi
%patch55 -p1 -b .notifier_freespace
%patch57 -p1 -b .bug796969
%patch62 -p0 -b .systemd-displaymanager
+%patch63 -p1 -b .#906854
# upstream patches
@@ -1005,6 +1009,9 @@ fi
%changelog
+* Sat Feb 02 2013 Kevin Kofler <Kevin at tigcc.ticalc.org> - 4.9.5-6
+- fix kcmdatetimehelper search path so hwclock and zic are found (#906854)
+
* Fri Feb 01 2013 Rex Dieter <rdieter at fedoraproject.org> 4.9.5-5
- notifier_freespace.patch
More information about the scm-commits
mailing list