Bug 58021 - Do not read /etc/passwd directly
Summary: Do not read /etc/passwd directly
Alias: None
Product: accountsservice
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Matthias Clasen
QA Contact:
Depends on:
Reported: 2012-12-08 16:09 UTC by Benjamin Berg
Modified: 2013-05-11 19:49 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Description Benjamin Berg 2012-12-08 16:09:31 UTC
AccountsService reads /etc/passwd directly. I have no idea why this is the case, but it completely breaks any networked setup, as session data cannot be loaded/stored. It also caches the data excessively, which may break ldap setups because the ldap connection is not yet there on service startup.

AccountsService should use the correct system functions to query the data via nsswitch. It should also try to load information about users every time data is requested.
Comment 1 Matthias Clasen 2012-12-10 14:50:02 UTC
/etc/passwd is read on purpose, because we only want to list the local users plus users that have logged in locally, and not the 10000+ users that are in your ldap directory.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.