diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2022-11-09 11:35:53 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2022-11-09 12:09:45 -0500 |
commit | fc63f1b33fb438e8f7690db9bd84e3c69fe86b51 (patch) | |
tree | 79ad74fee5a8f922a6b19714affdcdbc26a317c1 /src/pwcache.h | |
parent | b41dca52762c5188638236ae81b9f4597bb29ac9 (diff) | |
download | bfs-fc63f1b33fb438e8f7690db9bd84e3c69fe86b51.tar.xz |
ctx: Flush the user/group caches when executing commands
This fixes (admittedly uncommon) commands like
$ bfs -nouser -exec add-missing-user.sh {} \;
Diffstat (limited to 'src/pwcache.h')
-rw-r--r-- | src/pwcache.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/pwcache.h b/src/pwcache.h index 6ae8bea..f1ca0bf 100644 --- a/src/pwcache.h +++ b/src/pwcache.h @@ -64,6 +64,14 @@ const struct passwd *bfs_getpwnam(struct bfs_users *users, const char *name); const struct passwd *bfs_getpwuid(struct bfs_users *users, uid_t uid); /** + * Flush a user cache. + * + * @param users + * The cache to flush. + */ +void bfs_users_flush(struct bfs_users *users); + +/** * Free a user cache. * * @param users @@ -111,6 +119,14 @@ const struct group *bfs_getgrnam(struct bfs_groups *groups, const char *name); const struct group *bfs_getgrgid(struct bfs_groups *groups, gid_t gid); /** + * Flush a group cache. + * + * @param groups + * The cache to flush. + */ +void bfs_groups_flush(struct bfs_groups *groups); + +/** * Free a group cache. * * @param groups |