void cmd_pas2(char *argbuf)
{
- char pw[SIZ];
+ char pw[256];
char hexstring[MD5_HEXSTRING_SIZE];
if (!strcmp(CC->curr_user, NLI))
{
- cprintf("%d You must enter a user with the USER command first.\n", ERROR);
+ cprintf("%d You must enter a user with the USER command first.\n", ERROR + USERNAME_REQUIRED);
return;
}
if (CC->logged_in)
{
- cprintf("%d Already logged in.\n", ERROR);
+ cprintf("%d Already logged in.\n", ERROR + ALREADY_LOGGED_IN);
return;
}
- extract(pw, argbuf, 0);
+ extract_token(pw, argbuf, 0, '|', sizeof pw);
if (getuser(&CC->user, CC->curr_user))
{
- cprintf("%d Unable to find user record for %s.\n", ERROR, CC->curr_user);
+ cprintf("%d Unable to find user record for %s.\n", ERROR + NO_SUCH_USER, CC->curr_user);
return;
}
if (strlen(pw) != (MD5_HEXSTRING_SIZE-1))
{
- cprintf("%d Auth string of length %ld is the wrong length (should be %d).\n", ERROR, (long)strlen(pw), MD5_HEXSTRING_SIZE-1);
+ cprintf("%d Auth string of length %ld is the wrong length (should be %d).\n", ERROR + ILLEGAL_VALUE, (long)strlen(pw), MD5_HEXSTRING_SIZE-1);
return;
}
}
else
{
- cprintf("%d Wrong password.\n", ERROR);
+ cprintf("%d Wrong password.\n", ERROR + PASSWORD_REQUIRED);
return;
}
}