File accountsservice-933083-load-root-setting.patch of Package accountsservice.8916

Index: b/src/daemon.c
===================================================================
--- a/src/daemon.c	2019-09-20 12:05:57.901335008 +0800
+++ b/src/daemon.c	2019-09-20 12:07:53.450381862 +0800
@@ -234,7 +234,8 @@ entry_generator_cachedir (GHashTable *us
 static void
 load_entries (Daemon             *daemon,
               GHashTable         *users,
-              EntryGeneratorFunc  entry_generator)
+              EntryGeneratorFunc  entry_generator,
+              gboolean force_load)
 {
         gpointer generator_state = NULL;
         struct passwd *pwent;
@@ -248,7 +249,7 @@ load_entries (Daemon             *daemon
                         break;
 
                 /* Skip system users... */
-                if (!user_classify_is_human (pwent->pw_uid, pwent->pw_name, pwent->pw_shell, NULL)) {
+                if (!force_load && !user_classify_is_human (pwent->pw_uid, pwent->pw_name, pwent->pw_shell, NULL)) {
                         g_debug ("skipping user: %s", pwent->pw_name);
                         continue;
                 }
@@ -306,14 +307,14 @@ reload_users (Daemon *daemon)
          */
 
         /* Load the local users into our hash table */
-        load_entries (daemon, users, entry_generator_fgetpwent);
+        load_entries (daemon, users, entry_generator_fgetpwent, FALSE);
         local = g_hash_table_new (g_str_hash, g_str_equal);
         g_hash_table_iter_init (&iter, users);
         while (g_hash_table_iter_next (&iter, &name, NULL))
                 g_hash_table_add (local, name);
 
         /* Now add/update users from other sources, possibly non-local */
-        load_entries (daemon, users, entry_generator_cachedir);
+        load_entries (daemon, users, entry_generator_cachedir, TRUE);
 
         wtmp_helper_update_login_frequencies (users);
openSUSE Build Service is sponsored by