Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package deepin-polkit-agent for 
openSUSE:Factory checked in at 2022-09-01 22:10:21
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/deepin-polkit-agent (Old)
 and      /work/SRC/openSUSE:Factory/.deepin-polkit-agent.new.2083 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "deepin-polkit-agent"

Thu Sep  1 22:10:21 2022 rev:5 rq:1000253 version:5.5.21

Changes:
--------
--- /work/SRC/openSUSE:Factory/deepin-polkit-agent/deepin-polkit-agent.changes  
2022-04-22 21:55:02.778860149 +0200
+++ 
/work/SRC/openSUSE:Factory/.deepin-polkit-agent.new.2083/deepin-polkit-agent.changes
        2022-09-01 22:11:21.608275175 +0200
@@ -1,0 +2,14 @@
+Fri Aug 26 03:21:03 UTC 2022 - Hillwood Yang <[email protected]>
+
+- Update version to 5.5.21
+  * Fix bugs 
+- Drop polkit-qt5.patch, merged
+
+-------------------------------------------------------------------
+Thu Jun 30 08:53:22 UTC 2022 - Hillwood Yang <[email protected]>
+
+- Update version to 5.5.19
+  * Fix bugs
+  * Update translations
+
+-------------------------------------------------------------------

Old:
----
  dde-polkit-agent-5.5.7.tar.gz
  polkit-qt5.patch

New:
----
  dde-polkit-agent-5.5.21.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ deepin-polkit-agent.spec ++++++
--- /var/tmp/diff_new_pack.VBQVGw/_old  2022-09-01 22:11:22.148276652 +0200
+++ /var/tmp/diff_new_pack.VBQVGw/_new  2022-09-01 22:11:22.148276652 +0200
@@ -19,15 +19,13 @@
 %define _name dde-polkit-agent
 
 Name:           deepin-polkit-agent
-Version:        5.5.7
+Version:        5.5.21
 Release:        0
 Summary:        Deepin Polkit Agent
 License:        GPL-3.0-or-later
 Group:          System/GUI/Other
 URL:            https://github.com/linuxdeepin/dde-polkit-agent
 Source0:        
https://github.com/linuxdeepin/dde-polkit-agent/archive/%{version}/%{_name}-%{version}.tar.gz
-# 
https://github.com/deepincn/repo/blob/master/deepincn/git/deepin-polkit-agent-git/fix.patch
-Patch0:         polkit-qt5.patch
 BuildRequires:  dtkcore
 BuildRequires:  libqt5-linguist
 BuildRequires:  pkgconfig(Qt5Concurrent)

++++++ dde-polkit-agent-5.5.7.tar.gz -> dde-polkit-agent-5.5.21.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/dde-polkit-agent-5.5.7/.github/workflows/backup-to-gitlab.yml 
new/dde-polkit-agent-5.5.21/.github/workflows/backup-to-gitlab.yml
--- old/dde-polkit-agent-5.5.7/.github/workflows/backup-to-gitlab.yml   
1970-01-01 01:00:00.000000000 +0100
+++ new/dde-polkit-agent-5.5.21/.github/workflows/backup-to-gitlab.yml  
2022-08-12 03:41:22.000000000 +0200
@@ -0,0 +1,52 @@
+name: backup to gitlab
+on: [push]
+
+concurrency:
+  group: ${{ github.workflow }}
+  cancel-in-progress: true
+
+jobs:
+  backup-to-gitlab:
+    if: github.repository_owner == 'linuxdeepin'
+    name: backup-to-gitlab
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v2
+        with:
+          repository: "linuxdeepin/jenkins-bridge-client"
+          path: jenkins-bridge-client
+
+      - name: Install Client
+        run: |
+          cd $GITHUB_WORKSPACE/jenkins-bridge-client
+          go build .
+          sudo install -Dvm755 jenkins-bridge-client -t /usr/bin/
+      - name: Trigger sync
+        id: generate-runid
+        run: |
+          echo "::set-output name=RUN_ID::$(jenkins-bridge-client -triggerSync 
-token '${{ secrets.BRIDGETOKEN }}')"
+      - name: Print log
+        run: |
+          jenkins-bridge-client -printlog -token "${{ secrets.BRIDGETOKEN }}" 
-runid "${{ steps.generate-runid.outputs.RUN_ID }}"
+
+  backup-to-gitee:
+    if: github.repository_owner == 'linuxdeepin'
+    runs-on: ubuntu-latest
+    steps:
+      - name: create-repo
+        run: |
+          repo=${{ github.event.repository.name }}
+          homepage="https://github.com/linuxdeepin/${repo}";
+          description="mirror of ${homepage}"
+          # remove '.' prefix
+          repo=${repo#"."}
+          curl -X POST --header 'Content-Type: application/json;charset=UTF-8' 
'https://gitee.com/api/v5/enterprises/linuxdeepin/repos' -d '{"private": 
1,"access_token":"${{ secrets.GITEE_SYNC_TOKEN 
}}","name":"'"$repo"'","description":"'"$description"'","homepage":"'"$homepage"'","has_issues":"false","has_wiki":"false","can_comment":"false"}'
 || true
