Comment 7 for bug 1667113

Revision history for this message
Christian Ehrhardt  (paelzer) wrote : Re: Libvirt Qemu appears in the list of users in Ligthdm and user switecher

The user Objects have an attribute for system accounts:
property Boolean SystemAccount
Whether or not the account is a system account, such as adm. System accounts aren't returned by ListCachedUsers and should generally be ignored.

It also has a shell property, but that (by default) seems to have no impact on listCachedUsers
property String Shell, method SetShell(String path)
The user's login shell.

ListCachedUsers then is what is used by lightdm to fetch the list:
method ListCachedUsers()
returns: users: an array of paths for the user objects
Returns a subset of the users who exist, typically those who have logged in recently, for populating chooser lists such as those used by GDM's greeter.
Currently the accountsservice process scans /etc/passwd for users, filters out those with UID values which are below a threshold point to screen out system users, and sorts the rest by the number of times the users in question appear in /var/log/wtmp. Above a certain length, it's expected that the caller will disregard the list and present only an entry field. The entry field always needs to be available because we know that some results may be missing from this list.

Best API def I found so far is from sssd:
https://fedorahosted.org/sssd/wiki/DesignDocs/AccountsService

Call is from lightdm at load_users in common/user-list.c

This can be reproduced more easily by a direct dbus call:
$ dbus-send --print-reply=literal --system --dest=org.freedesktop.Accounts /org/freedesktop/Accounts org.freedesktop.Accounts.ListCachedUsers