!21 lightdm服务报错且部分组件报错

From: @dwl301 
Reviewed-by: @weidongkl 
Signed-off-by: @weidongkl
This commit is contained in:
openeuler-ci-bot 2022-02-24 07:12:17 +00:00 committed by Gitee
commit bdf0ee274a
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 149 additions and 3 deletions

View File

@ -0,0 +1,42 @@
From 817fea974287bdea8686ced43f708531148d98bc Mon Sep 17 00:00:00 2001
From: liuxinhao <liuxinhao@kylinos.com.cn>
Date: Tue, 25 Jan 2022 15:41:57 +0800
Subject: [PATCH] fix(translator): fixed the issue that lightdm's PAM messages
were not translated
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 修复lightdm返回的PAM消息未经过翻译并将翻译指定为UTF-8编码避免lightdm-qt5接口之中乱码问题
Signed-off-by: liuxinhao <liuxinhao@kylinos.com.cn>
---
src/lightdm.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/lightdm.c b/src/lightdm.c
index 81b9117..2df2f9f 100644
--- a/src/lightdm.c
+++ b/src/lightdm.c
@@ -20,6 +20,7 @@
#include <fcntl.h>
#include <sys/stat.h>
#include <errno.h>
+#include <locale.h>
#include "configuration.h"
#include "display-manager.h"
@@ -551,6 +552,10 @@ main (int argc, char **argv)
sigaction (SIGPIPE, &action, NULL);
sigaction (SIGHUP, &action, NULL);
+ setlocale(LC_CTYPE,"");
+ setlocale(LC_MESSAGES,"");
+ bind_textdomain_codeset("Linux-PAM", "UTF-8");
+
/* When lightdm starts sessions it needs to run itself in a new mode */
if (argc >= 2 && strcmp (argv[1], "--session-child") == 0)
return session_child_run (argc, argv);
--
2.18.1

View File

@ -0,0 +1,91 @@
From 60a7f41c675d0c99f697b1e2479feea0e78b9b0f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9B=B9=E5=A8=81?= <caowei@uniontech.com>
Date: Sat, 30 May 2020 14:35:45 +0800
Subject: [PATCH] dm-tool lock function patch
---
src/dm-tool.c | 60 +++++++++++++++++++++++++++++++++++++++++++--------
1 file changed, 51 insertions(+), 9 deletions(-)
diff --git a/src/dm-tool.c b/src/dm-tool.c
index 5060109..8190aa9 100644
--- a/src/dm-tool.c
+++ b/src/dm-tool.c
@@ -16,6 +16,41 @@
#include <glib/gi18n.h>
#include <gio/gio.h>
+#define LOCKFRONT_NAME "com.deepin.dde.lockFront"
+
+static int
+handle_call_lock_front()
+{
+ g_autoptr(GError) pLockError = NULL;
+ GDBusProxy *pLockFront = g_dbus_proxy_new_for_bus_sync(
+ G_BUS_TYPE_SESSION,
+ G_DBUS_PROXY_FLAGS_NONE,
+ NULL,
+ LOCKFRONT_NAME,
+ "/com/deepin/dde/lockFront",
+ LOCKFRONT_NAME,
+ NULL,
+ &pLockError);
+ if (!pLockFront)
+ {
+ g_printerr("something error happend. %s. %s, %d", LOCKFRONT_NAME, pLockError->message, pLockError->code);
+ return EXIT_FAILURE;
+ }
+ if (!g_dbus_proxy_call_sync(
+ pLockFront,
+ "Show",
+ g_variant_new("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ NULL,
+ &pLockError))
+ {
+ g_printerr("something error happend. %s. %s, %d", LOCKFRONT_NAME, pLockError->message, pLockError->code);
+ return EXIT_FAILURE;
+ }
+ return EXIT_SUCCESS;
+}
+
static GBusType bus_type = G_BUS_TYPE_SYSTEM;
static GDBusProxy *dm_proxy, *seat_proxy = NULL;
@@ -259,16 +294,23 @@ main (int argc, char **argv)
return EXIT_FAILURE;
}
- if (!g_dbus_proxy_call_sync (get_seat_proxy (),
- "Lock",
- g_variant_new ("()"),
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- NULL,
- &error))
+ if (g_file_test("/etc/deepin-version", G_FILE_TEST_EXISTS))
{
- g_printerr ("Unable to lock seat: %s\n", error->message);
- return EXIT_FAILURE;
+ return handle_call_lock_front();
+ }
+ else
+ {
+ if (!g_dbus_proxy_call_sync(get_seat_proxy(),
+ "Lock",
+ g_variant_new("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ NULL,
+ &error))
+ {
+ g_printerr("Unable to lock seat: %s\n", error->message);
+ return EXIT_FAILURE;
+ }
}
return EXIT_SUCCESS;
}
--
2.20.1

View File

@ -7,7 +7,7 @@
Name: lightdm Name: lightdm
Summary: A cross-desktop Display Manager Summary: A cross-desktop Display Manager
Version: 1.30.0 Version: 1.30.0
Release: 10 Release: 13
# library/bindings are LGPLv2 or LGPLv3, the rest GPLv3+ # library/bindings are LGPLv2 or LGPLv3, the rest GPLv3+
License: (LGPLv2 or LGPLv3) and GPLv3+ License: (LGPLv2 or LGPLv3) and GPLv3+
@ -40,6 +40,10 @@ Patch0: lightdm-1.25.1-disable_dmrc.patch
# UnionTech patchs # UnionTech patchs
Patch9001: 9001-multi-pipe-mode.patch Patch9001: 9001-multi-pipe-mode.patch
Patch9002: 9002-dm-tool-lock-function-patch.patch
# kylin
Patch1001: 1001-fix-translator-fixed-the-issue-that-lightdm-s-PAM-me.patch
BuildRequires: gettext BuildRequires: gettext
BuildRequires: gnome-common BuildRequires: gnome-common
@ -69,7 +73,7 @@ Requires: dbus-x11
%if 0%{?openEuler} %if 0%{?openEuler}
Requires: polkit-js-engine Requires: polkit-js-engine
%endif %endif
Requires: systemd Requires: systemd systemd-pam
Requires: xorg-x11-xinit Requires: xorg-x11-xinit
#Requires: (lightdm-greeter = 1.2 if xorg-x11-server-Xorg) #Requires: (lightdm-greeter = 1.2 if xorg-x11-server-Xorg)
@ -310,6 +314,15 @@ fi
%changelog %changelog
* Thu Feb 24 2022 Wenlong.Ding <wenlong.ding@turbolinux.com.cn> - 1.30.0-13
- Fixed the problem that lightdm.service start with not found systemd-pam.so error.
* Tue Jan 25 2022 liuxinhao <liuxinhao@kylinos.com.cn> - 1.30.0-12
- Fixed the problem that the PAM message returned by lightdm was not translated
* Mon Sep 13 2021 zhaoshuang <zhaoshuang@uniontech.com> - 1.30.0-11
- Add a uniontech patch to fix dm-tool
* Fri Jul 30 2021 zhaoshuang <zhaoshuang@uniontech.com> - 1.30.0-10 * Fri Jul 30 2021 zhaoshuang <zhaoshuang@uniontech.com> - 1.30.0-10
- Add a uniontech patch to support multi-pipe mode - Add a uniontech patch to support multi-pipe mode