+      - name: push
+        run: |
+          git clone --bare https://github.com/linuxdeepin/${{ 
github.event.repository.name }}.git .git
+          repo=${{ github.event.repository.name }}
+          # remove '.' prefix
+          repo=${repo#"."}
+          git remote set-url origin https://myml:${{ secrets.GITEE_SYNC_TOKEN 
}}@gitee.com/linuxdeepin/${repo}.git
+          git push -f --all --prune origin
+          git push --tags origin
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/dde-polkit-agent-5.5.7/.github/workflows/call-build-deb.yml 
new/dde-polkit-agent-5.5.21/.github/workflows/call-build-deb.yml
--- old/dde-polkit-agent-5.5.7/.github/workflows/call-build-deb.yml     
1970-01-01 01:00:00.000000000 +0100
+++ new/dde-polkit-agent-5.5.21/.github/workflows/call-build-deb.yml    
2022-08-12 03:41:22.000000000 +0200
@@ -0,0 +1,17 @@
+name: Call build-deb
+on:
+  pull_request_target:
+    paths-ignore:
+      - ".github/workflows/**"
+    types: [ opened, closed, synchronize ]
+
+concurrency:
+  group: ${{ github.workflow }}-pull/${{ github.event.number }}
+  cancel-in-progress: true
+
+jobs:
+  check_job:
+    if: github.event.action != 'closed' || github.event.pull_request.merged
+    uses: linuxdeepin/.github/.github/workflows/build-deb.yml@master
+    secrets:
+      BridgeToken: ${{ secrets.BridgeToken }}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/dde-polkit-agent-5.5.7/.github/workflows/call-build-distribution.yml 
new/dde-polkit-agent-5.5.21/.github/workflows/call-build-distribution.yml
--- old/dde-polkit-agent-5.5.7/.github/workflows/call-build-distribution.yml    
1970-01-01 01:00:00.000000000 +0100
+++ new/dde-polkit-agent-5.5.21/.github/workflows/call-build-distribution.yml   
2022-08-12 03:41:22.000000000 +0200
@@ -0,0 +1,17 @@
+name: Call build-distribution
+on:
+  push:
+    paths-ignore:
+      - ".github/workflows/**"
+  pull_request_target:
+    paths-ignore:
+      - ".github/workflows/**"
+
+jobs:
+  check_job:
+    uses: linuxdeepin/.github/.github/workflows/build-distribution.yml@master
+    secrets:
+      BUILD_GPG_PRIVATE_KEY: ${{ secrets.BUILD_GPG_PRIVATE_KEY }}
+      BUILD_SSH_PRIVATE_KEY: ${{ secrets.BUILD_SSH_PRIVATE_KEY }}
+      WEBDAV_PASSWD: ${{ secrets.WEBDAV_PASSWD }}
+      WEBDAV_USER: ${{ secrets.WEBDAV_USER }}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/dde-polkit-agent-5.5.7/.github/workflows/call-chatOps.yml 
new/dde-polkit-agent-5.5.21/.github/workflows/call-chatOps.yml
--- old/dde-polkit-agent-5.5.7/.github/workflows/call-chatOps.yml       
1970-01-01 01:00:00.000000000 +0100
+++ new/dde-polkit-agent-5.5.21/.github/workflows/call-chatOps.yml      
2022-08-12 03:41:22.000000000 +0200
@@ -0,0 +1,10 @@
+name: chatOps
+on:
+  issue_comment:
+    types: [created]
+
+jobs:
+  chatopt:
+    uses: linuxdeepin/.github/.github/workflows/chatOps.yml@master
+    secrets:
+      APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/dde-polkit-agent-5.5.7/.github/workflows/call-clacheck.yml 
new/dde-polkit-agent-5.5.21/.github/workflows/call-clacheck.yml
--- old/dde-polkit-agent-5.5.7/.github/workflows/call-clacheck.yml      
1970-01-01 01:00:00.000000000 +0100
+++ new/dde-polkit-agent-5.5.21/.github/workflows/call-clacheck.yml     
2022-08-12 03:41:22.000000000 +0200
@@ -0,0 +1,16 @@
+name: Call CLA check
+on:
+  issue_comment:
+    types: [created]
+  pull_request_target:
+    types: [opened, closed, synchronize]
+
+concurrency:
+  group: ${{ github.workflow }}-pull/${{ github.event.number }}
+  cancel-in-progress: true
+
+jobs:
+  clacheck:
+    uses: linuxdeepin/.github/.github/workflows/cla-check.yml@master
+    secrets:
+      APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/dde-polkit-agent-5.5.7/.github/workflows/call-commitlint.yml 
new/dde-polkit-agent-5.5.21/.github/workflows/call-commitlint.yml
--- old/dde-polkit-agent-5.5.7/.github/workflows/call-commitlint.yml    
1970-01-01 01:00:00.000000000 +0100
+++ new/dde-polkit-agent-5.5.21/.github/workflows/call-commitlint.yml   
2022-08-12 03:41:22.000000000 +0200
@@ -0,0 +1,11 @@
+name: Call commitlint
+on:
+  pull_request_target:
+
+concurrency:
+  group: ${{ github.workflow }}-pull/${{ github.event.number }}
+  cancel-in-progress: true
+
+jobs:
+  check_job:
+    uses: linuxdeepin/.github/.github/workflows/commitlint.yml@master
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/dde-polkit-agent-5.5.7/.github/workflows/call-license-check.yml 
new/dde-polkit-agent-5.5.21/.github/workflows/call-license-check.yml
--- old/dde-polkit-agent-5.5.7/.github/workflows/call-license-check.yml 
1970-01-01 01:00:00.000000000 +0100
+++ new/dde-polkit-agent-5.5.21/.github/workflows/call-license-check.yml        
2022-08-12 03:41:22.000000000 +0200
@@ -0,0 +1,16 @@
+name: Call License and README Check
+on:
+  pull_request_target:
+    types: [opened, synchronize]
+
+permissions:
+  pull-requests: write
+  contents: read
+
+concurrency:
+  group: ${{ github.workflow }}-pull/${{ github.event.number }}
+  cancel-in-progress: true
+
+jobs:
+  license-check:
+    uses: linuxdeepin/.github/.github/workflows/license-check.yml@master
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/dde-polkit-agent-5.5.7/.github/workflows/cppcheck.yml 
new/dde-polkit-agent-5.5.21/.github/workflows/cppcheck.yml
--- old/dde-polkit-agent-5.5.7/.github/workflows/cppcheck.yml   1970-01-01 
01:00:00.000000000 +0100
+++ new/dde-polkit-agent-5.5.21/.github/workflows/cppcheck.yml  2022-08-12 
03:41:22.000000000 +0200
@@ -0,0 +1,26 @@
+name: cppcheck
+on:
+  pull_request_target:
+    paths-ignore:
+      - ".github/workflows/**"
+
+concurrency:
+  group: ${{ github.workflow }}-pull/${{ github.event.number }}
+  cancel-in-progress: true
+
+jobs:
+  cppchceck:
+    name: cppcheck
+    runs-on: ubuntu-latest
+    steps:
+      - run: export
+      - uses: actions/checkout@v2
+        with:
+          ref: ${{ github.event.pull_request.head.sha }}
+          persist-credentials: false
+      - uses: linuxdeepin/action-cppcheck@main
+        with:
+          github_token: ${{ secrets.GITHUB_TOKEN }}
+          repository: ${{ github.repository }}
+          pull_request_id: ${{ github.event.pull_request.number }}
+          allow_approve: false
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dde-polkit-agent-5.5.7/AuthDialog.cpp 
new/dde-polkit-agent-5.5.21/AuthDialog.cpp
--- old/dde-polkit-agent-5.5.7/AuthDialog.cpp   2022-02-09 10:15:09.000000000 
+0100
+++ new/dde-polkit-agent-5.5.21/AuthDialog.cpp  2022-08-12 03:41:22.000000000 
+0200
@@ -48,6 +48,7 @@
     , m_passwordInput(new DPasswordEdit(this))
     , m_numTries(0)
     , m_lockLimitTryNum(getLockLimitTryNum())
