Time-of-check to time-of-use: Difference between revisions

Content deleted Content added
mNo edit summary
m minor fixes
Line 16:
Article ''A'' normally shows an image I.jpg. If Mallet could modify article ''A'' exactly between steps 1 and 2 so that the image pointed instead to I1.jpg, an initially identical looking image, then initially the Main Page would look fine. But in fact Mallet has engineered an unlocked image onto the Main Page. He is now free to change the image at will while it is displayed on the Main Page.
 
This would be a ''time-of-usecheck-to-time-of-checkuse'' error in the featured article inclusion process. The solution in this case would be for step 2 to copy the same version of ''A'' that step 1 looked at.
 
== ''access'' Example ==
 
In [[Unix]], the following [[C programming language|C]] code, when used in a [[setuid]] program, is a TOCTTOU bug:
 
if (access(file, R_OK) != 0) {