File accountsservice-read-root-user-cache.patch of Package accountsservice.9919

Index: accountsservice-0.6.45/src/daemon.c
===================================================================
--- accountsservice-0.6.45.orig/src/daemon.c
+++ accountsservice-0.6.45/src/daemon.c
@@ -775,9 +775,19 @@ add_new_user_for_pwent (Daemon        *d
                         struct spwd   *spent)
 {
         User *user;
+        g_autofree gchar *filename = NULL;
+        g_autoptr(GKeyFile) key_file = NULL;
+        const gchar *user_name;
 
         user = user_new (daemon, pwent->pw_uid);
         user_update_from_pwent (user, pwent, spent);
+
+        user_name = user_get_user_name (user);
+        filename = g_build_filename (USERDIR, user_name, NULL);
+        key_file = g_key_file_new ();
+        if (g_key_file_load_from_file (key_file, filename, 0, NULL))
+                user_update_from_keyfile (user, key_file);
+
         user_register (user);
 
         g_hash_table_insert (daemon->priv->users,