summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--usr.bin/jot/jot.c7
-rw-r--r--usr.bin/passwd/local_passwd.c5
-rw-r--r--usr.sbin/ppp/chap.c5
-rw-r--r--usr.sbin/ppp/command.c8
-rw-r--r--usr.sbin/ppp/lcp.c5
-rw-r--r--usr.sbin/pw/pw_user.c12
6 files changed, 19 insertions, 23 deletions
diff --git a/usr.bin/jot/jot.c b/usr.bin/jot/jot.c
index dba1804..39b6d55 100644
--- a/usr.bin/jot/jot.c
+++ b/usr.bin/jot/jot.c
@@ -96,10 +96,9 @@ main(argc, argv)
getargs(argc, argv);
if (randomize) {
*x = (ender - begin) * (ender > begin ? 1 : -1);
- if (s == -1.0) {
- if (srandomdev() < 0)
- srandom(time(NULL) ^ getpid());
- } else
+ if (s == -1.0)
+ srandomdev();
+ else
srandom((unsigned long) s);
for (*i = 1; *i <= reps || infinity; (*i)++) {
*y = (double) random() / LONG_MAX;
diff --git a/usr.bin/passwd/local_passwd.c b/usr.bin/passwd/local_passwd.c
index b64f4f7..5e8a4bc 100644
--- a/usr.bin/passwd/local_passwd.c
+++ b/usr.bin/passwd/local_passwd.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: local_passwd.c,v 1.16 1997/03/24 16:10:26 ache Exp $
+ * $Id: local_passwd.c,v 1.17 1997/05/10 19:02:38 davidn Exp $
*/
#ifndef lint
@@ -155,8 +155,7 @@ getnewpasswd(pw, nis)
/* grab a random printable character that isn't a colon */
if (!randinit) {
randinit = 1;
- if (srandomdev() < 0)
- srandom((unsigned long)(time(NULL) ^ getpid()));
+ srandomdev();
}
#ifdef NEWSALT
salt[0] = _PASSWORD_EFMT1;
diff --git a/usr.sbin/ppp/chap.c b/usr.sbin/ppp/chap.c
index 0ca0c7f..681d95e 100644
--- a/usr.sbin/ppp/chap.c
+++ b/usr.sbin/ppp/chap.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: chap.c,v 1.17 1997/05/26 00:43:56 brian Exp $
+ * $Id: chap.c,v 1.18 1997/06/09 03:27:15 brian Exp $
*
* TODO:
*/
@@ -80,8 +80,7 @@ int chapid;
if (!randinit) {
randinit = 1;
- if (srandomdev() < 0)
- srandom((unsigned long)(time(NULL) ^ getpid()));
+ srandomdev();
}
cp = challenge_data;
diff --git a/usr.sbin/ppp/command.c b/usr.sbin/ppp/command.c
index 9d413a7..b13c110 100644
--- a/usr.sbin/ppp/command.c
+++ b/usr.sbin/ppp/command.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: command.c,v 1.55 1997/06/11 03:57:46 brian Exp $
+ * $Id: command.c,v 1.57 1997/06/13 03:59:34 brian Exp $
*
*/
#include <sys/types.h>
@@ -785,8 +785,7 @@ char **argv;
VarRedialTimeout = -1;
if (!randinit) {
randinit = 1;
- if (srandomdev() < 0)
- srandom((unsigned long)(time(NULL) ^ getpid()));
+ srandomdev();
}
} else {
timeout = atoi(argv[0]);
@@ -805,8 +804,7 @@ char **argv;
VarRedialNextTimeout = -1;
if (!randinit) {
randinit = 1;
- if (srandomdev() < 0)
- srandom((unsigned long)(time(NULL) ^ getpid()));
+ srandomdev();
}
}
else {
diff --git a/usr.sbin/ppp/lcp.c b/usr.sbin/ppp/lcp.c
index 522dbbee..8c99ab6 100644
--- a/usr.sbin/ppp/lcp.c
+++ b/usr.sbin/ppp/lcp.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: lcp.c,v 1.22 1997/06/01 03:43:22 brian Exp $
+ * $Id: lcp.c,v 1.23 1997/06/09 03:27:24 brian Exp $
*
* TODO:
* o Validate magic number received from peer.
@@ -183,8 +183,7 @@ GenerateMagic()
{
if (!randinit) {
randinit = 1;
- if (srandomdev() < 0)
- srandom((unsigned long)(time(NULL) ^ getpid()));
+ srandomdev();
}
return (random());
diff --git a/usr.sbin/pw/pw_user.c b/usr.sbin/pw/pw_user.c
index b478c7b..b7f146d 100644
--- a/usr.sbin/pw/pw_user.c
+++ b/usr.sbin/pw/pw_user.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: pw_user.c,v 1.19 1997/03/24 15:09:41 ache Exp $
+ * $Id: pw_user.c,v 1.20 1997/05/24 10:41:49 davidn Exp $
*/
#include <unistd.h>
@@ -840,9 +840,10 @@ pw_pwcrypt(char *password)
if (!randinit) {
randinit = 1;
#ifdef __FreeBSD__
- if (srandomdev() < 0)
+ srandomdev();
+#else
+ srandom((unsigned long) (time(NULL) ^ getpid()));
#endif
- srandom((unsigned long) (time(NULL) ^ getpid()));
}
for (i = 0; i < 8; i++)
salt[i] = chars[random() % 63];
@@ -912,9 +913,10 @@ pw_password(struct userconf * cnf, struct cargs * args, char const * user)
if (!randinit) {
randinit = 1;
#ifdef __FreeBSD__
- if (srandomdev() < 0)
+ srandomdev();
+#else
+ srandom((unsigned long) (time(NULL) ^ getpid()));
#endif
- srandom((unsigned long) (time(NULL) ^ getpid()));
}
l = (random() % 8 + 8); /* 8 - 16 chars */
pw_getrand(rndbuf, l);
OpenPOWER on IntegriCloud