From fc63f1b33fb438e8f7690db9bd84e3c69fe86b51 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Wed, 9 Nov 2022 11:35:53 -0500 Subject: ctx: Flush the user/group caches when executing commands This fixes (admittedly uncommon) commands like $ bfs -nouser -exec add-missing-user.sh {} \; --- src/pwcache.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/pwcache.h') diff --git a/src/pwcache.h b/src/pwcache.h index 6ae8bea..f1ca0bf 100644 --- a/src/pwcache.h +++ b/src/pwcache.h @@ -63,6 +63,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. * @@ -110,6 +118,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. * -- cgit v1.2.3