From c4459cb0da5d7fcd4aa0f6cd7bb7ae459264442f Mon Sep 17 00:00:00 2001 From: huayadong Date: Fri, 11 Mar 2022 16:55:16 +0800 Subject: [PATCH] Fix the problem that the new user in the control panel is stuck --- ...w-user-in-the-control-panel-is-stuck.patch | 54 +++++++++++++++++++ ukui-control-center.spec | 7 ++- 2 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 0006-fix-the-problem-that-the-new-user-in-the-control-panel-is-stuck.patch diff --git a/0006-fix-the-problem-that-the-new-user-in-the-control-panel-is-stuck.patch b/0006-fix-the-problem-that-the-new-user-in-the-control-panel-is-stuck.patch new file mode 100644 index 0000000..b9db9e6 --- /dev/null +++ b/0006-fix-the-problem-that-the-new-user-in-the-control-panel-is-stuck.patch @@ -0,0 +1,54 @@ +From d832b319220c7b02e4ce55a1980111b4170d31ec Mon Sep 17 00:00:00 2001 +From: huayadong +Date: Fri, 11 Mar 2022 16:36:23 +0800 +Subject: [PATCH] xxxxxxxxxxxxxxxxxxxxx + +--- + registeredQDbus/sysdbusregister.cpp | 29 ++++++++--------------------- + 1 file changed, 8 insertions(+), 21 deletions(-) + +diff --git a/registeredQDbus/sysdbusregister.cpp b/registeredQDbus/sysdbusregister.cpp +index 4b7786f..4eecad5 100644 +--- a/registeredQDbus/sysdbusregister.cpp ++++ b/registeredQDbus/sysdbusregister.cpp +@@ -162,29 +162,16 @@ void SysdbusRegister::setPasswdAging(int days, QString username) { + } + + int SysdbusRegister::_changeOtherUserPasswd(QString username, QString pwd){ ++ QProcess process; ++ QProcessEnvironment env; ++ env.insert("LC_ALL", "C"); + +- std::string str1 = username.toStdString(); +- const char * user_name = str1.c_str(); ++ process.setProcessEnvironment(env); ++ process.start("/usr/bin/passwd", QStringList() << QString(username)); ++ process.write(QString("%1\n%2\n").arg(pwd).arg(pwd).toLatin1()); + +- std::string str2 = pwd.toStdString(); +- const char * passwd = str2.c_str(); +- +- QString output; +- +- char * cmd = g_strdup_printf("/usr/bin/changeotheruserpwd '%s' '%s'", user_name, passwd); +- +- FILE *stream; +- char buf[256]; +- +- if ((stream = popen(cmd, "r" )) == NULL){ +- return -1; +- } +- +- while(fgets(buf, 256, stream) != NULL){ +- output = QString(buf).simplified(); +- } +- +- pclose(stream); ++ process.closeWriteChannel(); ++ process.waitForFinished(); + + return 1; + } +-- +2.33.0 + diff --git a/ukui-control-center.spec b/ukui-control-center.spec index f0c8137..e4709fc 100644 --- a/ukui-control-center.spec +++ b/ukui-control-center.spec @@ -1,7 +1,7 @@ %define debug_package %{nil} Name: ukui-control-center Version: 3.0.4 -Release: 7 +Release: 8 Summary: utilities to configure the UKUI desktop License: GPL-2+ URL: http://www.ukui.org @@ -11,6 +11,7 @@ Patch02: 0002-modify-area-info-display-error.patch Patch03: 0003-fix-power-missing-issue.patch Patch04: 0004-disable-the-str-of-password-check.patch Patch05: 0005-Fix-the-problem-of-displaying-none-in-the-interface-version-information.patch +Patch06: 0006-fix-the-problem-that-the-new-user-in-the-control-panel-is-stuck.patch BuildRequires: qt5-qtsvg-devel BuildRequires: qt5-qtbase-devel @@ -113,6 +114,7 @@ Suggests: ukui-settings-daemon %patch3 -p1 %patch4 -p1 %patch5 -p1 +%patch6 -p1 %build qmake-qt5 @@ -161,6 +163,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Fri Mar 11 2022 huayadong - 3.0.4-8 +- add patch6: 0006-fix-the-problem-that-the-new-user-in-the-control-panel-is-stuck.patch + * Wed Mar 09 2022 huayadong - 3.0.4-7 - add patch5: 0004-Fix-the-problem-of-displaying-none-in-the-interface-version-information.patch