diff --git a/0001-fix-CVE-PAM-authorization-bypass-due-to-incorrect-us.patch b/0001-fix-CVE-PAM-authorization-bypass-due-to-incorrect-us.patch index 401ee0670fe96fa4b3d6495dba4b112768c34237..0997542c7e3615b719d1d02b519c0fcd18eeccfa 100644 --- a/0001-fix-CVE-PAM-authorization-bypass-due-to-incorrect-us.patch +++ b/0001-fix-CVE-PAM-authorization-bypass-due-to-incorrect-us.patch @@ -1,7 +1,7 @@ From 308c40306db937dda0ed99c7a426c7730c3d326c Mon Sep 17 00:00:00 2001 From: liuxinhao Date: Mon, 14 Nov 2022 16:50:36 +0800 -Subject: [PATCH] fix(CVE): PAM authorization bypass due to incorrect usage +Subject: [PATCH 1/6] fix(CVE): PAM authorization bypass due to incorrect usage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit diff --git a/0001-fix-user-icon-fix-the-failure-to-update-the-drawing-.patch b/0002-fix-user-icon-fix-the-failure-to-update-the-drawing-.patch similarity index 91% rename from 0001-fix-user-icon-fix-the-failure-to-update-the-drawing-.patch rename to 0002-fix-user-icon-fix-the-failure-to-update-the-drawing-.patch index 135da5866c4777280fa1a068b5ec7c77448e1ced..cb4858ed9c9ed7c31143221068445ab021ff8111 100644 --- a/0001-fix-user-icon-fix-the-failure-to-update-the-drawing-.patch +++ b/0002-fix-user-icon-fix-the-failure-to-update-the-drawing-.patch @@ -1,8 +1,8 @@ From d80a8b3b5dc5ddf841474ce1fd3024483e6adb9b Mon Sep 17 00:00:00 2001 From: liuxinhao Date: Fri, 18 Nov 2022 13:45:49 +0800 -Subject: [PATCH] fix(user icon): fix the failure to update the drawing in time - when setting the default avatar +Subject: [PATCH 2/6] fix(user icon): fix the failure to update the drawing in + time when setting the default avatar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit diff --git a/0003-fix-virtualkeyboard-Invoke-virtual-keyboard-initiali.patch b/0003-fix-virtualkeyboard-Invoke-virtual-keyboard-initiali.patch new file mode 100644 index 0000000000000000000000000000000000000000..c4e989bfc3993b3df1d05d3b731c0881e265b85f --- /dev/null +++ b/0003-fix-virtualkeyboard-Invoke-virtual-keyboard-initiali.patch @@ -0,0 +1,51 @@ +From 5281b560fbb8a241b5fcc7dbc8f3634602420476 Mon Sep 17 00:00:00 2001 +From: liuxinhao +Date: Tue, 6 Dec 2022 09:45:21 +0800 +Subject: [PATCH 3/6] fix(virtualkeyboard): Invoke virtual keyboard + initialization during plug-in initialization +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +- 在插件初始化时调用虚拟键盘初始化 +--- + screensaver-dialog/src/plugin.cpp | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +diff --git a/screensaver-dialog/src/plugin.cpp b/screensaver-dialog/src/plugin.cpp +index f8f036f..8699d3c 100644 +--- a/screensaver-dialog/src/plugin.cpp ++++ b/screensaver-dialog/src/plugin.cpp +@@ -12,12 +12,13 @@ + * Author: liuxinhao + */ + #include "plugin.h" ++#include "config.h" ++#include "screensaver-dialog.h" ++#include "virtual-keyboard.h" + + #include + #include + #include +-#include "config.h" +-#include "screensaver-dialog.h" + + + #define TRANSLATION_FILE_DIR "/usr/share/kiran-screensaver-dialog/translations/" +@@ -46,6 +47,13 @@ int KSPlugin::init(Interface* ksInterface) + KLOG_WARNING() << "can't load kiran-screensaver-dialog translator"; + } + ++#ifdef VIRTUAL_KEYBOARD ++ if( !VirtualKeyboard::instance()->init() ) ++ { ++ KLOG_WARNING() << "init virtual keyboard failed!"; ++ } ++#endif ++ + return 0; + } + +-- +2.33.0 + diff --git a/0004-fix-SIGTERM-Processing-Use-socket-to-notify-SIGTERM-.patch b/0004-fix-SIGTERM-Processing-Use-socket-to-notify-SIGTERM-.patch new file mode 100644 index 0000000000000000000000000000000000000000..ef2ae2a0659c8b20ca8de48ecf7879d9f712fc18 --- /dev/null +++ b/0004-fix-SIGTERM-Processing-Use-socket-to-notify-SIGTERM-.patch @@ -0,0 +1,311 @@ +From b7a069a36d6e61977f32b2a24d84899182e38149 Mon Sep 17 00:00:00 2001 +From: liuxinhao +Date: Thu, 8 Dec 2022 10:42:44 +0800 +Subject: [PATCH 4/6] fix(SIGTERM Processing): Use socket to notify SIGTERM + signal, and process SIGTERM signal in the main thread to avoid abnormal exit +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +- 使用socket通知SIGTERM信号,在主线程里处理SIGTERM信号,避免非正常退出,修复之前QLightdm::Greeter释放过早导致AuthLightdm调用接口时崩溃问题 +--- + lib/auth-proxy/auth-lightdm.cpp | 24 ++++++------- + lib/auth-proxy/auth-lightdm.h | 5 +-- + lightdm-greeter/src/greeter-login-window.cpp | 24 ++++++------- + lightdm-greeter/src/greeter-login-window.h | 3 +- + lightdm-greeter/src/main.cpp | 37 ++++++++++++++------ + 5 files changed, 56 insertions(+), 37 deletions(-) + +diff --git a/lib/auth-proxy/auth-lightdm.cpp b/lib/auth-proxy/auth-lightdm.cpp +index 59e7849..e9193e9 100644 +--- a/lib/auth-proxy/auth-lightdm.cpp ++++ b/lib/auth-proxy/auth-lightdm.cpp +@@ -16,13 +16,13 @@ + #include "auth-lightdm.h" + #include + +-AuthLightdm::AuthLightdm(QLightDM::Greeter* greeterAuth, QObject* parent) ++AuthLightdm::AuthLightdm(QSharedPointer greeterAuth, QObject* parent) + : AuthBase(parent), +- m_greeterAuth(greeterAuth) ++ m_greeterPtrAuth(greeterAuth) + { +- connect(m_greeterAuth,&QLightDM::Greeter::showPrompt,this,&AuthLightdm::handleGreeterAuthShowPrompt); +- connect(m_greeterAuth,&QLightDM::Greeter::showMessage,this,&AuthLightdm::handleGreeterAuthShowMessage); +- connect(m_greeterAuth,&QLightDM::Greeter::authenticationComplete, this,&AuthLightdm::handleGreeterAuthComplete); ++ connect(m_greeterPtrAuth.data(),&QLightDM::Greeter::showPrompt,this,&AuthLightdm::handleGreeterAuthShowPrompt); ++ connect(m_greeterPtrAuth.data(),&QLightDM::Greeter::showMessage,this,&AuthLightdm::handleGreeterAuthShowMessage); ++ connect(m_greeterPtrAuth.data(),&QLightDM::Greeter::authenticationComplete, this,&AuthLightdm::handleGreeterAuthComplete); + } + + AuthLightdm::~AuthLightdm() +@@ -31,7 +31,7 @@ AuthLightdm::~AuthLightdm() + + bool AuthLightdm::init() + { +- bool bRes = m_greeterAuth->connectSync(); ++ bool bRes = m_greeterPtrAuth->connectSync(); + if( !bRes ) + { + KLOG_ERROR() << "can't connect greeter auth!"; +@@ -41,33 +41,33 @@ bool AuthLightdm::init() + + bool AuthLightdm::authenticate(const QString &userName) + { +- m_greeterAuth->authenticate(userName); ++ m_greeterPtrAuth->authenticate(userName); + return true; + } + + void AuthLightdm::cancelAuthentication() + { +- m_greeterAuth->cancelAuthentication(); ++ m_greeterPtrAuth->cancelAuthentication(); + } + + bool AuthLightdm::isAuthenticated() const + { +- return m_greeterAuth->isAuthenticated(); ++ return m_greeterPtrAuth->isAuthenticated(); + } + + bool AuthLightdm::inAuthentication() const + { +- return m_greeterAuth->inAuthentication(); ++ return m_greeterPtrAuth->inAuthentication(); + } + + QString AuthLightdm::authenticationUser() const + { +- return m_greeterAuth->authenticationUser(); ++ return m_greeterPtrAuth->authenticationUser(); + } + + void AuthLightdm::respond(const QString &response) + { +- m_greeterAuth->respond(response); ++ m_greeterPtrAuth->respond(response); + } + + void AuthLightdm::handleGreeterAuthShowPrompt(QString text, QLightDM::Greeter::PromptType type) +diff --git a/lib/auth-proxy/auth-lightdm.h b/lib/auth-proxy/auth-lightdm.h +index 9451f3c..810c107 100644 +--- a/lib/auth-proxy/auth-lightdm.h ++++ b/lib/auth-proxy/auth-lightdm.h +@@ -17,6 +17,7 @@ + + #include "auth-base.h" + #include ++#include + + /** + * 简单的对QLightDM::Greeter进行了一层包装,只是为了给上层认证代理AuthProxy提供统一的接口 +@@ -25,7 +26,7 @@ class AuthLightdm : public AuthBase + { + Q_OBJECT + public: +- explicit AuthLightdm(QLightDM::Greeter* greeterAuth, QObject* parent = nullptr); ++ explicit AuthLightdm(QSharedPointer greeterAuth, QObject* parent = nullptr); + ~AuthLightdm() override; + + bool init() override; +@@ -44,7 +45,7 @@ private slots: + void handleGreeterAuthComplete(); + + private: +- QLightDM::Greeter* m_greeterAuth; ++ QSharedPointer m_greeterPtrAuth; + + }; + +diff --git a/lightdm-greeter/src/greeter-login-window.cpp b/lightdm-greeter/src/greeter-login-window.cpp +index 9d46662..99beb43 100644 +--- a/lightdm-greeter/src/greeter-login-window.cpp ++++ b/lightdm-greeter/src/greeter-login-window.cpp +@@ -86,7 +86,7 @@ bool getIsLoggedIn(const QString &userName) + GreeterLoginWindow::GreeterLoginWindow(QWidget *parent) + : QWidget(parent), + ui(new Ui::GreeterLoginWindow), +- m_greeter(this), ++ m_greeterPtr(new QLightDM::Greeter()), + m_powerMenu(nullptr), + m_sessionMenu(nullptr), + m_noListButotnVisiable(true), +@@ -239,12 +239,12 @@ void GreeterLoginWindow::initUI() + this, &GreeterLoginWindow::slotUserActivated); + ///自动登录按钮点击 + connect(ui->btn_autologin, &LoginButton::sigClicked, [this]() { +- m_authProxy->authenticate(m_greeter.autologinUserHint()); ++ m_authProxy->authenticate(m_greeterPtr->autologinUserHint()); + }); +- connect(&m_greeter, &QLightDM::Greeter::autologinTimerExpired, [this]() { ++ connect(m_greeterPtr.data(), &QLightDM::Greeter::autologinTimerExpired, [this]() { + //NOTE:修复机器配置了autologin-timeout,但未配置autologin-user的情况 +- if( !m_greeter.autologinUserHint().isEmpty() ) +- m_authProxy->authenticate(m_greeter.autologinUserHint()); ++ if( !m_greeterPtr->autologinUserHint().isEmpty() ) ++ m_authProxy->authenticate(m_greeterPtr->autologinUserHint()); + }); + ///重新认证按钮点击 + connect(ui->btn_reAuth, &QPushButton::clicked, [this]() { +@@ -348,7 +348,7 @@ void GreeterLoginWindow::initMenu() + + void GreeterLoginWindow::initLightdmGreeter() + { +- AuthBase *authInterface = new AuthLightdm(&m_greeter); ++ AuthBase *authInterface = new AuthLightdm(m_greeterPtr); + AuthMsgQueue *msgQueue = new AuthMsgQueue(); + + m_authProxy = new AuthProxy(authInterface, this); +@@ -382,7 +382,7 @@ void GreeterLoginWindow::initLightdmGreeter() + ///用户0->1 且 配置允许显示用户链表 且 当前登录模式为输入用户登录 且 手动登录还未输入用户名并点击确定 + ///显示返回按钮 + qInfo() << "rowInserted:" << m_filterModel.rowCount(QModelIndex()); +- if ((m_filterModel.rowCount(QModelIndex()) == 1) && m_showUserList && m_loginMode == LOGIN_MODE_MANUAL && !m_greeter.isAuthenticated()) ++ if ((m_filterModel.rowCount(QModelIndex()) == 1) && m_showUserList && m_loginMode == LOGIN_MODE_MANUAL && !m_greeterPtr->isAuthenticated()) + { + qInfo() << "setReturn visible true"; + ui->btn_notListAndCancel->setVisible(true); +@@ -410,12 +410,12 @@ void GreeterLoginWindow::initLightdmGreeter() + ui->userlist->loadUserList(); + + //NOTE:修复#52982问题,若自动登录用户已存在不自动触发延时自动登录 +- if ( !m_greeter.autologinUserHint().isEmpty() ) ++ if ( !m_greeterPtr->autologinUserHint().isEmpty() ) + { +- bool isLogged = getIsLoggedIn(m_greeter.autologinUserHint()); ++ bool isLogged = getIsLoggedIn(m_greeterPtr->autologinUserHint()); + if( isLogged ) + { +- m_greeter.cancelAutologin(); ++ m_greeterPtr->cancelAutologin(); + } + #if 0 + //WARNING:这种方法不能取得root是否已登录信息 +@@ -551,7 +551,7 @@ void GreeterLoginWindow::startAuthUser(const QString &username, QString userIcon + ui->label_userName->setText(username); + ui->loginAvatar->setImage(userIcon); + +- if (username == m_greeter.autologinUserHint()) ++ if (username == m_greeterPtr->autologinUserHint()) + { + KLOG_DEBUG() << "authproxy user" << username << "is auto login user,switch to auto login"; + switchToAutoLogin(); +@@ -819,7 +819,7 @@ void GreeterLoginWindow::slotAuthenticationComplete(bool success) + } + } + #endif +- if (!m_greeter.startSessionSync(m_session)) ++ if (!m_greeterPtr->startSessionSync(m_session)) + { + KLOG_WARNING() << "start session failed,session:" << m_session; + } +diff --git a/lightdm-greeter/src/greeter-login-window.h b/lightdm-greeter/src/greeter-login-window.h +index 689025e..caf5d63 100644 +--- a/lightdm-greeter/src/greeter-login-window.h ++++ b/lightdm-greeter/src/greeter-login-window.h +@@ -23,6 +23,7 @@ + #include + #include + #include ++#include + + #include "auth-define.h" + #include "auth-msg-queue.h" +@@ -124,7 +125,7 @@ private: + + FilterUserProxyModel m_filterModel; + +- QLightDM::Greeter m_greeter; ++ QSharedPointer m_greeterPtr; + QLightDM::UsersModel m_userModel; + QLightDM::PowerInterface m_powerIface; + +diff --git a/lightdm-greeter/src/main.cpp b/lightdm-greeter/src/main.cpp +index 0320c51..e145b1f 100644 +--- a/lightdm-greeter/src/main.cpp ++++ b/lightdm-greeter/src/main.cpp +@@ -19,6 +19,8 @@ + #include + #include + #include ++#include ++#include + + #include "../../lib/common-widgets/virtual-keyboard.h" + #include "cursor-helper.h" +@@ -28,23 +30,27 @@ + #include "scaling-helper.h" + #include "sync-lock-status.h" + ++static int sigtermFd[2]; ++ + #define DEFAULT_STYLE_FILE ":/themes/lightdm-kiran-greeter-normal.qss" + + void termSignalHandler(int unused) + { +-#ifdef VIRTUAL_KEYBOARD +- VirtualKeyboard::instance()->keyboardProcessExit(); +-#endif +- qApp->quit(); ++ char a = 1; ++ if(write(sigtermFd[0], &a, sizeof(a)) < 1) ++ { ++ qWarning("Failed to handle term signal."); ++ } + } + + void setup_unix_signal_handlers() + { + struct sigaction term; + term.sa_handler = termSignalHandler; +- sigemptyset(&term.sa_mask); + term.sa_flags = 0; +- term.sa_flags |= SA_RESETHAND; ++ term.sa_flags = SA_RESTART; ++ ++ sigemptyset(&term.sa_mask); + int iRet = sigaction(SIGTERM, &term, 0); + if (iRet != 0) + { +@@ -61,9 +67,6 @@ int main(int argc, char *argv[]) + qWarning() << "klog_qt5_init error:" << iRet; + } + +- ///安装信号处理 +- setup_unix_signal_handlers(); +- + ///设置缩放比 + double scaled_factor = 0.0; + switch (KiranGreeterPrefs::instance()->scale_mode()) +@@ -93,6 +96,15 @@ int main(int argc, char *argv[]) + QApplication a(argc, argv); + QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); + ++ // 处理SIGTERM信号 ++ if (::socketpair(AF_UNIX, SOCK_STREAM, 0, sigtermFd)) ++ { ++ KLOG_WARNING() << "Couldn't create TERM socketpair"; ++ } ++ QSocketNotifier *snTerm = new QSocketNotifier(sigtermFd[1], QSocketNotifier::Read, &a); ++ QObject::connect(snTerm, SIGNAL(activated(int)), &a, SLOT(quit())); ++ setup_unix_signal_handlers(); ++ + ///依据登陆器整体缩放比例,设置默认光标大小 + if (!CursorHelper::setDefaultCursorSize(scaled_factor)) + { +@@ -135,5 +147,10 @@ int main(int argc, char *argv[]) + GreeterScreenManager screenManager; + screenManager.init(); + +- return a.exec(); ++ int res = a.exec(); ++ ++ close(sigtermFd[0]); ++ close(sigtermFd[1]); ++ ++ return res; + } +-- +2.33.0 + diff --git a/0005-fix-Locker-VirtualKeyboard-unlock-interface-calls-on.patch b/0005-fix-Locker-VirtualKeyboard-unlock-interface-calls-on.patch new file mode 100644 index 0000000000000000000000000000000000000000..7b95f35555b27005caa8042826b4524eaed0c596 --- /dev/null +++ b/0005-fix-Locker-VirtualKeyboard-unlock-interface-calls-on.patch @@ -0,0 +1,202 @@ +From c3472c9d50c5fb40f49d3de3d03d4d812bb48959 Mon Sep 17 00:00:00 2001 +From: liuxinhao +Date: Thu, 8 Dec 2022 10:56:20 +0800 +Subject: [PATCH 5/6] fix(Locker VirtualKeyboard): unlock interface calls + onboard, and the onboard process cycle is consistent with the unlock + interface +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +- 解锁界面调用onboard,onboard进程周期和解锁界面一致,避免出现解锁后onboard进程不退出和kiran-screensaver同一生存周期的问题 +--- + lib/common-widgets/virtual-keyboard.cpp | 8 ++-- + lib/common-widgets/virtual-keyboard.h | 8 ++-- + screensaver-dialog/src/plugin.cpp | 8 ---- + screensaver-dialog/src/screensaver-dialog.cpp | 37 +++++++++++-------- + screensaver-dialog/src/screensaver-dialog.h | 4 ++ + 5 files changed, 33 insertions(+), 32 deletions(-) + +diff --git a/lib/common-widgets/virtual-keyboard.cpp b/lib/common-widgets/virtual-keyboard.cpp +index a6921af..4e39e54 100644 +--- a/lib/common-widgets/virtual-keyboard.cpp ++++ b/lib/common-widgets/virtual-keyboard.cpp +@@ -78,7 +78,7 @@ bool VirtualKeyboard::init(QWidget *parent) + } + + xid = stdoutput.toULongLong(); +- ++ KLOG_DEBUG() << "foreign virtual keyboard window id:" << xid; + foreignWindow = QWindow::fromWinId(xid); + foreignWindow->setFlag(Qt::ForeignWindow); + m_keyboardWidget = QWidget::createWindowContainer(foreignWindow, nullptr); +@@ -113,15 +113,15 @@ void VirtualKeyboard::showAdjustSize(QWidget *parent) + if (parent == nullptr) + { + KLOG_WARNING() << "VirtualKeyboard::showAdjustSize parent can't be nullptr"; ++ return; + } + + KLOG_DEBUG() << "VirtualKeyboard::showAdjustSize" << parent->objectName(); + m_keyboardWidget->hide(); +- QRect parentRect = parent->geometry(); + m_keyboardWidget->setParent(parent); + ++ QRect parentRect = parent->geometry(); + QSize keyboardSize(parentRect.width()*ONBOARD_WIDTH_FACTOR,parentRect.height()*ONBOARD_HEIGHT_FACTOR); +- + m_keyboardWidget->resize(parentRect.width()*ONBOARD_WIDTH_FACTOR, parentRect.height()*ONBOARD_HEIGHT_FACTOR); + m_keyboardWidget->move((parentRect.width() - keyboardSize.width()) / 2, parentRect.height() - keyboardSize.height()); + m_keyboardWidget->show(); +@@ -170,4 +170,4 @@ VirtualKeyboard::VirtualKeyboard(QObject *parent) + + void VirtualKeyboard::slotReadyReadStandardOutput() + { +-} ++} +\ No newline at end of file +diff --git a/lib/common-widgets/virtual-keyboard.h b/lib/common-widgets/virtual-keyboard.h +index 31ca7c7..72d8134 100644 +--- a/lib/common-widgets/virtual-keyboard.h ++++ b/lib/common-widgets/virtual-keyboard.h +@@ -21,9 +21,11 @@ class VirtualKeyboard : public QObject + { + Q_OBJECT + public: +- static VirtualKeyboard *instance(); ++ explicit VirtualKeyboard(QObject *parent = nullptr); + ~VirtualKeyboard(); + ++ static VirtualKeyboard *instance(); ++ + bool init(QWidget *parent = nullptr); + void hide(); + bool isVisible(); +@@ -34,13 +36,11 @@ public: + public slots: + void slot_finished(int exitCode, QProcess::ExitStatus exitStatus); + +-private: +- explicit VirtualKeyboard(QObject *parent = nullptr); +- + private slots: + void slotReadyReadStandardOutput(); + + private: + QWidget * m_keyboardWidget; + QProcess *m_process; ++ QWidget *m_keyboardEmbed = nullptr; + }; +diff --git a/screensaver-dialog/src/plugin.cpp b/screensaver-dialog/src/plugin.cpp +index 8699d3c..7c435de 100644 +--- a/screensaver-dialog/src/plugin.cpp ++++ b/screensaver-dialog/src/plugin.cpp +@@ -46,14 +46,6 @@ int KSPlugin::init(Interface* ksInterface) + { + KLOG_WARNING() << "can't load kiran-screensaver-dialog translator"; + } +- +-#ifdef VIRTUAL_KEYBOARD +- if( !VirtualKeyboard::instance()->init() ) +- { +- KLOG_WARNING() << "init virtual keyboard failed!"; +- } +-#endif +- + return 0; + } + +diff --git a/screensaver-dialog/src/screensaver-dialog.cpp b/screensaver-dialog/src/screensaver-dialog.cpp +index 3ab7d19..2f1634e 100644 +--- a/screensaver-dialog/src/screensaver-dialog.cpp ++++ b/screensaver-dialog/src/screensaver-dialog.cpp +@@ -101,7 +101,17 @@ ScreenSaverDialog::ScreenSaverDialog(Kiran::ScreenSaver::Interface* ksInterface, + + ScreenSaverDialog::~ScreenSaverDialog() + { +- delete ui; ++#ifdef VIRTUAL_KEYBOARD ++ if( m_keyboard ) ++ { ++ auto keyboardWidget = m_keyboard->getKeyboard(); ++ if (m_keyboard->getKeyboard() && m_keyboard->getKeyboard()->parentWidget()==this) ++ { ++ m_keyboard->getKeyboard()->setParent(nullptr); ++ } ++ } ++#endif ++ delete ui; + } + + QWidget *ScreenSaverDialog::get_widget_ptr() +@@ -274,17 +284,23 @@ void ScreenSaverDialog::initUI() + m_authProxy->respond(ui->promptEdit->getText()); + }); + ++ + #ifdef VIRTUAL_KEYBOARD ++ m_keyboard = new VirtualKeyboard(this); ++ ++ if (!m_keyboard->init()) ++ { ++ KLOG_WARNING() << "init virtual keyboard failed!"; ++ } + connect(ui->btn_keyboard, &QToolButton::pressed, this, [this] { +- VirtualKeyboard *keyboard = VirtualKeyboard::instance(); +- if (keyboard->isVisible()) ++ if (m_keyboard->isVisible()) + { +- keyboard->hide(); ++ m_keyboard->hide(); + } + else + { + //虚拟键盘通过传入的父窗口调整大小并进行显示 +- keyboard->showAdjustSize(this); ++ m_keyboard->showAdjustSize(this); + } + this->window()->windowHandle()->setKeyboardGrabEnabled(true); + }); +@@ -560,17 +576,6 @@ void ScreenSaverDialog::startAuth() + + void ScreenSaverDialog::closeEvent(QCloseEvent *event) + { +-#ifdef VIRTUAL_KEYBOARD +- //在关闭时若虚拟键盘的副窗口设置为当前窗口的话,则更改父窗口,避免释放相关X资源导致onboard释放出错,导致onboard崩溃 +- if (VirtualKeyboard::instance()->getKeyboard()) +- { +- if (VirtualKeyboard::instance()->getKeyboard()->parentWidget() == this) +- { +- KLOG_DEBUG() << "keyboard reparent"; +- VirtualKeyboard::instance()->getKeyboard()->setParent(nullptr); +- } +- } +-#endif + QWidget::closeEvent(event); + } + +diff --git a/screensaver-dialog/src/screensaver-dialog.h b/screensaver-dialog/src/screensaver-dialog.h +index fe7a899..f166841 100644 +--- a/screensaver-dialog/src/screensaver-dialog.h ++++ b/screensaver-dialog/src/screensaver-dialog.h +@@ -37,6 +37,7 @@ class Interface; + + class QMenu; + class AuthProxy; ++class VirtualKeyboard; + class ScreenSaverDialog : public QWidget, public Kiran::ScreenSaver::LockerInterface + { + Q_OBJECT +@@ -112,6 +113,9 @@ private: + Kiran::AuthType m_authType = Kiran::AUTH_TYPE_PASSWD; + bool m_havePrompt = false; + QString m_userName; ++#ifdef VIRTUAL_KEYBOARD ++ VirtualKeyboard *m_keyboard = nullptr; ++#endif + }; + + #endif // WIDGET_H +-- +2.33.0 + diff --git a/0006-fix-screensaver-dialog-Fix-the-zombie-process-caused.patch b/0006-fix-screensaver-dialog-Fix-the-zombie-process-caused.patch new file mode 100644 index 0000000000000000000000000000000000000000..726ae24565584573740ca2b6e34a85e2aceeb223 --- /dev/null +++ b/0006-fix-screensaver-dialog-Fix-the-zombie-process-caused.patch @@ -0,0 +1,31 @@ +From 1f3d5e1f2378a71ec8c5c75abb388059bc17d182 Mon Sep 17 00:00:00 2001 +From: liuxinhao +Date: Fri, 9 Dec 2022 11:00:15 +0800 +Subject: [PATCH 6/6] fix(screensaver-dialog): Fix the zombie process caused by + waitpid reclaiming that the authentication process is not blocked after the + command is invoked in the unlock box +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +修复在解锁框调用命令解锁后,waitpid回收认证进程未阻塞导致的僵尸进程 +--- + lib/auth-proxy/auth-pam.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/auth-proxy/auth-pam.cpp b/lib/auth-proxy/auth-pam.cpp +index 3c2bcda..61feae6 100644 +--- a/lib/auth-proxy/auth-pam.cpp ++++ b/lib/auth-proxy/auth-pam.cpp +@@ -139,7 +139,7 @@ void AuthPam::cancelAuthentication() + if (m_authPid != 0) + { + kill(m_authPid, SIGKILL); +- waitpid(m_authPid, nullptr, WNOHANG); ++ waitpid(m_authPid, nullptr, 0); + m_authPid = 0; + } + +-- +2.33.0 + diff --git a/kiran-session-guard.spec b/kiran-session-guard.spec index ea8f12b5cc0b6e190369f0673c17a1cd79120fa0..8ea096acbc791e5603ce28dda353537e9dbb4427 100644 --- a/kiran-session-guard.spec +++ b/kiran-session-guard.spec @@ -1,6 +1,6 @@ Name: kiran-session-guard Version: 2.4.0 -Release: 3 +Release: 4 Summary: Kiran desktop environment login and lock screen dialog Summary(zh_CN): Kiran桌面环境登录和解锁框 @@ -8,7 +8,11 @@ License: MulanPSL-2.0 Source0: %{name}-%{version}.tar.gz Patch01: 0001-fix-CVE-PAM-authorization-bypass-due-to-incorrect-us.patch -Patch02: 0001-fix-user-icon-fix-the-failure-to-update-the-drawing-.patch +Patch02: 0002-fix-user-icon-fix-the-failure-to-update-the-drawing-.patch +Patch03: 0003-fix-virtualkeyboard-Invoke-virtual-keyboard-initiali.patch +Patch04: 0004-fix-SIGTERM-Processing-Use-socket-to-notify-SIGTERM-.patch +Patch05: 0005-fix-Locker-VirtualKeyboard-unlock-interface-calls-on.patch +Patch06: 0006-fix-screensaver-dialog-Fix-the-zombie-process-caused.patch %define SHOW_VIRTUAL_KEYBOARD 0 @@ -136,6 +140,12 @@ gtk-update-icon-cache -f /usr/share/icons/hicolor/ rm -rf %{buildroot} %changelog +* Fri Dec 09 2022 liuxinhao - 2.4.0-4 +- KYOS-F: Fix the zombie process caused by waitpid reclaiming that the authentication process is not blocked after the command is invoked in the unlock box +- KYOS-F: unlock interface calls onboard, and the onboard process cycle is consistent with the unlock interface +- KYOS-F: Use socket to notify SIGTERM signal, and process SIGTERM signal in the main thread to avoid abnormal exit +- KYOS-F: Invoke virtual keyboard initialization during plug-in initialization + * Fri Nov 18 2022 liuxinhao - 2.4.0-3 - KYOS-F: fix the failure to update the drawing in time when setting the default avatar(#I61QHP)