Briefly describe race conditions in file access.

What will be an ideal response?


Race condition is a common attack exploit. In general, it is a where an attacker can "race in" and change something between two actions in your program. The goal is to make your program misbehave. As mentioned in the previous section, a common race condition arises when testing for file existence using code such as:

unless (-e $myfilename) # bad practice
{
open(FH, "> $myfilename");
}

In this case, there is a race between testing whether or not the file exists and opening it for writing. There is no guarantee that the answer returned by the -e test will still be valid by the time the open is called. An attacker can replace the file with a link to something important and cause the code to erase that file.

Computer Science & Information Technology

You might also like to view...

When does the monitor contention process takes place?

What will be an ideal response?

Computer Science & Information Technology

Users must create a queries from scratch

Indicate whether the statement is true or false

Computer Science & Information Technology

Search sites such as Bing, Google, and others earn revenue by having ________

Fill in the blank(s) with correct word

Computer Science & Information Technology

This is a section of code that gracefully responds to exceptions.

a. exception generator b. exception manipulator c. exception handler d. exception monitor

Computer Science & Information Technology