diff options
author | Ryan Lortie <desrt@desrt.ca> | 2014-03-13 18:51:18 -0400 |
---|---|---|
committer | Ray Strode <rstrode@redhat.com> | 2014-03-14 23:25:56 -0400 |
commit | cdee3f55a5821cc76ad270b8c709a7bb1e3ae1b2 (patch) | |
tree | 6f86f6207690bdb70daba3081bd8e474fe512183 /src/daemon.c | |
parent | 3863f54e5efe8c3f929dc93ea026a17d5855a786 (diff) |
daemon: emulate fgetpwent() if we don't have it
We use fgetpwent directly on /etc/passwd in order to ensure we only get
a list of local users (and not ones from the network directory service).
Unfortunately, this function is not commonly found on non-GNU systems.
Provide our own implementation of fgetpwent if the operating system does
not provide it.
https://bugs.freedesktop.org/show_bug.cgi?id=41747
Diffstat (limited to 'src/daemon.c')
-rw-r--r-- | src/daemon.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/daemon.c b/src/daemon.c index cb36f01..233f374 100644 --- a/src/daemon.c +++ b/src/daemon.c @@ -162,6 +162,10 @@ user_previous_login_free (UserPreviousLogin *previous_login) g_free (previous_login); } +#ifndef HAVE_FGETPWENT +#include "fgetpwent.c" +#endif + static struct passwd * entry_generator_wtmp (GHashTable *users, gpointer *state) |