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/ctx.c | |
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/ctx.c')
-rw-r--r-- | src/ctx.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -186,6 +186,11 @@ void bfs_ctx_flush(const struct bfs_ctx *ctx) { // We do not check errors here, but they will be caught at cleanup time // with ferror(). fflush(NULL); + + // Flush the user/group caches, in case the executed command edits the + // user/group tables + bfs_users_flush(ctx->users); + bfs_groups_flush(ctx->groups); } /** Flush a file and report any errors. */ |