The branch main has been updated by oshogbo: URL: https://cgit.FreeBSD.org/src/commit/?id=2b1d0c0087a907fe9944b96c6313711865f9674a
commit 2b1d0c0087a907fe9944b96c6313711865f9674a Author: Mariusz Zaborski <osho...@freebsd.org> AuthorDate: 2021-04-07 19:12:52 +0000 Commit: Mariusz Zaborski <osho...@freebsd.org> CommitDate: 2021-04-07 19:16:37 +0000 fileargs: fix double caching of the same file In situations when the current file name wasn't the first element on the list we were cleaning the current name too early. This might cause us to pre-cache the same file twice. --- lib/libcasper/services/cap_fileargs/cap_fileargs.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/libcasper/services/cap_fileargs/cap_fileargs.c b/lib/libcasper/services/cap_fileargs/cap_fileargs.c index ecab23004fcf..64ec69698165 100644 --- a/lib/libcasper/services/cap_fileargs/cap_fileargs.c +++ b/lib/libcasper/services/cap_fileargs/cap_fileargs.c @@ -562,8 +562,12 @@ fileargs_add_cache(nvlist_t *nvlout, const nvlist_t *limits, break; } - if (type != NV_TYPE_NULL || (current_name != NULL && - strcmp(fname, current_name) == 0)) { + if (type != NV_TYPE_NULL) { + i--; + continue; + } + if (current_name != NULL && + strcmp(fname, current_name) == 0) { current_name = NULL; i--; continue; _______________________________________________ dev-commits-src-main@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/dev-commits-src-main To unsubscribe, send any mail to "dev-commits-src-main-unsubscr...@freebsd.org"