diff options
author | Stephen Gallagher <sgallagh@redhat.com> | 2009-03-05 15:39:26 -0500 |
---|---|---|
committer | Simo Sorce <ssorce@redhat.com> | 2009-03-05 17:25:50 -0500 |
commit | 132ccd66fb7f7bf583a6ddbed031a2bf5eef473c (patch) | |
tree | d8356cdc4c71a6c5f038bf391aa4f22623580ac1 /server/db/sysdb_search.c | |
parent | 16802de42f27a9060eb395751e82c9ad85cb8fe3 (diff) | |
download | sssd-132ccd66fb7f7bf583a6ddbed031a2bf5eef473c.tar.gz sssd-132ccd66fb7f7bf583a6ddbed031a2bf5eef473c.tar.bz2 sssd-132ccd66fb7f7bf583a6ddbed031a2bf5eef473c.zip |
Implement GetCachedUsers in the InfoPipe
This function allows a caller to retrieve a list of users who have
logged in on the system, specifying an optional minimum last login
time to trim the list.
I modified sysdb_enumpwent to accept an optional search argument.
GetCachedUsers takes advantage of this argument to limit the search
by the last login time.
I also found and fixed a few additional low-memory conditions
around D-BUS message replies.
Diffstat (limited to 'server/db/sysdb_search.c')
-rw-r--r-- | server/db/sysdb_search.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/server/db/sysdb_search.c b/server/db/sysdb_search.c index ff18419e..8b14221d 100644 --- a/server/db/sysdb_search.c +++ b/server/db/sysdb_search.c @@ -264,6 +264,7 @@ int sysdb_enumpwent(TALLOC_CTX *mem_ctx, struct sysdb_ctx *ctx, const char *domain, bool legacy, + const char *expression, sysdb_callback_t fn, void *ptr) { static const char *attrs[] = SYSDB_PW_ATTRS; @@ -278,7 +279,11 @@ int sysdb_enumpwent(TALLOC_CTX *mem_ctx, return ENOMEM; } - sctx->expression = SYSDB_PWENT_FILTER; + if (expression) + sctx->expression = expression; + else + sctx->expression = SYSDB_PWENT_FILTER; + sctx->attrs = attrs; return sysdb_operation(mem_ctx, ctx, user_search, sctx); |