ListCachedUsers may return outdated invalid data
AccountsService monitors /etc/passwd
, /etc/shadow
and /etc/group
for changes and reload its cached view when they change.
Since it is common that more than one of these files change together, or for one of them to have subsequent changes, the cache refresh is scheduled 500ms after the first change happened.
If a call to ListCachedUsers
arrives in this 500ms window, its servicing is off-loaded to an idler.
Since the timeout has not expired yet, the idler will be triggered on the next mailoop iteration, before the cache has been refreshed, returning old data.