summaryrefslogtreecommitdiffstats
path: root/pw
diff options
context:
space:
mode:
authorAndrey A. Chernov <ache@FreeBSD.org>1997-06-14 00:27:03 +0000
committerAndrey A. Chernov <ache@FreeBSD.org>1997-06-14 00:27:03 +0000
commit2d7451b1f9e9a3d3276161f631c96b7b8d672bc7 (patch)
treea49f684a3af0bd9467ed37addca1be612ff87413 /pw
parentd612a84ce8fe30c55e3c95006986bf99afe3a144 (diff)
downloadpw-darwin-2d7451b1f9e9a3d3276161f631c96b7b8d672bc7.tar.gz
pw-darwin-2d7451b1f9e9a3d3276161f631c96b7b8d672bc7.tar.zst
pw-darwin-2d7451b1f9e9a3d3276161f631c96b7b8d672bc7.zip
Remove srandomdev fallback code
Diffstat (limited to 'pw')
-rw-r--r--pw/pw_user.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/pw/pw_user.c b/pw/pw_user.c
index b478c7b..b7f146d 100644
--- a/pw/pw_user.c
+++ b/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);