Content deleted Content added
revert - I was incorrect |
|||
Line 6:
In [[Unix]], the following [[C (programming language)|C]] code, when used in a [[setuid]] program, is a TOCTTOU bug:
<source lang="c">
if (access(file, R_OK) != 0) {
▲ exit(1);
</source>
▲ }
▲ // do something with fd...
Here, ''access'' is intended to check whether the real user who executed the setuid program would normally be allowed to read the file (i.e., ''access'' checks the [[real userid]] rather than [[effective userid]]).
|