From a1b460b73e33c88f73c85992d83b0e92a87b9278 Mon Sep 17 00:00:00 2001 From: "Andrey A. Chernov" Date: Mon, 10 Mar 1997 07:46:03 +0000 Subject: [PATCH] Add ^ getpid() for better srandom results --- usr.bin/passwd/local_passwd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.bin/passwd/local_passwd.c b/usr.bin/passwd/local_passwd.c index bb9cd7ce066..b28d673b41e 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$ + * $Id: local_passwd.c,v 1.13 1997/02/22 19:56:34 peter Exp $ */ #ifndef lint @@ -152,7 +152,7 @@ getnewpasswd(pw, nis) (void)printf("Mismatch; try again, EOF to quit.\n"); } /* grab a random printable character that isn't a colon */ - (void)srandom((int)time((time_t *)NULL)); + (void)srandom((unsigned)(time(NULL) ^ getpid())); #ifdef NEWSALT salt[0] = _PASSWORD_EFMT1; to64(&salt[1], (long)(29 * 25), 4); -- 2.45.2