public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/kde:master commit in: kde-base/kdepasswd/, kde-base/kdepasswd/files/
@ 2014-07-24 18:20 Johannes Huber
  0 siblings, 0 replies; only message in thread
From: Johannes Huber @ 2014-07-24 18:20 UTC (permalink / raw
  To: gentoo-commits

commit:     11724d86beaecb3f40ca8d7346f8f135632c96f4
Author:     Johannes Huber <johu <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 24 18:16:20 2014 +0000
Commit:     Johannes Huber <johu <AT> gentoo <DOT> org>
CommitDate: Thu Jul 24 18:20:48 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/kde.git;a=commit;h=11724d86

[kde-base/kdepasswd] Add patch, bug #380899

Backported Plasma 5 upstream patch by Michael Palimaka <kensington <AT> gentoo.org>,
which uses sys-apps/accountsservice at runtime.

Package-Manager: portage-2.2.10

---
 .../kdepasswd-4.13.3-use-accountsservice.patch     | 104 +++++++++++++++++++++
 ...-4.13.90.ebuild => kdepasswd-4.13.90-r1.ebuild} |   3 +
 kde-base/kdepasswd/kdepasswd-4.14.49.9999.ebuild   |   3 +
 kde-base/kdepasswd/kdepasswd-4.9999.ebuild         |   3 +
 4 files changed, 113 insertions(+)

diff --git a/kde-base/kdepasswd/files/kdepasswd-4.13.3-use-accountsservice.patch b/kde-base/kdepasswd/files/kdepasswd-4.13.3-use-accountsservice.patch
new file mode 100644
index 0000000..5a89d4d
--- /dev/null
+++ b/kde-base/kdepasswd/files/kdepasswd-4.13.3-use-accountsservice.patch
@@ -0,0 +1,104 @@
+Use accountsservice instead of calling chfn directly.
+
+This avoids a potential error or crash when changing user account information.
+Backported 77275f50241eb2f4e38051152074c379fa96fe84 and 
+23bbe79912ec21ded8fdfc595935f48a6d2298ea from Plasma 5.
+
+Gentoo bug #380899
+KDE bug #156396
+
+--- a/kdepasswd/kcm/CMakeLists.txt
++++ b/kdepasswd/kcm/CMakeLists.txt
+@@ -1,7 +1,6 @@
+ add_subdirectory(pics)
+ 
+ set(kcm_useraccount_PART_SRCS
+-    chfnprocess.cpp
+     main.cpp
+     chfacedlg.cpp)
+ 
+--- a/kdepasswd/kcm/main.cpp
++++ b/kdepasswd/kcm/main.cpp
+@@ -49,7 +49,6 @@
+ 
+ #include "settings.h"
+ #include "pass.h"
+-#include "chfnprocess.h"
+ #include <KPluginFactory>
+ #include <KPluginLoader>
+ 
+@@ -181,36 +180,27 @@ void KCMUserAccount::save()
+ 	/* Save realname to /etc/passwd */
+ 	if ( _mw->leRealname->isModified() )
+ 	{
+-		KPasswordDialog dlg( _mw );
+-		dlg.setPrompt(i18n("Please enter your password in order to save your settings:"));
+-		if ( !dlg.exec() )
+-		{
+-			KMessageBox::sorry( this, i18n("You must enter "
+-				"your password in order to change your information."));
+-			return;
+-		}
+-
+-		ChfnProcess *proc = new ChfnProcess();
+-		int ret = proc->exec(dlg.password().toLocal8Bit() , _mw->leRealname->text().toLocal8Bit() );
+-		if ( ret )
+-		{
+-			if ( ret == ChfnProcess::PasswordError )
+-				KMessageBox::sorry( this, i18n("You must enter a correct password."));
+-
+-			else
+-			{
+-				KMessageBox::sorry( this, i18n("An error occurred and your name has "
+-							"probably not been changed. The error "
+-							"message was:\n%1", QString::fromLocal8Bit(proc->error())));
+-				kDebug() << "ChfnProcess->exec() failed. Error code: " << ret
+-					<< "\nOutput:" << proc->error() << endl;
+-			}
+-
+-			delete proc;
+-			return;
+-		}
+-
+-		delete proc;
++        // save icon file also with accountsservice
++        QDBusInterface ainterface("org.freedesktop.Accounts",
++            "/org/freedesktop/Accounts",
++            "org.freedesktop.Accounts",
++            QDBusConnection::systemBus());
++        QDBusReply<QDBusObjectPath> reply = ainterface.call("FindUserById", qlonglong(_ku->uid()));
++        if (reply.isValid() && !reply.error().isValid()) {
++            QDBusInterface uinterface("org.freedesktop.Accounts",
++                reply.value().path(),
++                "org.freedesktop.Accounts.User",
++                QDBusConnection::systemBus(),
++                this);
++
++            QString name = _mw->leRealname->text();
++            QDBusReply<void> ureply = uinterface.call("SetRealName", name);
++            if (!ureply.isValid() || ureply.error().isValid()) {
++                kDebug() << ureply.error().message();
++                KMessageBox::error( this, i18n("There was an error setting the name: %1" ,
++                    name) );
++            }
++        }
+ 	}
+ #endif
+ 
+@@ -243,10 +233,12 @@ void KCMUserAccount::save()
+ 		}
+ 	}
+ 	else { // delete existing image
+-		if ( !KIO::NetAccess::del(KCFGUserAccount::faceFile(), this) ) {
+-			KMessageBox::error( this, i18n("There was an error deleting the image: %1" ,
+-				KCFGUserAccount::faceFile()) );
+-		}
++        if (QFile::exists(KCFGUserAccount::faceFile())) {
++            if ( !KIO::NetAccess::del(KCFGUserAccount::faceFile(), this) ) {
++                KMessageBox::error( this, i18n("There was an error deleting the image: %1" ,
++                    KCFGUserAccount::faceFile()) );
++            }
++        }
+ 	}
+ 
+ 	/* Save KDE's homebrewn settings */
\ No newline at end of file

