daemon: add all users from cachedir to ListCachedUsers result
authorStef Walter <stefw@gnome.org>
Tue, 24 Jul 2012 21:15:33 +0000 (17:15 -0400)
committerRay Strode <rstrode@redhat.com>
Tue, 24 Jul 2012 21:15:33 +0000 (17:15 -0400)
commit3b59c08e5d3f8a14f6292a41027a596fbc655d9d
treecc913925ee2405048258ea84bbdef13cf58605c3
parent277880f5da386fac6dd6f76139a4ed242a136009
daemon: add all users from cachedir to ListCachedUsers result

The cachedir /var/lib/AccountsService/users/ contains a list of
files named after user accounts.  These files contain metadata
about the user.

This commit changes the code to consider the presence of one of
these cache files as evidence of a user account, and uses that
information to augment the list of users returned by ListCachedUsers.

This prevents network-login users from "falling off the map" if the
wtmp file is rotated.

It's also a prerequisite for adding support for an explicit
CacheUser() call. That call will be introduced in a subsequent
commit.

https://bugs.freedesktop.org/show_bug.cgi?id=50770
src/daemon.c