aboutsummaryrefslogtreecommitdiffstats
path: root/FICS/adminproc.c
diff options
context:
space:
mode:
Diffstat (limited to 'FICS/adminproc.c')
-rw-r--r--FICS/adminproc.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/FICS/adminproc.c b/FICS/adminproc.c
index d7c5bdc..6f10d94 100644
--- a/FICS/adminproc.c
+++ b/FICS/adminproc.c
@@ -26,6 +26,7 @@
#include "adminproc.h"
#include "command.h"
#include "comproc.h"
+#include "fics_getsalt.h"
#include "gamedb.h"
#include "gameproc.h"
#include "multicol.h"
@@ -935,7 +936,7 @@ com_addplayer(int p, param_list param)
char *newplayer = param[0].val.word;
char newplayerlower[MAX_LOGIN_NAME];
char password[PASSLEN + 1];
- char salt[6];
+ char salt[FICS_SALT_SIZE];
char text[2048];
int i;
int p1;
@@ -980,12 +981,7 @@ com_addplayer(int p, param_list param)
password[i] = ('a' + rand() % 26);
password[i] = '\0';
- salt[0] = '$';
- salt[1] = '1';
- salt[2] = '$';
- salt[3] = ('a' + rand() % 26);
- salt[4] = ('a' + rand() % 26);
- salt[5] = '\0';
+ strcpy(salt, fics_getsalt());
parray[p1].passwd = xstrdup(crypt(password, salt));
} else {
@@ -1185,7 +1181,7 @@ PUBLIC int com_cmuzzle(int p, param_list param)
PUBLIC int
com_asetpasswd(int p, param_list param)
{
- char salt[6];
+ char salt[FICS_SALT_SIZE];
char subject[400];
char text[10100];
int p1, connected;
@@ -1219,12 +1215,7 @@ com_asetpasswd(int p, param_list param)
sprintf(text, "Password of %s is now useless. Your account at "
"our FICS has been locked.\n", parray[p1].name);
} else {
- salt[0] = '$';
- salt[1] = '1';
- salt[2] = '$';
- salt[3] = ('a' + rand() % 26);
- salt[4] = ('a' + rand() % 26);
- salt[5] = '\0';
+ strcpy(salt, fics_getsalt());
parray[p1].passwd = xstrdup(crypt(param[1].val.word, salt));