diff --git a/kde-base/kdepasswd/kdepasswd-4.13.90.ebuild b/kde-base/kdepasswd/kdepasswd-4.13.90-r1.ebuild
similarity index 80%
rename from kde-base/kdepasswd/kdepasswd-4.13.90.ebuild
rename to kde-base/kdepasswd/kdepasswd-4.13.90-r1.ebuild
index 3d072a9..d41b165 100644
--- a/kde-base/kdepasswd/kdepasswd-4.13.90.ebuild
+++ b/kde-base/kdepasswd/kdepasswd-4.13.90-r1.ebuild
@@ -17,4 +17,7 @@ DEPEND="
 "
 RDEPEND="${DEPEND}
 	$(add_kdebase_dep kdesu)
+	sys-apps/accountsservice
 "
+
+PATCHES=( "${FILESDIR}/${PN}-4.13.3-use-accountsservice.patch" )

diff --git a/kde-base/kdepasswd/kdepasswd-4.14.49.9999.ebuild b/kde-base/kdepasswd/kdepasswd-4.14.49.9999.ebuild
index 61a8292..720af22 100644
--- a/kde-base/kdepasswd/kdepasswd-4.14.49.9999.ebuild
+++ b/kde-base/kdepasswd/kdepasswd-4.14.49.9999.ebuild
@@ -17,4 +17,7 @@ DEPEND="
 "
 RDEPEND="${DEPEND}
 	$(add_kdebase_dep kdesu)
+	sys-apps/accountsservice
 "
+
+PATCHES=( "${FILESDIR}/${PN}-4.13.3-use-accountsservice.patch" )

diff --git a/kde-base/kdepasswd/kdepasswd-4.9999.ebuild b/kde-base/kdepasswd/kdepasswd-4.9999.ebuild
index 61a8292..720af22 100644
--- a/kde-base/kdepasswd/kdepasswd-4.9999.ebuild
+++ b/kde-base/kdepasswd/kdepasswd-4.9999.ebuild
@@ -17,4 +17,7 @@ DEPEND="
 "
 RDEPEND="${DEPEND}
 	$(add_kdebase_dep kdesu)
+	sys-apps/accountsservice
 "
+
+PATCHES=( "${FILESDIR}/${PN}-4.13.3-use-accountsservice.patch" )


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2014-07-24 22:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-24 18:20 [gentoo-commits] proj/kde:master commit in: kde-base/kdepasswd/, kde-base/kdepasswd/files/ Johannes Huber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox