| 32 |
#include <mysql/mysql.h> |
#include <mysql/mysql.h> |
| 33 |
#include <sys/param.h> |
#include <sys/param.h> |
| 34 |
|
|
| 35 |
|
static const int BBS_username_min_len = 3; // common len = 5, special len = 3 |
| 36 |
|
static const int BBS_password_min_len = 5; // legacy len = 5, current len = 6 |
| 37 |
|
|
| 38 |
int bbs_login(void) |
int bbs_login(void) |
| 39 |
{ |
{ |
| 40 |
char username[BBS_username_max_len + 1]; |
char username[BBS_username_max_len + 1]; |
| 122 |
ok = 0; |
ok = 0; |
| 123 |
} |
} |
| 124 |
} |
} |
| 125 |
if (ok && (i < 5 || i > BBS_username_max_len)) |
if (ok && (i < BBS_username_min_len || i > BBS_username_max_len)) |
| 126 |
{ |
{ |
| 127 |
ok = 0; |
ok = 0; |
| 128 |
} |
} |
| 133 |
ok = 0; |
ok = 0; |
| 134 |
} |
} |
| 135 |
} |
} |
| 136 |
if (ok && (i < 5 || i > BBS_password_max_len)) |
if (ok && (i < BBS_password_min_len || i > BBS_password_max_len)) |
| 137 |
{ |
{ |
| 138 |
ok = 0; |
ok = 0; |
| 139 |
} |
} |