From a340e72bff7cda56735666839b2746c30bc5008e Mon Sep 17 00:00:00 2001 From: ache Date: Mon, 10 Mar 1997 07:46:03 +0000 Subject: Add ^ getpid() for better srandom results --- usr.bin/passwd/local_passwd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'usr.bin/passwd') diff --git a/usr.bin/passwd/local_passwd.c b/usr.bin/passwd/local_passwd.c index bb9cd7c..b28d673 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); -- cgit v1.1