home ... me ... pictures ... email ... feed ... rust chronicles... twitter...

May 31, 2005

SCO is not random

Ok, so instead of ranting about what I am actually pissed
off about right now, I'm going to point out a side issue I
just learned the other day. I had some idea that the
random number generation on SCO was going to be bad,
but I had no idea it would be -this- bad. (And yes, well
aware that mktemp makes race conditions, same shit
happens with mkstemp.)

For a code fragment foo:

int
main() {
char *templ="LXXXXXX";
char *output;
output=mktemp(templ);
printf("%s\n",output);
return 0;
}

1st run: La003ET
2nd run: La003EU
3rd run: La003EV

(I am not motivated enough to figure out how to indent that
bit of code right now.) Sequential. Lovely. Even better?
Running that function twice, on either the same or different
template within the same process? Same results. Sweet.
I found this via file conflicts on supposedly random files,
when it "runs out" of random names to give you on its little
template or whatnot.

candice at May 31, 2005 04:47 PM

Comments

Wow. That's all sorts of suckyness. I hope their rand() function works better than that. It looks like they pretty clearly aren't following the usual procid + random scheme for mktemp.

Posted by: Llarian at May 31, 2005 06:17 PM

« what is your favorite gear? ... Current ... getting there »