- deraadt@cvs.openbsd.org 2008/07/22 21:47:45
[mktemp.c] use arc4random_uniform(); ok djm millert
This commit is contained in:
parent
cd92790fcb
commit
dc0e09b41c
|
@ -14,6 +14,9 @@
|
||||||
Comment fix about time consumption of _gettemp.
|
Comment fix about time consumption of _gettemp.
|
||||||
FreeBSD did this in revision 1.20.
|
FreeBSD did this in revision 1.20.
|
||||||
OK deraadt@, krw@
|
OK deraadt@, krw@
|
||||||
|
- deraadt@cvs.openbsd.org 2008/07/22 21:47:45
|
||||||
|
[mktemp.c]
|
||||||
|
use arc4random_uniform(); ok djm millert
|
||||||
|
|
||||||
20110922
|
20110922
|
||||||
- OpenBSD CVS Sync
|
- OpenBSD CVS Sync
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/* THIS FILE HAS BEEN MODIFIED FROM THE ORIGINAL OPENBSD SOURCE */
|
/* THIS FILE HAS BEEN MODIFIED FROM THE ORIGINAL OPENBSD SOURCE */
|
||||||
/* Changes: Removed mktemp */
|
/* Changes: Removed mktemp */
|
||||||
|
|
||||||
/* $OpenBSD: mktemp.c,v 1.20 2007/10/21 11:09:30 tobias Exp $ */
|
/* $OpenBSD: mktemp.c,v 1.21 2008/07/22 21:47:45 deraadt Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1987, 1993
|
* Copyright (c) 1987, 1993
|
||||||
* The Regents of the University of California. All rights reserved.
|
* The Regents of the University of California. All rights reserved.
|
||||||
|
@ -103,7 +103,7 @@ _gettemp(path, doopen, domkdir, slen)
|
||||||
while (trv >= path && *trv == 'X') {
|
while (trv >= path && *trv == 'X') {
|
||||||
char c;
|
char c;
|
||||||
|
|
||||||
pid = (arc4random() & 0xffff) % (26+26);
|
pid = arc4random_uniform(26+26);
|
||||||
if (pid < 26)
|
if (pid < 26)
|
||||||
c = pid + 'A';
|
c = pid + 'A';
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue