]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
When we look for a new trail file there might be a race between find trail
authorpjd <pjd@FreeBSD.org>
Thu, 4 Oct 2018 05:48:09 +0000 (05:48 +0000)
committerpjd <pjd@FreeBSD.org>
Thu, 4 Oct 2018 05:48:09 +0000 (05:48 +0000)
commit55f081d3635aec555694558366c6ccc76daf34ee
treef7f9480ab8569c5731c8f20d7f64fe0e59481e56
parenta373d8a0d56d3fab3f7256f9bd58cadb1a86a860
When we look for a new trail file there might be a race between find trail
file name and opening it. This race was not properly handled, because we were
copying new name before checking for openat(2) error and when we were trying
again we were starting with the next trail file. This could result in skipping
distribution of such a trail file.

Fix this problem by checking for ENOENT first (only for .not_terminated files)
and then updating (or not) tr_filename before restarting the search.

PR: 200139
Reported by: peter
Approved by: re (kib)
contrib/openbsm/bin/auditdistd/trail.c