[packages/kde4-kdebase-workspace] - rel 2; important fix

arekm arekm at pld-linux.org
Tue Nov 4 19:43:41 CET 2014


commit 79b9203b4183c95a9500e5139ac8f604258b60be
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Tue Nov 4 19:43:35 2014 +0100

    - rel 2; important fix

 kde4-kdebase-workspace.spec |   4 +-
 sec.patch                   | 109 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 112 insertions(+), 1 deletion(-)
---
diff --git a/kde4-kdebase-workspace.spec b/kde4-kdebase-workspace.spec
index f292a05..a65b71c 100644
--- a/kde4-kdebase-workspace.spec
+++ b/kde4-kdebase-workspace.spec
@@ -8,7 +8,7 @@ Summary:	KDE 4 base workspace components
 Summary(pl.UTF-8):	Podstawowe komponenty środowiska KDE 4
 Name:		kde4-kdebase-workspace
 Version:	4.11.13
-Release:	1
+Release:	2
 License:	GPL v2+
 Group:		X11/Applications
 Source0:	http://download.kde.org/%{_state}/4.14.2/src/%{orgname}-%{version}.tar.xz
@@ -32,6 +32,7 @@ Patch1:		%{name}-kdmconfig.patch
 Patch2:		%{name}-kdm_revertcrashlogic.patch
 Patch3:		kde4-kdebase-workspace-brightness.patch
 Patch4:		kde4-kdebase-workspace-brightness-step.patch
+Patch5:		sec.patch
 URL:		http://www.kde.org/
 BuildRequires:	ConsoleKit-devel
 BuildRequires:	Mesa-libGLES-devel
@@ -522,6 +523,7 @@ dialogowych mających na celu rozszerzenie przywilejów użytkownika.
 # https://bugs.kde.org/show_bug.cgi?id=276482
 #%patch3 -p1
 %patch4 -p1
+%patch5 -p1
 
 %build
 install -d build
diff --git a/sec.patch b/sec.patch
new file mode 100644
index 0000000..acfab2f
--- /dev/null
+++ b/sec.patch
@@ -0,0 +1,109 @@
+diff --git a/kcontrol/dateandtime/dtime.cpp b/kcontrol/dateandtime/dtime.cpp
+index 518afe5..e0147d9 100644
+--- a/kcontrol/dateandtime/dtime.cpp
++++ b/kcontrol/dateandtime/dtime.cpp
+@@ -238,7 +238,6 @@ void Dtime::save( QVariantMap& helperargs )
+   helperargs["ntp"] = true;
+   helperargs["ntpServers"] = list;
+   helperargs["ntpEnabled"] = setDateTimeAuto->isChecked();
+-  helperargs["ntpUtility"] = ntpUtility;
+ 
+   if(setDateTimeAuto->isChecked() && !ntpUtility.isEmpty()){
+     // NTP Time setting - done in helper
+diff --git a/kcontrol/dateandtime/helper.h b/kcontrol/dateandtime/helper.h
+index 1cbf103..fea71ba 100644
+--- a/kcontrol/dateandtime/helper.h
++++ b/kcontrol/dateandtime/helper.h
+@@ -42,8 +42,7 @@ class ClockHelper : public QObject
+         ActionReply save(const QVariantMap &map);
+ 
+     private:
+-        int ntp(const QStringList& ntpServers, bool ntpEnabled,
+-                const QString& ntpUtility);
++        int ntp(const QStringList& ntpServers, bool ntpEnabled);
+         int date(const QString& newdate, const QString& olddate);
+         int tz(const QString& selectedzone);
+         int tzreset();
+diff --git a/kcontrol/dateandtime/helper.cpp b/kcontrol/dateandtime/helper.cpp
+index 9168db3..87f3b96 100644
+--- a/kcontrol/dateandtime/helper.cpp
++++ b/kcontrol/dateandtime/helper.cpp
+@@ -52,8 +52,7 @@
+ // 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 )
++int ClockHelper::ntp( const QStringList& ntpServers, bool ntpEnabled )
+ {
+   int ret = 0;
+ 
+@@ -69,24 +68,30 @@ int ClockHelper::ntp( const QStringList& ntpServers, bool ntpEnabled,
+   config.writeEntry("servers", ntpServers );
+   config.writeEntry("enabled", ntpEnabled );
+ 
+-  if ( ntpEnabled && !ntpUtility.isEmpty() ) {
+-    // NTP Time setting
+-    QString timeServer = ntpServers.first();
+-    if( timeServer.indexOf( QRegExp(".*\\(.*\\)$") ) != -1 ) {
+-      timeServer.replace( QRegExp(".*\\("), "" );
+-      timeServer.replace( QRegExp("\\).*"), "" );
+-      // Would this be better?: s/^.*\(([^)]*)\).*$/\1/
+-    }
++  if ( ntpEnabled ) {
++    QString ntpUtility;
++    foreach(const QString &possible_ntputility, QStringList() << "ntpdate" << "rdate" ) {
++        ntpUtility = KStandardDirs::findExe(possible_ntputility);
++        if (!ntpUtility.isEmpty()) {
++            // NTP Time setting
++            QString timeServer = ntpServers.first();
++            if( timeServer.indexOf( QRegExp(".*\\(.*\\)$") ) != -1 ) {
++            timeServer.replace( QRegExp(".*\\("), "" );
++            timeServer.replace( QRegExp("\\).*"), "" );
++            // Would this be better?: s/^.*\(([^)]*)\).*$/\1/
++            }
+ 
+-    KProcess proc;
+-    proc << ntpUtility << timeServer;
+-    if ( proc.execute() != 0 ) {
+-      ret |= NTPError;
++            KProcess proc;
++            proc << ntpUtility << timeServer;
++            if ( proc.execute() != 0 ) {
++            ret |= NTPError;
++            }
++        } else if( ntpEnabled ) {
++            ret |= NTPError;
++        }
++        break;
+     }
+-  } else if( ntpEnabled ) {
+-    ret |= NTPError;
+   }
+-
+   return ret;
+ }
+ 
+@@ -111,6 +116,13 @@ int ClockHelper::date( const QString& newdate, const QString& olddate )
+ int ClockHelper::tz( const QString& selectedzone )
+ {
+     int ret = 0;
++
++    //only allow letters, numbers hyphen underscore plus and forward slash
++    //allowed pattern taken from time-util.c in systemd
++    if (!QRegExp("[a-zA-Z0-9-_+/]*").exactMatch(selectedzone)) {
++        return ret;
++    }
++
+ #if defined(USE_SOLARIS)	// MARCO
+ 
+         KTemporaryFile tf;
+@@ -227,7 +239,7 @@ ActionReply ClockHelper::save(const QVariantMap &args)
+   int ret = 0; // error code
+ //  The order here is important
+   if( _ntp )
+-    ret |= ntp( args.value("ntpServers").toStringList(), args.value("ntpEnabled").toBool(), args.value("ntpUtility").toString() );
++    ret |= ntp( args.value("ntpServers").toStringList(), args.value("ntpEnabled").toBool());
+   if( _date )
+     ret |= date( args.value("newdate").toString(), args.value("olddate").toString() );
+   if( _tz )
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/kde4-kdebase-workspace.git/commitdiff/79b9203b4183c95a9500e5139ac8f604258b60be



More information about the pld-cvs-commit mailing list