On Mon, Feb 09, 2004 at 09:46:10AM -0500, Bob Showalter ([EMAIL PROTECTED]) wrote: > Kenton Brede wrote: > > I've written the following subroutine to snag the next available UID > > in the 700 range from /etc/passwd. I then use the return value with > > "useradd" to add a new user. > > Note that this algorithm contains a race condition. Between the scan of > /etc/passwd and the call to useradd, that user id may be allocated. >
I've been a sys admin for a little over a year. I've heard of "race condition" and you'd think I'd know what it is by now. I looked it up and will now rewrite the script with file locking. Thanks for pointing this out:) Kent -- "Efficiency is intelligent laziness." -David Dunham -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>