diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2022-11-09 11:14:12 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2022-11-09 12:08:20 -0500 |
commit | b41dca52762c5188638236ae81b9f4597bb29ac9 (patch) | |
tree | 4d503f6dcee1b1ed15ef61df3c8ccb9b92533546 /src/ctx.h | |
parent | dd6808539013061a3113e45c7267430e56749f2c (diff) | |
download | bfs-b41dca52762c5188638236ae81b9f4597bb29ac9.tar.xz |
pwcache: Fill the user/group caches lazily
Iterating all the users/groups can be expensive, especially with NSS.
Android has so many that it doesn't even return them all from
get{pw,gr}ent() for performance reasons, leading to incorrect behaviour
of -user/-group/etc.
Diffstat (limited to 'src/ctx.h')
-rw-r--r-- | src/ctx.h | 24 |
1 files changed, 1 insertions, 23 deletions
@@ -106,10 +106,8 @@ struct bfs_ctx { /** Colored stderr. */ struct CFILE *cerr; - /** User table. */ + /** User cache. */ struct bfs_users *users; - /** The error that occurred parsing the user table, if any. */ - int users_error; /** Group table. */ struct bfs_groups *groups; /** The error that occurred parsing the group table, if any. */ @@ -138,26 +136,6 @@ struct bfs_ctx { struct bfs_ctx *bfs_ctx_new(void); /** - * Get the users table. - * - * @param ctx - * The bfs context. - * @return - * The cached users table, or NULL on failure. - */ -const struct bfs_users *bfs_ctx_users(const struct bfs_ctx *ctx); - -/** - * Get the groups table. - * - * @param ctx - * The bfs context. - * @return - * The cached groups table, or NULL on failure. - */ -const struct bfs_groups *bfs_ctx_groups(const struct bfs_ctx *ctx); - -/** * Get the mount table. * * @param ctx |