race weakness #12
A race condition occurs within concurrent environments. It may be in the form of a function call, a small number of instructions, a series of program invocations and more.
This accepts filename arguments; if an attacker can move those files, a race condition results..
chmod (new_filename, st.st_mode);