diff options
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | openbsd-compat/mktemp.c | 4 |
2 files changed, 5 insertions, 2 deletions
@@ -14,6 +14,9 @@ | |||
14 | Comment fix about time consumption of _gettemp. | 14 | Comment fix about time consumption of _gettemp. |
15 | FreeBSD did this in revision 1.20. | 15 | FreeBSD did this in revision 1.20. |
16 | OK deraadt@, krw@ | 16 | OK deraadt@, krw@ |
17 | - deraadt@cvs.openbsd.org 2008/07/22 21:47:45 | ||
18 | [mktemp.c] | ||
19 | use arc4random_uniform(); ok djm millert | ||
17 | 20 | ||
18 | 20110922 | 21 | 20110922 |
19 | - OpenBSD CVS Sync | 22 | - OpenBSD CVS Sync |
diff --git a/openbsd-compat/mktemp.c b/openbsd-compat/mktemp.c index 5529bee75..5bdf3e6d9 100644 --- a/openbsd-compat/mktemp.c +++ b/openbsd-compat/mktemp.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* THIS FILE HAS BEEN MODIFIED FROM THE ORIGINAL OPENBSD SOURCE */ | 1 | /* THIS FILE HAS BEEN MODIFIED FROM THE ORIGINAL OPENBSD SOURCE */ |
2 | /* Changes: Removed mktemp */ | 2 | /* Changes: Removed mktemp */ |
3 | 3 | ||
4 | /* $OpenBSD: mktemp.c,v 1.20 2007/10/21 11:09:30 tobias Exp $ */ | 4 | /* $OpenBSD: mktemp.c,v 1.21 2008/07/22 21:47:45 deraadt Exp $ */ |
5 | /* | 5 | /* |
6 | * Copyright (c) 1987, 1993 | 6 | * Copyright (c) 1987, 1993 |
7 | * The Regents of the University of California. All rights reserved. | 7 | * The Regents of the University of California. All rights reserved. |
@@ -103,7 +103,7 @@ _gettemp(path, doopen, domkdir, slen) | |||
103 | while (trv >= path && *trv == 'X') { | 103 | while (trv >= path && *trv == 'X') { |
104 | char c; | 104 | char c; |
105 | 105 | ||
106 | pid = (arc4random() & 0xffff) % (26+26); | 106 | pid = arc4random_uniform(26+26); |
107 | if (pid < 26) | 107 | if (pid < 26) |
108 | c = pid + 'A'; | 108 | c = pid + 'A'; |
109 | else | 109 | else |