From 097648b6af4eb449c16ea3dca73fcb9863ff9cd0 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Tue, 24 Apr 2018 16:42:30 -0400 Subject: [PATCH 1/6] Update to 0.6.47 --- accountsservice.spec | 5 ++++- sources | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/accountsservice.spec b/accountsservice.spec index 97467ba..569af4c 100644 --- a/accountsservice.spec +++ b/accountsservice.spec @@ -1,7 +1,7 @@ %global _hardened_build 1 Name: accountsservice -Version: 0.6.46 +Version: 0.6.47 Release: 1%{?dist} Summary: D-Bus interfaces for querying and manipulating user account information License: GPLv3+ @@ -98,6 +98,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/*.a %{_datadir}/gtk-doc/html/libaccountsservice/* %changelog +* Tue Apr 24 2018 Ray Strode - 0.6.47-1 +- Update to 0.6.47 + * Sat Apr 21 2018 Peter Robinson 0.4.46-1 - Update to 0.6.46 - Spec cleanup, use %%license diff --git a/sources b/sources index 79950d4..1066715 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (accountsservice-0.6.46.tar.xz) = fe603a9d98bb2b22b511f77e2ab78e8134d7b2d78c5e47706eb191697f7f252a8b3e33a99776a1e28491192b818d627a4ba4b972c3c0fc8c8762f78cdcb58054 +SHA512 (accountsservice-0.6.47.tar.xz) = 9e6ed72904cd1a8c01007ae879158fa9bf7129821e996d0279d1da2072e9d906115585c8fa4f91012af92dbb841825a26f1239b2a6040ef8f180e4bf678a7402 From 244dda46ae81e5899b1acd80923824a81ec8e9ff Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Fri, 4 May 2018 16:48:01 -0400 Subject: [PATCH 2/6] fix crash on user deletion Resolves: 1573550 --- ...r-user-after-we-re-done-with-it-not-.patch | 87 ++++++++++++++++++ ...emit-user-deleted-for-uncached-users.patch | 89 +++++++++++++++++++ accountsservice.spec | 9 +- 3 files changed, 184 insertions(+), 1 deletion(-) create mode 100644 0001-daemon-unregister-user-after-we-re-done-with-it-not-.patch create mode 100644 0002-daemon-don-t-emit-user-deleted-for-uncached-users.patch diff --git a/0001-daemon-unregister-user-after-we-re-done-with-it-not-.patch b/0001-daemon-unregister-user-after-we-re-done-with-it-not-.patch new file mode 100644 index 0000000..1efdb3a --- /dev/null +++ b/0001-daemon-unregister-user-after-we-re-done-with-it-not-.patch @@ -0,0 +1,87 @@ +From 2d9e0f43c46e1be8afd94944e7461e0086497fd3 Mon Sep 17 00:00:00 2001 +From: Ray Strode +Date: Fri, 4 May 2018 16:43:03 -0400 +Subject: [PATCH 1/2] daemon: unregister user after we're done with it not + before + +Now that we get the object path for a user directly from the skeleton, +we can't access that object path after the skeleton is unregistered. + +This commit fixes a problem where the user deletion handling code tries +to access the object path of a user after its skeleton is unregistered. +--- + src/daemon.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/daemon.c b/src/daemon.c +index 9ec153a..d3fa971 100644 +--- a/src/daemon.c ++++ b/src/daemon.c +@@ -483,63 +483,63 @@ reload_users (Daemon *daemon) + if (!user_get_system_account (user)) + number_of_normal_users++; + user_update_local_account_property (user, g_hash_table_lookup (local, name) != NULL); + } + g_hash_table_destroy (local); + + had_no_users = accounts_accounts_get_has_no_users (accounts); + has_no_users = number_of_normal_users == 0; + + if (had_no_users != has_no_users) + accounts_accounts_set_has_no_users (accounts, has_no_users); + + had_multiple_users = accounts_accounts_get_has_multiple_users (accounts); + has_multiple_users = number_of_normal_users > 1; + + if (had_multiple_users != has_multiple_users) + accounts_accounts_set_has_multiple_users (accounts, has_multiple_users); + + /* Swap out the users */ + old_users = daemon->priv->users; + daemon->priv->users = users; + + /* Remove all the old users */ + g_hash_table_iter_init (&iter, old_users); + while (g_hash_table_iter_next (&iter, &name, (gpointer *)&user)) { + User *refreshed_user; + + refreshed_user = g_hash_table_lookup (users, name); + + if (!refreshed_user || !user_get_cached (refreshed_user)) { +- user_unregister (user); + accounts_accounts_emit_user_deleted (ACCOUNTS_ACCOUNTS (daemon), + user_get_object_path (user)); ++ user_unregister (user); + } + } + + /* Register all the new users */ + g_hash_table_iter_init (&iter, users); + while (g_hash_table_iter_next (&iter, &name, (gpointer *)&user)) { + User *stale_user; + + stale_user = g_hash_table_lookup (old_users, name); + + if (!stale_user || !user_get_cached (stale_user) && user_get_cached (user)) { + user_register (user); + accounts_accounts_emit_user_added (ACCOUNTS_ACCOUNTS (daemon), + user_get_object_path (user)); + } + g_object_thaw_notify (G_OBJECT (user)); + } + + g_hash_table_destroy (old_users); + } + + static gboolean + reload_users_timeout (Daemon *daemon) + { + reload_users (daemon); + daemon->priv->reload_id = 0; + + return FALSE; + } + +-- +2.17.0 + diff --git a/0002-daemon-don-t-emit-user-deleted-for-uncached-users.patch b/0002-daemon-don-t-emit-user-deleted-for-uncached-users.patch new file mode 100644 index 0000000..e696569 --- /dev/null +++ b/0002-daemon-don-t-emit-user-deleted-for-uncached-users.patch @@ -0,0 +1,89 @@ +From 815c43087926eb22f37fed6f501a3e9291edf564 Mon Sep 17 00:00:00 2001 +From: Ray Strode +Date: Wed, 9 May 2018 09:26:57 -0400 +Subject: [PATCH 2/2] daemon: don't emit user-deleted for uncached users + +Right now we emit spurious user-deleted signals for +all uncached users anytime a reload occurs. +Uncached users are users explicitly requested by a client, +but not part of the results returned from ListCachedUsers. + +We should only be emitting user-deleted it they were initially +cached and transitioned to uncached, not if they're still +hanging around in an uncached state. + +This commit fixes the code to do that. +--- + src/daemon.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/daemon.c b/src/daemon.c +index d3fa971..a12b71b 100644 +--- a/src/daemon.c ++++ b/src/daemon.c +@@ -482,61 +482,61 @@ reload_users (Daemon *daemon) + while (g_hash_table_iter_next (&iter, &name, (gpointer *)&user)) { + if (!user_get_system_account (user)) + number_of_normal_users++; + user_update_local_account_property (user, g_hash_table_lookup (local, name) != NULL); + } + g_hash_table_destroy (local); + + had_no_users = accounts_accounts_get_has_no_users (accounts); + has_no_users = number_of_normal_users == 0; + + if (had_no_users != has_no_users) + accounts_accounts_set_has_no_users (accounts, has_no_users); + + had_multiple_users = accounts_accounts_get_has_multiple_users (accounts); + has_multiple_users = number_of_normal_users > 1; + + if (had_multiple_users != has_multiple_users) + accounts_accounts_set_has_multiple_users (accounts, has_multiple_users); + + /* Swap out the users */ + old_users = daemon->priv->users; + daemon->priv->users = users; + + /* Remove all the old users */ + g_hash_table_iter_init (&iter, old_users); + while (g_hash_table_iter_next (&iter, &name, (gpointer *)&user)) { + User *refreshed_user; + + refreshed_user = g_hash_table_lookup (users, name); + +- if (!refreshed_user || !user_get_cached (refreshed_user)) { ++ if (!refreshed_user || user_get_cached (user) && !user_get_cached (refreshed_user)) { + accounts_accounts_emit_user_deleted (ACCOUNTS_ACCOUNTS (daemon), + user_get_object_path (user)); + user_unregister (user); + } + } + + /* Register all the new users */ + g_hash_table_iter_init (&iter, users); + while (g_hash_table_iter_next (&iter, &name, (gpointer *)&user)) { + User *stale_user; + + stale_user = g_hash_table_lookup (old_users, name); + + if (!stale_user || !user_get_cached (stale_user) && user_get_cached (user)) { + user_register (user); + accounts_accounts_emit_user_added (ACCOUNTS_ACCOUNTS (daemon), + user_get_object_path (user)); + } + g_object_thaw_notify (G_OBJECT (user)); + } + + g_hash_table_destroy (old_users); + } + + static gboolean + reload_users_timeout (Daemon *daemon) + { + reload_users (daemon); + daemon->priv->reload_id = 0; + +-- +2.17.0 + diff --git a/accountsservice.spec b/accountsservice.spec index 569af4c..75b25b4 100644 --- a/accountsservice.spec +++ b/accountsservice.spec @@ -2,7 +2,7 @@ Name: accountsservice Version: 0.6.47 -Release: 1%{?dist} +Release: 2%{?dist} Summary: D-Bus interfaces for querying and manipulating user account information License: GPLv3+ URL: https://www.freedesktop.org/wiki/Software/AccountsService/ @@ -23,6 +23,9 @@ Requires: polkit Requires: shadow-utils %{?systemd_requires} +Patch1: 0001-daemon-unregister-user-after-we-re-done-with-it-not-.patch +Patch2: 0002-daemon-don-t-emit-user-deleted-for-uncached-users.patch + %description The accountsservice project provides a set of D-Bus interfaces for querying and manipulating user account information and an implementation @@ -98,6 +101,10 @@ rm $RPM_BUILD_ROOT%{_libdir}/*.a %{_datadir}/gtk-doc/html/libaccountsservice/* %changelog +* Fri May 04 2018 Ray Strode - 0.6.47-2 +- fix crash on user deletion + Resolves: #1573550 + * Tue Apr 24 2018 Ray Strode - 0.6.47-1 - Update to 0.6.47 From 2443e4c88f1c3136984be2d64b6642af04259470 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Thu, 10 May 2018 14:07:56 -0400 Subject: [PATCH 3/6] Update to 0.6.48 Resolves: #1575780 --- accountsservice.spec | 11 ++++++----- sources | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/accountsservice.spec b/accountsservice.spec index 75b25b4..e0d66d6 100644 --- a/accountsservice.spec +++ b/accountsservice.spec @@ -1,8 +1,8 @@ %global _hardened_build 1 Name: accountsservice -Version: 0.6.47 -Release: 2%{?dist} +Version: 0.6.48 +Release: 1%{?dist} Summary: D-Bus interfaces for querying and manipulating user account information License: GPLv3+ URL: https://www.freedesktop.org/wiki/Software/AccountsService/ @@ -23,9 +23,6 @@ Requires: polkit Requires: shadow-utils %{?systemd_requires} -Patch1: 0001-daemon-unregister-user-after-we-re-done-with-it-not-.patch -Patch2: 0002-daemon-don-t-emit-user-deleted-for-uncached-users.patch - %description The accountsservice project provides a set of D-Bus interfaces for querying and manipulating user account information and an implementation @@ -101,6 +98,10 @@ rm $RPM_BUILD_ROOT%{_libdir}/*.a %{_datadir}/gtk-doc/html/libaccountsservice/* %changelog +* Thu May 10 2018 Ray Strode - 0.6.48-1 +- Update to 0.6.48 + Resolves: #1575780 + * Fri May 04 2018 Ray Strode - 0.6.47-2 - fix crash on user deletion Resolves: #1573550 diff --git a/sources b/sources index 1066715..1e0b2e4 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (accountsservice-0.6.47.tar.xz) = 9e6ed72904cd1a8c01007ae879158fa9bf7129821e996d0279d1da2072e9d906115585c8fa4f91012af92dbb841825a26f1239b2a6040ef8f180e4bf678a7402 +SHA512 (accountsservice-0.6.48.tar.xz) = 9c71b78cea398e8664a1cba21d66c250e52a5d05cb700e4755a653313edca6c6b36f07b2a4bc5a1c02991b3fe426c0a471bd75abfd5ec18790842f111726414b From b34e7a149d6b08464e5720d66688f2aedb46eeea Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Thu, 10 May 2018 16:10:28 -0400 Subject: [PATCH 4/6] Update to 0.6.49 (brown bag release) --- accountsservice.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/accountsservice.spec b/accountsservice.spec index e0d66d6..b075718 100644 --- a/accountsservice.spec +++ b/accountsservice.spec @@ -1,7 +1,7 @@ %global _hardened_build 1 Name: accountsservice -Version: 0.6.48 +Version: 0.6.49 Release: 1%{?dist} Summary: D-Bus interfaces for querying and manipulating user account information License: GPLv3+ @@ -98,6 +98,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/*.a %{_datadir}/gtk-doc/html/libaccountsservice/* %changelog +* Thu May 10 2018 Ray Strode - 0.6.49-1 +- Update to 0.6.49 (brown bag release) + * Thu May 10 2018 Ray Strode - 0.6.48-1 - Update to 0.6.48 Resolves: #1575780 From 57233a3bc701a0b5393197b1e4a80929770abf08 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Thu, 10 May 2018 16:15:49 -0400 Subject: [PATCH 5/6] update sources --- sources | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources b/sources index 1e0b2e4..37ff82d 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (accountsservice-0.6.48.tar.xz) = 9c71b78cea398e8664a1cba21d66c250e52a5d05cb700e4755a653313edca6c6b36f07b2a4bc5a1c02991b3fe426c0a471bd75abfd5ec18790842f111726414b +SHA512 (accountsservice-0.6.49.tar.xz) = 4077f7d401f1964ca909ca1188297b09137d553f578ceea1d648827d5bef3a4a86180b4d715b82434d047fdf764fc5c684c95479c3510b17f10253f1e1800f89 From 8f65b813e1ca81eb0efb7e8649e5f3cbce230968 Mon Sep 17 00:00:00 2001 From: Pete Walter Date: Thu, 10 May 2018 23:21:37 +0100 Subject: [PATCH 6/6] Drop unused patches --- ...r-user-after-we-re-done-with-it-not-.patch | 87 ------------------ ...emit-user-deleted-for-uncached-users.patch | 89 ------------------- 2 files changed, 176 deletions(-) delete mode 100644 0001-daemon-unregister-user-after-we-re-done-with-it-not-.patch delete mode 100644 0002-daemon-don-t-emit-user-deleted-for-uncached-users.patch diff --git a/0001-daemon-unregister-user-after-we-re-done-with-it-not-.patch b/0001-daemon-unregister-user-after-we-re-done-with-it-not-.patch deleted file mode 100644 index 1efdb3a..0000000 --- a/0001-daemon-unregister-user-after-we-re-done-with-it-not-.patch +++ /dev/null @@ -1,87 +0,0 @@ -From 2d9e0f43c46e1be8afd94944e7461e0086497fd3 Mon Sep 17 00:00:00 2001 -From: Ray Strode -Date: Fri, 4 May 2018 16:43:03 -0400 -Subject: [PATCH 1/2] daemon: unregister user after we're done with it not - before - -Now that we get the object path for a user directly from the skeleton, -we can't access that object path after the skeleton is unregistered. - -This commit fixes a problem where the user deletion handling code tries -to access the object path of a user after its skeleton is unregistered. ---- - src/daemon.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/daemon.c b/src/daemon.c -index 9ec153a..d3fa971 100644 ---- a/src/daemon.c -+++ b/src/daemon.c -@@ -483,63 +483,63 @@ reload_users (Daemon *daemon) - if (!user_get_system_account (user)) - number_of_normal_users++; - user_update_local_account_property (user, g_hash_table_lookup (local, name) != NULL); - } - g_hash_table_destroy (local); - - had_no_users = accounts_accounts_get_has_no_users (accounts); - has_no_users = number_of_normal_users == 0; - - if (had_no_users != has_no_users) - accounts_accounts_set_has_no_users (accounts, has_no_users); - - had_multiple_users = accounts_accounts_get_has_multiple_users (accounts); - has_multiple_users = number_of_normal_users > 1; - - if (had_multiple_users != has_multiple_users) - accounts_accounts_set_has_multiple_users (accounts, has_multiple_users); - - /* Swap out the users */ - old_users = daemon->priv->users; - daemon->priv->users = users; - - /* Remove all the old users */ - g_hash_table_iter_init (&iter, old_users); - while (g_hash_table_iter_next (&iter, &name, (gpointer *)&user)) { - User *refreshed_user; - - refreshed_user = g_hash_table_lookup (users, name); - - if (!refreshed_user || !user_get_cached (refreshed_user)) { -- user_unregister (user); - accounts_accounts_emit_user_deleted (ACCOUNTS_ACCOUNTS (daemon), - user_get_object_path (user)); -+ user_unregister (user); - } - } - - /* Register all the new users */ - g_hash_table_iter_init (&iter, users); - while (g_hash_table_iter_next (&iter, &name, (gpointer *)&user)) { - User *stale_user; - - stale_user = g_hash_table_lookup (old_users, name); - - if (!stale_user || !user_get_cached (stale_user) && user_get_cached (user)) { - user_register (user); - accounts_accounts_emit_user_added (ACCOUNTS_ACCOUNTS (daemon), - user_get_object_path (user)); - } - g_object_thaw_notify (G_OBJECT (user)); - } - - g_hash_table_destroy (old_users); - } - - static gboolean - reload_users_timeout (Daemon *daemon) - { - reload_users (daemon); - daemon->priv->reload_id = 0; - - return FALSE; - } - --- -2.17.0 - diff --git a/0002-daemon-don-t-emit-user-deleted-for-uncached-users.patch b/0002-daemon-don-t-emit-user-deleted-for-uncached-users.patch deleted file mode 100644 index e696569..0000000 --- a/0002-daemon-don-t-emit-user-deleted-for-uncached-users.patch +++ /dev/null @@ -1,89 +0,0 @@ -From 815c43087926eb22f37fed6f501a3e9291edf564 Mon Sep 17 00:00:00 2001 -From: Ray Strode -Date: Wed, 9 May 2018 09:26:57 -0400 -Subject: [PATCH 2/2] daemon: don't emit user-deleted for uncached users - -Right now we emit spurious user-deleted signals for -all uncached users anytime a reload occurs. -Uncached users are users explicitly requested by a client, -but not part of the results returned from ListCachedUsers. - -We should only be emitting user-deleted it they were initially -cached and transitioned to uncached, not if they're still -hanging around in an uncached state. - -This commit fixes the code to do that. ---- - src/daemon.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/daemon.c b/src/daemon.c -index d3fa971..a12b71b 100644 ---- a/src/daemon.c -+++ b/src/daemon.c -@@ -482,61 +482,61 @@ reload_users (Daemon *daemon) - while (g_hash_table_iter_next (&iter, &name, (gpointer *)&user)) { - if (!user_get_system_account (user)) - number_of_normal_users++; - user_update_local_account_property (user, g_hash_table_lookup (local, name) != NULL); - } - g_hash_table_destroy (local); - - had_no_users = accounts_accounts_get_has_no_users (accounts); - has_no_users = number_of_normal_users == 0; - - if (had_no_users != has_no_users) - accounts_accounts_set_has_no_users (accounts, has_no_users); - - had_multiple_users = accounts_accounts_get_has_multiple_users (accounts); - has_multiple_users = number_of_normal_users > 1; - - if (had_multiple_users != has_multiple_users) - accounts_accounts_set_has_multiple_users (accounts, has_multiple_users); - - /* Swap out the users */ - old_users = daemon->priv->users; - daemon->priv->users = users; - - /* Remove all the old users */ - g_hash_table_iter_init (&iter, old_users); - while (g_hash_table_iter_next (&iter, &name, (gpointer *)&user)) { - User *refreshed_user; - - refreshed_user = g_hash_table_lookup (users, name); - -- if (!refreshed_user || !user_get_cached (refreshed_user)) { -+ if (!refreshed_user || user_get_cached (user) && !user_get_cached (refreshed_user)) { - accounts_accounts_emit_user_deleted (ACCOUNTS_ACCOUNTS (daemon), - user_get_object_path (user)); - user_unregister (user); - } - } - - /* Register all the new users */ - g_hash_table_iter_init (&iter, users); - while (g_hash_table_iter_next (&iter, &name, (gpointer *)&user)) { - User *stale_user; - - stale_user = g_hash_table_lookup (old_users, name); - - if (!stale_user || !user_get_cached (stale_user) && user_get_cached (user)) { - user_register (user); - accounts_accounts_emit_user_added (ACCOUNTS_ACCOUNTS (daemon), - user_get_object_path (user)); - } - g_object_thaw_notify (G_OBJECT (user)); - } - - g_hash_table_destroy (old_users); - } - - static gboolean - reload_users_timeout (Daemon *daemon) - { - reload_users (daemon); - daemon->priv->reload_id = 0; - --- -2.17.0 -