]> rtime.felk.cvut.cz Git - sojka/lightdm.git/commit
Load all users only when really needed master
authorMichal Sojka <sojkam1@fel.cvut.cz>
Sun, 30 Oct 2016 10:49:27 +0000 (11:49 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Sun, 30 Oct 2016 12:23:51 +0000 (13:23 +0100)
commit7802c213778feccb9bb22b507b4fab2385c62f10
treea5617ae890eae7932d5ace94960525d166cf6d86
parentb4dab2bdf4f01fed4ae664aadf3a06c441bdec17
Load all users only when really needed

LightDM internally maintains a list of all users in the "system". This
is problematic when the user database is on a remote LDAP server and
contains thousands of users, because loading all of them can block
lightdm for minutes. This blocking seems to happen at least three times:
1) when lightdm daemon is started, 2) when a lightdm
child (seat/session?) is started and 3) when a user moves focus in the
greeter (gtk) from username to password field.

This patch eliminates long blocking by loading the users on
demand (using getpwnam() instead of getpwent()). The whole test suite
passes, but I'm afraid that some functionality could be broken. Feedback
welcome.
common/user-list.c
liblightdm-gobject/user.c