From eeefec6745478ac6b14e3668b497c1778e1c9047d8ccc0c132a111cb68a96652 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Lie?= Date: Wed, 11 Sep 2019 10:13:53 +0000 Subject: [PATCH] Accepting request 730085 from home:zhangxiaofei:branches:GNOME:Factory - Add accountsservice-wtmp-io-improvements.patch: Backports that improve wtmp io performance (boo#1139487). - Refresh as-fate318433-prevent-same-account-multi-logins.patch. OBS-URL: https://build.opensuse.org/request/show/730085 OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/accountsservice?expand=0&rev=136 --- accountsservice-wtmp-io-improvements.patch | 34 ++++++++++++++ accountsservice.changes | 7 +++ accountsservice.spec | 3 ++ ...33-prevent-same-account-multi-logins.patch | 44 +++++-------------- 4 files changed, 56 insertions(+), 32 deletions(-) create mode 100644 accountsservice-wtmp-io-improvements.patch diff --git a/accountsservice-wtmp-io-improvements.patch b/accountsservice-wtmp-io-improvements.patch new file mode 100644 index 0000000..5ed78b6 --- /dev/null +++ b/accountsservice-wtmp-io-improvements.patch @@ -0,0 +1,34 @@ +From 64b11314ea71b5e22edf4d968347489c5d5acd01 Mon Sep 17 00:00:00 2001 +From: Ray Strode +Date: Thu, 9 May 2019 14:58:34 -0400 +Subject: [PATCH] data: don't send change updates for login-history + +The login-history property of user objects can be quite large. +If wtmp is changed frequently, that can lead to memory fragmentation +in clients. + +Furthermore, most clients never check login-history, so it's +wasted memory and wasted cpu. + +This commit disables change notification for that property. If +a client really needs to get updates, they can manually refresh +their cache when appropriate. +--- + data/org.freedesktop.Accounts.User.xml | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/data/org.freedesktop.Accounts.User.xml b/data/org.freedesktop.Accounts.User.xml +index 8d3fe1c..3b839a3 100644 +--- a/data/org.freedesktop.Accounts.User.xml ++++ b/data/org.freedesktop.Accounts.User.xml +@@ -812,6 +812,7 @@ + + + ++ + + + +-- +2.16.4 + diff --git a/accountsservice.changes b/accountsservice.changes index f77bc44..0c101e5 100644 --- a/accountsservice.changes +++ b/accountsservice.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed Sep 11 08:10:52 UTC 2019 - Felix Zhang + +- Add accountsservice-wtmp-io-improvements.patch: Backports that + improve wtmp io performance (boo#1139487). +- Refresh as-fate318433-prevent-same-account-multi-logins.patch. + ------------------------------------------------------------------- Wed May 29 21:28:30 UTC 2019 - Bjørn Lie diff --git a/accountsservice.spec b/accountsservice.spec index e70d5d1..e2e2d31 100644 --- a/accountsservice.spec +++ b/accountsservice.spec @@ -32,6 +32,8 @@ Patch0: accountsservice-sysconfig.patch Patch1: accountsservice-filter-suse-accounts.patch # PATCH-FIX-UPSTREAM accountsservice-read-root-user-cache.patch bsc#1114292 glfo#accountsservice/accountsservice#65 xwang@suse.com-- read root user cache file WAS PATCH-FIX-UPSTREAM Patch2: accountsservice-read-root-user-cache.patch +# PATCH-FIX-UPSTREAM accountsservice-wtmp-io-improvements.patch boo#1139487 fezhang@suse.com -- Backports that improve wtmp io performance. +Patch3: accountsservice-wtmp-io-improvements.patch ## SLE-only patches start at 1000 # PATCH-FEATURE-SLE as-fate318433-prevent-same-account-multi-logins.patch fate#318433 cxiong@suse.com -- prevent multiple simultaneous login. @@ -98,6 +100,7 @@ querying and manipulating user account information. %patch0 -p1 %patch1 -p1 %patch2 -p1 +%patch3 -p1 # Sle-only patches start at 1000 %if !0%{?is_opensuse} diff --git a/as-fate318433-prevent-same-account-multi-logins.patch b/as-fate318433-prevent-same-account-multi-logins.patch index b3bb62e..b075479 100644 --- a/as-fate318433-prevent-same-account-multi-logins.patch +++ b/as-fate318433-prevent-same-account-multi-logins.patch @@ -1,28 +1,8 @@ -Index: accountsservice-0.6.40/src/libaccountsservice/act-user-manager.c +Index: b/src/libaccountsservice/act-user-manager.c =================================================================== ---- accountsservice-0.6.40.orig/src/libaccountsservice/act-user-manager.c -+++ accountsservice-0.6.40/src/libaccountsservice/act-user-manager.c -@@ -751,8 +751,17 @@ _get_systemd_seat_id (ActUserManager *ma - char *seat_id; - - res = sd_session_get_seat (NULL, &seat_id); -- -- if (res == -ENOENT) { -+ /** -+ * NOTE: There is no -ENOENT errnum for `sd_session_get_seat`. This -+ * possibly an upstream bug. There are also other dubious occurrences of -+ * -ENOENT within the source. -+ * -+ * Change to -ENODATA as this is the normal return for non-seated -+ * session like VNC ones and should not report errors. O/w no user -+ * sessions will be analyzed. -+ */ -+ /* see https://www.freedesktop.org/software/systemd/man/sd_session_is_active.html */ -+ if (res == -ENODATA) { - seat_id = NULL; - } else if (res < 0) { - g_warning ("Could not get current seat: %s", -@@ -1700,12 +1709,22 @@ maybe_add_new_session (ActUserManagerNew +--- a/src/libaccountsservice/act-user-manager.c 2019-09-11 17:40:53.726949739 +0800 ++++ b/src/libaccountsservice/act-user-manager.c 2019-09-11 17:41:00.547007450 +0800 +@@ -1752,12 +1752,22 @@ maybe_add_new_session (ActUserManagerNew if (new_session->x11_display == NULL) { g_debug ("AcUserManager: (mostly) ignoring session '%s' since it's not graphical", new_session->id); @@ -46,11 +26,11 @@ Index: accountsservice-0.6.40/src/libaccountsservice/act-user-manager.c is_ours = FALSE; } -Index: accountsservice-0.6.40/src/libaccountsservice/act-user.c +Index: b/src/libaccountsservice/act-user.c =================================================================== ---- accountsservice-0.6.40.orig/src/libaccountsservice/act-user.c -+++ accountsservice-0.6.40/src/libaccountsservice/act-user.c -@@ -936,6 +936,8 @@ act_user_is_logged_in (ActUser *user) +--- a/src/libaccountsservice/act-user.c 2019-09-11 17:40:53.726949739 +0800 ++++ b/src/libaccountsservice/act-user.c 2019-09-11 17:41:00.547007450 +0800 +@@ -868,6 +868,8 @@ act_user_is_logged_in (ActUser *user) * (Currently, this function is only implemented for systemd-logind. * For ConsoleKit, it is equivalent to act_user_is_logged_in.) * @@ -59,7 +39,7 @@ Index: accountsservice-0.6.40/src/libaccountsservice/act-user.c * Returns: %TRUE or %FALSE */ gboolean -@@ -945,6 +947,24 @@ act_user_is_logged_in_anywhere (ActUser +@@ -896,6 +898,24 @@ act_user_get_saved (ActUser *user) } /** @@ -84,10 +64,10 @@ Index: accountsservice-0.6.40/src/libaccountsservice/act-user.c * act_user_get_locked: * @user: a #ActUser * -Index: accountsservice-0.6.40/src/libaccountsservice/act-user.h +Index: b/src/libaccountsservice/act-user.h =================================================================== ---- accountsservice-0.6.40.orig/src/libaccountsservice/act-user.h -+++ accountsservice-0.6.40/src/libaccountsservice/act-user.h +--- a/src/libaccountsservice/act-user.h 2019-09-11 17:40:53.726949739 +0800 ++++ b/src/libaccountsservice/act-user.h 2019-09-11 17:41:00.547007450 +0800 @@ -67,6 +67,7 @@ guint act_user_get_num_sessions guint act_user_get_num_sessions_anywhere (ActUser *user); gboolean act_user_is_logged_in (ActUser *user);