Skip to content
Snippets Groups Projects
Commit d0b5f002 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

do_set_passwd(): fixed serious bug in salt generation.

parent 7804adef
No related branches found
No related tags found
No related merge requests found
/* /*
* $Id: person.c,v 0.10 1991/09/15 10:30:33 linus Exp $ * $Id: person.c,v 0.11 1991/09/25 09:45:33 ceder Exp $
* Copyright (C) 1991 Lysator Academic Computer Association. * Copyright (C) 1991 Lysator Academic Computer Association.
* *
* This file is part of the LysKOM server. * This file is part of the LysKOM server.
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
* All atomic calls that deals with persons. * All atomic calls that deals with persons.
*/ */
static char *rcsid = "$Id: person.c,v 0.10 1991/09/15 10:30:33 linus Exp $"; static char *rcsid = "$Id: person.c,v 0.11 1991/09/25 09:45:33 ceder Exp $";
#include <m-config.h> #include <m-config.h>
#include <time.h> #include <time.h>
...@@ -80,8 +80,8 @@ do_set_passwd( Password pwd, ...@@ -80,8 +80,8 @@ do_set_passwd( Password pwd,
if ( !legal_passwd(new_pwd) ) if ( !legal_passwd(new_pwd) )
return FAILURE; return FAILURE;
salt[0] = crypt_seed [rand() % sizeof (crypt_seed)]; salt[0] = crypt_seed [rand() % (sizeof (crypt_seed) - 1)];
salt[1] = crypt_seed [rand() % sizeof (crypt_seed)]; salt[1] = crypt_seed [rand() % (sizeof (crypt_seed) - 1)];
salt[2] = '\0'; salt[2] = '\0';
password = s_crea_c_str(new_pwd); password = s_crea_c_str(new_pwd);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment