in reply to Re^3: mkdir with variable mask
in thread mkdir with variable mask
To avoid the race condition, you start off with few permissions, then use chmod to increase them if necessary. Normally, you accept the fewer permissions because that's what the user requested (via umask).
mkdir($qfn, $desired_perms) or die; chmod($desired_perms, $qfn) or die; # Override user's umask
It's messing with umask can lead to race conditions (in asynchronously execute code such as threads and signal handlers).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: mkdir with variable mask
by MidLifeXis (Monsignor) on Jan 26, 2009 at 18:05 UTC |