in reply to Re^3: opening files: link checking and race conditions
in thread opening files: link checking and race conditions
Well then, here's one last try:
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" or ! -e _ ); # we have checked for both existence and "type == symlink" on the same + stat call, # so either it's a link, or it's non-existent, or it's safe to write o +utput
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: opening files: link checking and race conditions
by Eimi Metamorphoumai (Deacon) on Aug 03, 2005 at 17:57 UTC |