--- lbbs/src/init.c 2025/06/04 13:27:09 1.22 +++ lbbs/src/init.c 2025/10/10 01:55:06 1.30 @@ -14,19 +14,19 @@ * * ***************************************************************************/ -#include "init.h" -#include "database.h" #include "bbs.h" #include "common.h" -#include "log.h" +#include "database.h" +#include "init.h" #include "io.h" -#include -#include +#include "log.h" #include +#include +#include +#include #include -#include #include -#include +#include #define CONF_DELIM_WITH_SPACE " \t\r\n" @@ -71,6 +71,7 @@ int load_conf(const char *conf_file) char *saveptr = NULL; char *p, *q, *r; char *y, *m, *d; + int v; FILE *fin; // Load configuration @@ -130,11 +131,11 @@ int load_conf(const char *conf_file) } else if (strcasecmp(p, "bbs_port") == 0) { - BBS_port = (in_port_t)atoi(q); + BBS_port[0] = (in_port_t)atoi(q); } - else if (strcasecmp(p, "bbs_ssh") == 0) + else if (strcasecmp(p, "bbs_ssh_port") == 0) { - BBS_ssh_v2 = (strcasecmp(q, "v2") == 0 ? 1 : 0); + BBS_port[1] = (in_port_t)atoi(q); } else if (strcasecmp(p, "bbs_max_client") == 0) { @@ -174,7 +175,17 @@ int load_conf(const char *conf_file) log_error("Ignore config bbs_start_dt with incorrect value\n"); continue; } - snprintf(BBS_start_dt, sizeof(BBS_start_dt), "%4sÄê%2sÔÂ%2sÈÕ", y, m, d); + snprintf(BBS_start_dt, sizeof(BBS_start_dt), "%4så¹´%2s月%2sæ—¥", y, m, d); + } + else if (strcasecmp(p, "bbs_sys_id") == 0) + { + v = atoi(q); + if (v <= 0 || v > BBS_MAX_USER_LIMIT) + { + log_error("Ignore config bbs_sys_id with incorrect value %d\n", v); + continue; + } + BBS_sys_id = v; } else if (strcasecmp(p, "db_host") == 0) {