accountsservice/accountsservice-933083-load-root-setting.patch

41 lines
1.8 KiB
Diff

Index: accountsservice-0.6.43/src/daemon.c
===================================================================
--- accountsservice-0.6.43.orig/src/daemon.c
+++ accountsservice-0.6.43/src/daemon.c
@@ -309,7 +309,8 @@ entry_generator_cachedir (GHashTable *
static void
load_entries (Daemon *daemon,
GHashTable *users,
- EntryGeneratorFunc entry_generator)
+ EntryGeneratorFunc entry_generator,
+ gboolean force_load)
{
gpointer generator_state = NULL;
struct passwd *pwent;
@@ -325,7 +326,7 @@ load_entries (Daemon *daemon
break;
/* Skip system users... */
- if (!user_classify_is_human (pwent->pw_uid, pwent->pw_name, pwent->pw_shell, spent? spent->sp_pwdp : NULL)) {
+ if (!force_load && !user_classify_is_human (pwent->pw_uid, pwent->pw_name, pwent->pw_shell, spent? spent->sp_pwdp : NULL)) {
g_debug ("skipping user: %s", pwent->pw_name);
continue;
}
@@ -383,14 +384,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);