Stupid Apple
You didn't want password changes to take effect immediately, did you?
At each password prompt I just hit return.
kakajou$ su test -c id;echo $?;date Password: uid=100(test) gid=4294967294(nobody) groups=4294967294(nobody),0(wheel) 0 Tue Jan 15 22:31:27 GMT 2008 kakajou$ sudo dscl / -create /Users/test Password \*;date Tue Jan 15 22:31:31 GMT 2008 kakajou$ su test -c id;echo $?;date Password: uid=100(test) gid=4294967294(nobody) groups=4294967294(nobody),0(wheel) 0 Tue Jan 15 22:31:34 GMT 2008 kakajou$ su test -c id;echo $?;date Password: uid=100(test) gid=4294967294(nobody) groups=4294967294(nobody),0(wheel) 0 Tue Jan 15 22:31:46 GMT 2008 kakajou$ su test -c id;echo $?;date Password: su: Sorry 1 Tue Jan 15 22:31:49 GMT 2008 kakajou$
Having the default password be "" ain't exactly hot either.
(To summarize: if you want to mechanically create a user on a Mac then this week's tool is dscl. You have to fill out all the fields yourself rather than use a single tool which gets it all right for you and knows which API to use (like FreeBSD's pw for example or Linux's useradd). One of the fields you have to fill out is the password, and before you've done so the new user is wide open; moreover even when you do it takes some time to take effect. You can probably mitigate this by not setting a usable shell until the password is sorted, but sheesh.)
Updated July 2009: this bug doesn't exist in OS X 10.5.7. Good.
no subject
no subject
no subject
no subject
no subject
no subject
no subject
no subject
no subject
no subject
no subject
no subject
no subject
no subject
no subject