diff options
author | Markus Uhlin <markus@nifty-networks.net> | 2023-12-25 07:07:05 +0100 |
---|---|---|
committer | Markus Uhlin <markus@nifty-networks.net> | 2023-12-25 07:07:05 +0100 |
commit | 5fb77c3337679d5661a3e14747481355fbc82bfd (patch) | |
tree | ad29badd5b13f1dccc12fe06c87e1859740d50ac /FICS/fics_addplayer.c | |
parent | 74b8ab228e7fc36f2a648b4e6b206c45d289aa85 (diff) |
Fix the salt
Diffstat (limited to 'FICS/fics_addplayer.c')
-rw-r--r-- | FICS/fics_addplayer.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/FICS/fics_addplayer.c b/FICS/fics_addplayer.c index fb7e831..2c9518d 100644 --- a/FICS/fics_addplayer.c +++ b/FICS/fics_addplayer.c @@ -25,9 +25,10 @@ */ #include "stdinclude.h" +#include "common.h" #include "command.h" -#include "common.h" +#include "fics_getsalt.h" #include "playerdb.h" #include "utils.h" @@ -51,7 +52,7 @@ PUBLIC int main(int argc, char *argv[]) { char password[PASSLEN + 1]; - char salt[6]; + char salt[FICS_SALT_SIZE]; char text[2048]; int i; int p; @@ -115,12 +116,7 @@ main(int argc, char *argv[]) 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[p].passwd = xstrdup(crypt(password, salt)); parray[p].registered = 1; // parray[p].network_player = !local; |