+    , m_authStatus(AuthStatus::None)
 {
     initUI();
 
@@ -105,10 +106,44 @@
     }
 }
 
+bool AuthDialog::hasSecurityHighLever(QString userName)
+{
+    bool re = false;
+    QDBusInterface securityEnhance("com.deepin.daemon.SecurityEnhance",
+                                   "/com/deepin/daemon/SecurityEnhance",
+                                   "com.deepin.daemon.SecurityEnhance",
+                                   QDBusConnection::systemBus());
+
+    QDBusReply<QString> reply = securityEnhance.call("GetSEUserByName", 
userName);
+    if(reply.isValid()){
+        QString value = reply.value();
+        re = (value == "sysadm_u");
+    }
+
+    return re;
+}
+
+bool AuthDialog::hasOpenSecurity()
+{
+    bool hasOpen = false;
+    QDBusInterface securityEnhance("com.deepin.daemon.SecurityEnhance",
+                            "/com/deepin/daemon/SecurityEnhance",
+                            "com.deepin.daemon.SecurityEnhance",
+                            QDBusConnection::systemBus());
+     QDBusReply<QString> reply = securityEnhance.call("Status");
+     if(reply.isValid()){
+         QString value = reply.value();
+         hasOpen = (value == "open");
+     }
+
+    return hasOpen;
+}
+
 void AuthDialog::createUserCB(const PolkitQt1::Identity::List &identities)
 {
     // Clears the combobox in the case some user be added
     m_adminsCombo->clear();
+    bool isOpen = hasOpenSecurity();
 
     // For each user
     foreach (const PolkitQt1::Identity &identity, identities) {
@@ -120,10 +155,24 @@
         QString username = identity.toString().remove("unix-user:");
         QString fullname = UsersManager::instance()->getFullName(username);
 
+        QString displayName = fullname.isEmpty() ? username : fullname;
+        if (passwordIsExpired(identity))
+            displayName += QString("(%1)").arg(tr("Expired"));
+        if (isOpen) {
+            if (hasSecurityHighLever(username) && identities.count() > 1) {
+                m_adminsCombo->clear();
+                if (username == qgetenv("USER"))
+                    m_adminsCombo->insertItem(0, displayName, 
identity.toString());
+                else
+                    m_adminsCombo->addItem(displayName, identity.toString());
+                break;
+            }
+        }
+
         if (username == qgetenv("USER"))
-            m_adminsCombo->insertItem(0, fullname.isEmpty() ? username : 
fullname, identity.toString());
+            m_adminsCombo->insertItem(0, displayName, identity.toString());
         else
-            m_adminsCombo->addItem(fullname.isEmpty() ? username : fullname, 
identity.toString());
+            m_adminsCombo->addItem(displayName, identity.toString());
     }
     if (m_adminsCombo->count() > 0) {
         m_adminsCombo->setCurrentIndex(0); // select the current user.
@@ -133,6 +182,24 @@
     m_adminsCombo->show();
 }
 
+// ???????????????????????????????????????
+bool AuthDialog::passwordIsExpired(PolkitQt1::Identity identity)
+{
+    QDBusInterface accounts("com.deepin.daemon.Accounts", 
"/com/deepin/daemon/Accounts", "com.deepin.daemon.Accounts", 
QDBusConnection::systemBus());
+    QDBusReply<QString> reply = accounts.call("FindUserById", 
QString::number(identity.toUnixUserIdentity().uid()));
+    if (reply.isValid()) {
+        const QString path = reply.value();
+        if (!path.isEmpty()) {
+            QDBusInterface accounts_user("com.deepin.daemon.Accounts", path, 
"com.deepin.daemon.Accounts.User", QDBusConnection::systemBus());
+            QDBusReply<bool> expiredReply = 
accounts_user.call("IsPasswordExpired");
+            if (expiredReply.isValid())
+                return expiredReply.value();
+        }
+    }
+
+    return false;
+}
+
 PolkitQt1::Identity AuthDialog::selectedAdminUser() const
 {
     if (m_adminsCombo->currentIndex() == -1)
@@ -167,6 +234,7 @@
     // ??????????????????????????????????????????
     m_passwordInput->clear();
     m_passwordInput->setAlert(false);
+    m_passwordInput->lineEdit()->setPlaceholderText("");
     m_errorMsg = "";
     m_numTries = 0;
 
@@ -175,32 +243,16 @@
         // ??????????????????
         m_passwordInput->setEnabled(false);
     } else {
-        // ???????????????????????????????????????
-        QDBusInterface accounts("com.deepin.daemon.Accounts", 
"/com/deepin/daemon/Accounts", "com.deepin.daemon.Accounts", 
QDBusConnection::systemBus());
-        QString path;
-        QDBusReply<QString> reply = accounts.call("FindUserById", 
QString::number(identity.toUnixUserIdentity().uid()));
-        if (reply.isValid()) {
-            path = reply.value();
-        }
-
-        bool passwordIsExpired = false;
-
-        if (!path.isEmpty()) {
-            QDBusInterface accounts_user("com.deepin.daemon.Accounts", path, 
"com.deepin.daemon.Accounts.User", QDBusConnection::systemBus());
-            QDBusReply<bool> reply = accounts_user.call("IsPasswordExpired");
-            if (reply.isValid()) {
-                passwordIsExpired = reply.value();
-            }
-        }
-
         // ?????????????????????
-        if (passwordIsExpired) {
+        if (passwordIsExpired(identity)) {
             m_passwordInput->setEnabled(false);
+            m_passwordInput->lineEdit()->setPlaceholderText(tr("Unavailable"));
             // 
???????????????????????????????????????????????????????????????????????????
-            setError(tr("You are required to change your password immediately 
(password expired)"), true);
+            setError(tr("The password of this user has expired. Please 
authenticate using another user account or change the password and try 
again."), true);
         } else {
             // ??????????????????
             m_passwordInput->setEnabled(true);
+            m_passwordInput->hideAlertMessage();
             // We need this to restart the auth with the new user
             emit adminUserSelected(identity);
             // git password label focus
@@ -307,7 +359,7 @@
     });
 
     connect(m_passwordInput, &DPasswordEdit::textChanged, [ = ](const QString 
& text) {
-        getButton(confirmId)->setEnabled(text.length() > 0);
+        getButton(confirmId)->setEnabled(text.length() > 0 && Authenticating 
!= m_authStatus && None != m_authStatus);
         if (text.length() == 0)
             return;
 
@@ -315,3 +367,9 @@
         m_errorMsg = "";
     });
 }
+
+void AuthDialog::setInAuth(AuthStatus authStatus)
+{
+    m_authStatus = authStatus;
+    getButton(1)->setEnabled(Authenticating != authStatus && 
m_passwordInput->text().length() > 0);
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dde-polkit-agent-5.5.7/AuthDialog.h 
new/dde-polkit-agent-5.5.21/AuthDialog.h
--- old/dde-polkit-agent-5.5.7/AuthDialog.h     2022-02-09 10:15:09.000000000 
+0100
+++ new/dde-polkit-agent-5.5.21/AuthDialog.h    2022-08-12 03:41:22.000000000 
+0200
@@ -48,6 +48,13 @@
         Password = 1
     };
 
+    enum AuthStatus {
+        None = -1,
+        WaitingInput,
+        Authenticating,
+        Completed,
+    };
+
     AuthDialog(const QString &message,
                const QString &iconName);
     ~AuthDialog();
@@ -66,12 +73,17 @@
 
     PolkitQt1::Identity selectedAdminUser() const;
 
+    bool hasOpenSecurity();
+    bool hasSecurityHighLever(QString userName);
+    void setInAuth(AuthStatus authStatus);
+
 signals:
     void adminUserSelected(PolkitQt1::Identity);
 
 private:
     void initUI();
     int getLockLimitTryNum();
+    bool passwordIsExpired(PolkitQt1::Identity identity);
 
 private slots:
     void on_userCB_currentIndexChanged(int index);
@@ -91,5 +103,6 @@
     void showErrorTip();
 
     QString m_errorMsg;
+    AuthStatus m_authStatus;
 };
 #endif // AUTHDIALOG_H
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dde-polkit-agent-5.5.7/CMakeLists.txt 
new/dde-polkit-agent-5.5.21/CMakeLists.txt
--- old/dde-polkit-agent-5.5.7/CMakeLists.txt   2022-02-09 10:15:09.000000000 
+0100
+++ new/dde-polkit-agent-5.5.21/CMakeLists.txt  2022-08-12 03:41:22.000000000 
+0200
@@ -2,7 +2,7 @@
 
 set(BIN_NAME dde-polkit-agent)
 
-project(${BIN_NAME})
+project(${BIN_NAME} CXX)
 
 #set(CMAKE_VERBOSE_MAKEFILE ON)
 set(CMAKE_CXX_STANDARD 14)
@@ -12,7 +12,9 @@
 set(CMAKE_CXX_FLAGS "-g -Wall")
 
 # ????????????????????????
-ADD_DEFINITIONS("-fstack-protector-strong -D_FORTITY_SOURCE=1 -z noexecstack 
-pie -fPIC -z lazy")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstack-protector-all")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-protector-all")
+set(CMAKE_EXE_LINKER_FLAGS  "-z relro -z now -z noexecstack -pie")
 
 if (CMAKE_BUILD_TYPE STREQUAL "Debug")
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -fsanitize=address -O2")
@@ -57,6 +59,20 @@
     -N
 )
 
+# test deepin-polkit
+try_compile(DEEPIN_POLKIT_TEST
+              ${CMAKE_CURRENT_BINARY_DIR}/try_compile
+            SOURCES
+              ${CMAKE_CURRENT_SOURCE_DIR}/tests/polkit.cc
+            LINK_LIBRARIES
+              ${Polkit-qt5_LIBRARIES}
+              Qt5::Core
+)
+
+if (DEEPIN_POLKIT_TEST)
+    add_definitions(-DUSE_DEEPIN_POLKIT)
+endif()
+
 set(AuthAgent_DBUS_SCRS
     ${CMAKE_CURRENT_BINARY_DIR}/polkit1authagent_adaptor.h
     ${CMAKE_CURRENT_BINARY_DIR}/polkit1authagent_adaptor.cpp
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dde-polkit-agent-5.5.7/archlinux/PKGBUILD 
new/dde-polkit-agent-5.5.21/archlinux/PKGBUILD
--- old/dde-polkit-agent-5.5.7/archlinux/PKGBUILD       1970-01-01 
01:00:00.000000000 +0100
+++ new/dde-polkit-agent-5.5.21/archlinux/PKGBUILD      2022-08-12 
03:41:22.000000000 +0200
@@ -0,0 +1,30 @@
+# Maintainer: justforlxz <[email protected]>
+pkgname=deepin-polkit-agent-git
+pkgver=5.5.19.r1.gc3af637
+pkgrel=1
+pkgdesc='Deepin Polkit Agent'
+arch=('x86_64' 'aarch64')
+url="https://github.com/linuxdeepin/dde-polkit-agent";
+license=('GPL3')
+depends=('deepin-qt-dbus-factory-git' 'startdde-git' 'polkit-qt5' 
'dtkwidget-git')
+makedepends=('git' 'polkit-qt5' 'dtkcommon-git' 'dtkwidget-git' 'cmake' 
'ninja')
+conflicts=('deepin-polkit-agent')
+provides=('deepin-polkit-agent')
+groups=('deepin-git')
+source=("source.tar.gz")
+sha512sums=('SKIP')
+
+prepare() {
+    cd $deepin_source_name
+}
+
+build() {
+  cd $deepin_source_name
+  cmake . -G Ninja -DCMAKE_INSTALL_PREFIX=/usr
+  ninja
+}
+
+package() {
+  cd $deepin_source_name
+  DESTDIR="$pkgdir" ninja install
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dde-polkit-agent-5.5.7/debian/changelog 
new/dde-polkit-agent-5.5.21/debian/changelog
--- old/dde-polkit-agent-5.5.7/debian/changelog 2022-02-09 10:15:09.000000000 
+0100
+++ new/dde-polkit-agent-5.5.21/debian/changelog        2022-08-12 
03:41:22.000000000 +0200
@@ -1,4 +1,4 @@
-dde-polkit-agent (1.0-1) unstable; urgency=medium
+dde-polkit-agent (1.0) unstable; urgency=medium
 
   * Initial release
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dde-polkit-agent-5.5.7/debian/control 
new/dde-polkit-agent-5.5.21/debian/control
--- old/dde-polkit-agent-5.5.7/debian/control   2022-02-09 10:15:09.000000000 
+0100
+++ new/dde-polkit-agent-5.5.21/debian/control  2022-08-12 03:41:22.000000000 
+0200
@@ -5,7 +5,7 @@
 Build-Depends: debhelper (>=9),
        pkg-config,
        cmake,
-       libpolkit-qt5-1-dev (>> 5.0.0.2),
+       libpolkit-qt5-1-dev,
        libdtkwidget-dev,
        qttools5-dev-tools,
        libdframeworkdbus-dev
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dde-polkit-agent-5.5.7/debian/rules 
new/dde-polkit-agent-5.5.21/debian/rules
--- old/dde-polkit-agent-5.5.7/debian/rules     2022-02-09 10:15:09.000000000 
+0100
+++ new/dde-polkit-agent-5.5.21/debian/rules    2022-08-12 03:41:22.000000000 
+0200
@@ -4,4 +4,3 @@
 
 %:
        dh $@ 
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dde-polkit-agent-5.5.7/policykitlistener.cpp 
new/dde-polkit-agent-5.5.21/policykitlistener.cpp
--- old/dde-polkit-agent-5.5.7/policykitlistener.cpp    2022-02-09 
10:15:09.000000000 +0100
+++ new/dde-polkit-agent-5.5.21/policykitlistener.cpp   2022-08-12 
03:41:22.000000000 +0200
@@ -32,6 +32,7 @@
 #include "AuthDialog.h"
 #include "polkit1authagent_adaptor.h"
 #include "pluginmanager.h"
+#include "policykitlistener.h"
 
 #define USE_DEEPIN_AUTH "useDeepinAuth"
 
@@ -107,12 +108,6 @@
     m_dialog = new AuthDialog(message, iconName);
     m_dialog->setAttribute(Qt::WA_DeleteOnClose);
     initDialog(actionId);
-
-    if (identities.length() == 1) {
-        createSessionForId(identities[0]);
-    } else {
-        createSessionForId(m_dialog.data()->selectedAdminUser());
-    }
 }
 
 void PolicyKitListener::initDialog(const QString &actionId)
@@ -188,9 +183,10 @@
 
     qDebug() << "session request: " << request;
 
-    if (m_dialog && !request.isEmpty())
+    if (m_dialog && !request.isEmpty()) {
         m_dialog.data()->setAuthInfo(request);
-
+        m_dialog.data()->setInAuth(AuthDialog::WaitingInput);
+    }
 }
 
 void PolicyKitListener::completed(bool gainedAuthorization)
@@ -202,10 +198,13 @@
         m_gainedAuthorization = true;
     m_showInfoSuccess = false;
 
+#ifdef USE_DEEPIN_POLKIT
     if (m_exAuth) {
         m_session.data()->authCtrl(AUTH_CLOSE, -1);
     }
+#endif
     finishObtainPrivilege();
+    m_dialog.data()->setInAuth(AuthDialog::Completed);
 }
 
 void PolicyKitListener::showError(const QString &text)
@@ -242,13 +241,16 @@
     m_exAuth = true;
     m_isMfa = isMfa;
 
+#ifdef USE_DEEPIN_POLKIT
     if (!isMfa) {
         m_session.data()->authCtrl(AUTH_START, -1);
     }
+#endif
 }
 
 void PolicyKitListener::dialogAccepted()
 {
+    m_dialog.data()->setInAuth(AuthDialog::Authenticating);
     m_session->setResponse(m_dialog->password());
 }
 
@@ -271,7 +273,11 @@
     }
     // We will create new session only when some user is selected
     if (m_selectedUser.isValid()) {
+#ifdef USE_DEEPIN_POLKIT
         m_session = new Session(m_selectedUser, m_cookie, m_result, 
&m_details);
+#else
+        m_session = new Session(m_selectedUser, m_cookie, m_result);
+#endif
 
         connect(m_session.data(), &Session::request, this,
                 &PolicyKitListener::request);
@@ -281,11 +287,12 @@
                 &PolicyKitListener::showError);
         connect(m_session.data(), &Session::showInfo, this,
                 &PolicyKitListener::showInfo);
