summaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
Diffstat (limited to 'libexec')
-rw-r--r--libexec/ftpd/ftpd.c6
-rw-r--r--libexec/identd/parse.c6
-rw-r--r--libexec/tftp-proxy/tftp-proxy.c6
3 files changed, 9 insertions, 9 deletions
diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c
index 21579c44ab1..3a7c224010f 100644
--- a/libexec/ftpd/ftpd.c
+++ b/libexec/ftpd/ftpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ftpd.c,v 1.181 2007/09/02 15:19:20 deraadt Exp $ */
+/* $OpenBSD: ftpd.c,v 1.182 2008/04/13 00:22:16 djm Exp $ */
/* $NetBSD: ftpd.c,v 1.15 1995/06/03 22:46:47 mycroft Exp $ */
/*
@@ -70,7 +70,7 @@ static const char copyright[] =
static const char sccsid[] = "@(#)ftpd.c 8.4 (Berkeley) 4/16/94";
#else
static const char rcsid[] =
- "$OpenBSD: ftpd.c,v 1.181 2007/09/02 15:19:20 deraadt Exp $";
+ "$OpenBSD: ftpd.c,v 1.182 2008/04/13 00:22:16 djm Exp $";
#endif
#endif /* not lint */
@@ -920,7 +920,7 @@ pass(char *passwd)
useconds_t us;
/* Sleep between 1 and 3 seconds to emulate a crypt. */
- us = arc4random() % 3000000;
+ us = arc4random_uniform(3000000);
usleep(us);
if (as != NULL) {
auth_close(as);
diff --git a/libexec/identd/parse.c b/libexec/identd/parse.c
index dd4c3e11a8a..768b2ec9f3b 100644
--- a/libexec/identd/parse.c
+++ b/libexec/identd/parse.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.c,v 1.45 2007/09/26 02:50:36 ray Exp $ */
+/* $OpenBSD: parse.c,v 1.46 2008/04/13 00:22:17 djm Exp $ */
/*
* This program is in the public domain and may be used freely by anyone
@@ -105,9 +105,9 @@ gentoken(char *buf, int len)
return;
for (p = buf; len > 1; p++, len--) {
if (p == buf)
- *p = token0cnv[arc4random() % (sizeof token0cnv-1)];
+ *p = token0cnv[arc4random_uniform(sizeof(token0cnv)-1)];
else
- *p = tokencnv[arc4random() % (sizeof tokencnv-1)];
+ *p = tokencnv[arc4random_uniform(sizeof(tokencnv)-1)];
}
*p = '\0';
}
diff --git a/libexec/tftp-proxy/tftp-proxy.c b/libexec/tftp-proxy/tftp-proxy.c
index 52db0d683c7..d2d2875717a 100644
--- a/libexec/tftp-proxy/tftp-proxy.c
+++ b/libexec/tftp-proxy/tftp-proxy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tftp-proxy.c,v 1.5 2008/03/24 16:11:00 deraadt Exp $
+/* $OpenBSD: tftp-proxy.c,v 1.6 2008/04/13 00:22:17 djm Exp $
*
* Copyright (c) 2005 DLS Internet Services
* Copyright (c) 2004, 2005 Camiel Dobbelaar, <cd@sentia.nl>
@@ -383,8 +383,8 @@ sock_ntop(struct sockaddr *sa)
u_int16_t
pick_proxy_port(void)
{
- return (IPPORT_HIFIRSTAUTO + (arc4random() %
- (IPPORT_HILASTAUTO - IPPORT_HIFIRSTAUTO)));
+ return (IPPORT_HIFIRSTAUTO +
+ arc4random_uniform(IPPORT_HILASTAUTO - IPPORT_HIFIRSTAUTO));
}
static void