]> git.ipfire.org Git - thirdparty/samba.git/commit
ctdb-tests: Fix CID 1373387 - Time of check time of use (TOCTOU)
authorMartin Schwenke <martin@meltin.net>
Fri, 7 Oct 2016 03:30:19 +0000 (14:30 +1100)
committerAnoop C S <anoopcs@samba.org>
Mon, 28 Jul 2025 05:45:28 +0000 (05:45 +0000)
commite8e118e5b38fe86c038b1ed1c2e0815923d13008
treea1d829239bfabd6bddf9d16d0559a1649355e0b8
parent7e91ad4710898d6f14bcbf99955923ea305d2b78
ctdb-tests: Fix CID 1373387 - Time of check time of use (TOCTOU)

Coverity doesn't like the fopen(3) after stat(2).  This is test code
that runs in a simple test environment, so this doesn't really matter.

However, reorder the code to put the stat(2) after the fopen(3).  This
means that the test still does all the same checks and it should now
make Coverity happy.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Anoop C S <anoopcs@samba.org>
ctdb/tests/src/pidfile_test.c