+#ifdef USE_DEEPIN_POLKIT
         connect(m_session.data(), &Session::exAuthStatus, this,
                 &PolicyKitListener::exAuthStatus);
         connect(m_session.data(), &Session::exAuthInfo, this,
                 &PolicyKitListener::exAuthInfo);
-
+#endif
         m_session->initiate();
     }
 }
@@ -294,14 +301,22 @@
 {
     if (!m_session.isNull()) {
         if (m_wasCancelled) {
+#ifdef USE_DEEPIN_POLKIT
             m_session.data()->result()->setCancel("aciton cancel");
+#else
+            m_session->result()->setError("action cancel");
+#endif
         } else if (!m_gainedAuthorization) {
             m_session.data()->result()->setError("password error");
         }
         m_session.data()->result()->setCompleted();
     } else {
         if (m_wasCancelled) {
+#ifdef USE_DEEPIN_POLKIT
             m_result->setCancel("action cancel");
+#else
+            m_result->setError("action cancel");
+#endif
         } else if (!m_gainedAuthorization) {
             m_result->setError("password error");
         }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dde-polkit-agent-5.5.7/rpm/dde-polkit-agent.spec 
new/dde-polkit-agent-5.5.21/rpm/dde-polkit-agent.spec
--- old/dde-polkit-agent-5.5.7/rpm/dde-polkit-agent.spec        2022-02-09 
10:15:09.000000000 +0100
+++ new/dde-polkit-agent-5.5.21/rpm/dde-polkit-agent.spec       2022-08-12 
03:41:22.000000000 +0200
@@ -16,6 +16,7 @@
 URL:            https://github.com/linuxdeepin/dde-polkit-agent
 Source0:        %{name}-%{version}.orig.tar.xz
 
+BuildRequires:  cmake
 BuildRequires:  gcc-c++
 BuildRequires:  dtkwidget-devel >= 5.1.1
 #BuildRequires:  pkgconfig(dframeworkdbus) >= 2.0
@@ -44,7 +45,8 @@
 sed -i 's|lrelease|lrelease-qt5|' translate_generation.sh
 
 %build
-%qmake_qt5 PREFIX=%{_prefix}
+export PATH=%{_qt5_bindir}:$PATH
+%cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} -DARCHITECTURE=%{_arch} .
 %make_build
 
 %install
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dde-polkit-agent-5.5.7/tests/polkit.cc 
new/dde-polkit-agent-5.5.21/tests/polkit.cc
--- old/dde-polkit-agent-5.5.7/tests/polkit.cc  1970-01-01 01:00:00.000000000 
+0100
+++ new/dde-polkit-agent-5.5.21/tests/polkit.cc 2022-08-12 03:41:22.000000000 
+0200
@@ -0,0 +1,17 @@
+#include <QString>
+#include <polkit-qt5-1/PolkitQt1/Agent/Listener>
+#include <polkit-qt5-1/PolkitQt1/Agent/Session>
+
+int main(int argc, char* argv[])
+{
+    PolkitQt1::Identity            identity;
+    const QString                  cookie;
+    PolkitQt1::Agent::AsyncResult* result  = nullptr;
+    PolkitQt1::Details*            details = nullptr;
+    auto session = new PolkitQt1::Agent::Session(identity, cookie, result, 
details);
+
+    session->authCtrl(AUTH_START, -1);
+    session->setResponseEx(0, cookie);
+
+    return 0;
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/dde-polkit-agent-5.5.7/translations/dde-polkit-agent.ts 
new/dde-polkit-agent-5.5.21/translations/dde-polkit-agent.ts
--- old/dde-polkit-agent-5.5.7/translations/dde-polkit-agent.ts 2022-02-09 
10:15:09.000000000 +0100
+++ new/dde-polkit-agent-5.5.21/translations/dde-polkit-agent.ts        
2022-08-12 03:41:22.000000000 +0200
@@ -12,29 +12,39 @@
         <translation>Verification failed, two chances left</translation>
     </message>
     <message>
-        <location filename="../AuthDialog.cpp" line="88"/>
-        <location filename="../AuthDialog.cpp" line="266"/>
+        <location filename="../AuthDialog.cpp" line="90"/>
+        <location filename="../AuthDialog.cpp" line="327"/>
         <source>Confirm</source>
         <comment>button</comment>
         <translation>Confirm</translation>
     </message>
     <message>
-        <location filename="../AuthDialog.cpp" line="189"/>
-        <source>You are required to change your password immediately (password 
expired)</source>
-        <translation>You are required to change your password immediately 
(password expired)</translation>
+        <location filename="../AuthDialog.cpp" line="159"/>
+        <source>Expired</source>
+        <translation>Expired</translation>
     </message>
     <message>
-        <location filename="../AuthDialog.cpp" line="226"/>
+        <location filename="../AuthDialog.cpp" line="248"/>
+        <source>Unavailable</source>
+        <translation>Unavailable</translation>
+    </message>
+    <message>
+        <location filename="../AuthDialog.cpp" line="250"/>
+        <source>The password of this user has expired. Please authenticate 
using another user account or change the password and try again.</source>
+        <translation>The password of this user has expired. Please 
authenticate using another user account or change the password and try 
again.</translation>
+    </message>
+    <message>
+        <location filename="../AuthDialog.cpp" line="287"/>
         <source>Locked, please try again later</source>
         <translation>Locked, please try again later</translation>
     </message>
     <message>
-        <location filename="../AuthDialog.cpp" line="228"/>
+        <location filename="../AuthDialog.cpp" line="289"/>
         <source>Wrong password</source>
         <translation>Wrong password</translation>
     </message>
     <message>
-        <location filename="../AuthDialog.cpp" line="265"/>
+        <location filename="../AuthDialog.cpp" line="326"/>
         <source>Cancel</source>
         <comment>button</comment>
         <translation>Cancel</translation>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/dde-polkit-agent-5.5.7/translations/dde-polkit-agent_zh_CN.ts 
new/dde-polkit-agent-5.5.21/translations/dde-polkit-agent_zh_CN.ts
--- old/dde-polkit-agent-5.5.7/translations/dde-polkit-agent_zh_CN.ts   
2022-02-09 10:15:09.000000000 +0100
+++ new/dde-polkit-agent-5.5.21/translations/dde-polkit-agent_zh_CN.ts  
2022-08-12 03:41:22.000000000 +0200
@@ -12,29 +12,39 @@
         <translation>?????????????????????????????????2???</translation>
     </message>
     <message>
-        <location filename="../AuthDialog.cpp" line="88"/>
-        <location filename="../AuthDialog.cpp" line="266"/>
+        <location filename="../AuthDialog.cpp" line="90"/>
+        <location filename="../AuthDialog.cpp" line="327"/>
         <source>Confirm</source>
         <comment>button</comment>
         <translation>??? ???</translation>
     </message>
     <message>
-        <location filename="../AuthDialog.cpp" line="189"/>
-        <source>You are required to change your password immediately (password 
expired)</source>
-        <translation>?????????????????????????????????</translation>
+        <location filename="../AuthDialog.cpp" line="159"/>
+        <source>Expired</source>
+        <translation>?????????</translation>
     </message>
     <message>
-        <location filename="../AuthDialog.cpp" line="226"/>
+        <location filename="../AuthDialog.cpp" line="248"/>
+        <source>Unavailable</source>
+        <translation>?????????</translation>
+    </message>
+    <message>
+        <location filename="../AuthDialog.cpp" line="250"/>
+        <source>The password of this user has expired. Please authenticate 
using another user account or change the password and try again.</source>
+        
<translation>?????????????????????????????????????????????????????????????????????????????????????????????</translation>
+    </message>
+    <message>
+        <location filename="../AuthDialog.cpp" line="287"/>
         <source>Locked, please try again later</source>
         <translation>???????????????????????????</translation>
     </message>
     <message>
-        <location filename="../AuthDialog.cpp" line="228"/>
+        <location filename="../AuthDialog.cpp" line="289"/>
         <source>Wrong password</source>
         <translation>????????????</translation>
     </message>
     <message>
-        <location filename="../AuthDialog.cpp" line="265"/>
+        <location filename="../AuthDialog.cpp" line="326"/>
         <source>Cancel</source>
         <comment>button</comment>
         <translation>??? ???</translation>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/dde-polkit-agent-5.5.7/translations/dde-polkit-agent_zh_HK.ts 
new/dde-polkit-agent-5.5.21/translations/dde-polkit-agent_zh_HK.ts
--- old/dde-polkit-agent-5.5.7/translations/dde-polkit-agent_zh_HK.ts   
2022-02-09 10:15:09.000000000 +0100
+++ new/dde-polkit-agent-5.5.21/translations/dde-polkit-agent_zh_HK.ts  
2022-08-12 03:41:22.000000000 +0200
@@ -12,29 +12,39 @@
         <translation>?????????????????????????????????2???</translation>
     </message>
     <message>
-        <location filename="../AuthDialog.cpp" line="88"/>
-        <location filename="../AuthDialog.cpp" line="266"/>
+        <location filename="../AuthDialog.cpp" line="90"/>
+        <location filename="../AuthDialog.cpp" line="327"/>
         <source>Confirm</source>
         <comment>button</comment>
         <translation>??? ???</translation>
     </message>
     <message>
-        <location filename="../AuthDialog.cpp" line="189"/>
-        <source>You are required to change your password immediately (password 
expired)</source>
-        <translation>?????????????????????????????????</translation>
+        <location filename="../AuthDialog.cpp" line="159"/>
+        <source>Expired</source>
+        <translation>?????????</translation>
     </message>
     <message>
-        <location filename="../AuthDialog.cpp" line="226"/>
+        <location filename="../AuthDialog.cpp" line="248"/>
+        <source>Unavailable</source>
+        <translation>?????????</translation>
+    </message>
+    <message>
+        <location filename="../AuthDialog.cpp" line="250"/>
+        <source>The password of this user has expired. Please authenticate 
using another user account or change the password and try again.</source>
+        
<translation>?????????????????????????????????????????????????????????????????????????????????????????????</translation>
+    </message>
+    <message>
+        <location filename="../AuthDialog.cpp" line="287"/>
         <source>Locked, please try again later</source>
         <translation>???????????????????????????</translation>
     </message>
     <message>
-        <location filename="../AuthDialog.cpp" line="228"/>
+        <location filename="../AuthDialog.cpp" line="289"/>
         <source>Wrong password</source>
         <translation>????????????</translation>
     </message>
     <message>
-        <location filename="../AuthDialog.cpp" line="265"/>
+        <location filename="../AuthDialog.cpp" line="326"/>
         <source>Cancel</source>
         <comment>button</comment>
         <translation>??? ???</translation>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/dde-polkit-agent-5.5.7/translations/dde-polkit-agent_zh_TW.ts 
new/dde-polkit-agent-5.5.21/translations/dde-polkit-agent_zh_TW.ts
--- old/dde-polkit-agent-5.5.7/translations/dde-polkit-agent_zh_TW.ts   
2022-02-09 10:15:09.000000000 +0100
+++ new/dde-polkit-agent-5.5.21/translations/dde-polkit-agent_zh_TW.ts  
2022-08-12 03:41:22.000000000 +0200
@@ -12,29 +12,39 @@
         <translation>?????????????????????????????????2???</translation>
     </message>
     <message>
-        <location filename="../AuthDialog.cpp" line="88"/>
-        <location filename="../AuthDialog.cpp" line="266"/>
+        <location filename="../AuthDialog.cpp" line="90"/>
+        <location filename="../AuthDialog.cpp" line="327"/>
         <source>Confirm</source>
         <comment>button</comment>
         <translation>??? ???</translation>
     </message>
     <message>
-        <location filename="../AuthDialog.cpp" line="189"/>
-        <source>You are required to change your password immediately (password 
expired)</source>
-        <translation>?????????????????????????????????</translation>
+        <location filename="../AuthDialog.cpp" line="159"/>
+        <source>Expired</source>
+        <translation>?????????</translation>
     </message>
     <message>
-        <location filename="../AuthDialog.cpp" line="226"/>
+        <location filename="../AuthDialog.cpp" line="248"/>
+        <source>Unavailable</source>
+        <translation>?????????</translation>
+    </message>
+    <message>
+        <location filename="../AuthDialog.cpp" line="250"/>
+        <source>The password of this user has expired. Please authenticate 
using another user account or change the password and try again.</source>
+        
<translation>?????????????????????????????????????????????????????????????????????????????????????????????</translation>
+    </message>
+    <message>
+        <location filename="../AuthDialog.cpp" line="287"/>
         <source>Locked, please try again later</source>
         <translation>???????????????????????????</translation>
     </message>
     <message>
-        <location filename="../AuthDialog.cpp" line="228"/>
+        <location filename="../AuthDialog.cpp" line="289"/>
         <source>Wrong password</source>
         <translation>????????????</translation>
     </message>
     <message>
-        <location filename="../AuthDialog.cpp" line="265"/>
+        <location filename="../AuthDialog.cpp" line="326"/>
         <source>Cancel</source>
         <comment>button</comment>
         <translation>??? ???</translation>

Reply via email to