in reply to Re^2: opening files: link checking and race conditions
in thread opening files: link checking and race conditions
Now, it's really, really hard to get the timing to work perfectly for that, but that doesn't mean that it won't happen sometimes. So if you start a program creating and removing the link very quickly, and at the same time run the other program again and again, sooner or later you're going to get unlucky.unless ( -l "foo" ) { # we get here fine #*now* the link is created open( FH, ">>foo" ) or die "foo: $!"; #and now it's removed again } die "Link attack detected" if ( -l "foo" ); #too late, the link is gone already, so we didn't die.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: opening files: link checking and race conditions
by graff (Chancellor) on Aug 03, 2005 at 17:22 UTC | |
by Eimi Metamorphoumai (Deacon) on Aug 03, 2005 at 17:57 UTC |