diff --git a/conf.c b/conf.c index c77f09c..7c189bc 100644 --- a/conf.c +++ b/conf.c @@ -207,8 +207,6 @@ static void parse_global_module(char *content, conf * conf) conf->CLAMAV_ARG_LEN = val_begin_len; if (copy_new_mem(val_begin, val_begin_len, &conf->CLAMAV_ARG) != 0) return; - } else { - conf->CLAMAV_ARG_LEN = 0; } // 磁盘使用率 @@ -322,16 +320,16 @@ void free_conf(conf * conf) void ptintf_conf(conf * conf) { if (conf->DAEMON) - printf("%s\n", conf->DAEMON); - printf("%d\n", conf->TIME); - printf("%d\n", conf->REFUSE_NUMBER); - printf("%d\n", conf->IS_MAIL); - printf("%d\n", conf->IS_DING_WEBHOOK); + printf("DAEMON %s\n", conf->DAEMON); + printf("TIME %d\n", conf->TIME); + printf("REFUSE_NUMBER %d\n", conf->REFUSE_NUMBER); + printf("IS_MAIL %d\n", conf->IS_MAIL); + printf("IS_DING_WEBHOOK %d\n", conf->IS_DING_WEBHOOK); if (conf->PHONE) - printf("%s\n", conf->PHONE); + printf("PHONE %s\n", conf->PHONE); if (conf->DING_WEBHOOK) - printf("%s\n", conf->DING_WEBHOOK); - printf("%d\n", conf->IS_QQMAIL); + printf("DING_WEBHOOK %s\n", conf->DING_WEBHOOK); + printf("IS_QQMAIL %d\n", conf->IS_QQMAIL); /* if (conf->SEND_QQ) printf("%s\n", conf->SEND_QQ); @@ -339,17 +337,20 @@ void ptintf_conf(conf * conf) printf("%s\n", conf->QQMAIL_KEY); */ if (conf->RECV_MAIL) - printf("%s\n", conf->RECV_MAIL); + printf("RECV_MAIL %s\n", conf->RECV_MAIL); if (conf->PUBLIC_IP) - printf("%s\n", conf->PUBLIC_IP); + printf("PUBLIC_IP %s\n", conf->PUBLIC_IP); - printf("%d\n", conf->IPV4_RESTRICTION); + printf("IPV4_RESTRICTION %d\n", conf->IPV4_RESTRICTION); if (conf->IPV4_WHITE_LIST) - printf("%s\n", conf->IPV4_WHITE_LIST); + printf("IPV4_WHITE_LIST %s\n", conf->IPV4_WHITE_LIST); - printf("%d\n", conf->REGION); + printf("REGION %d\n", conf->REGION); if (conf->REGION_LIST) - printf("%s\n", conf->REGION_LIST); + printf("REGION_LIST %s\n", conf->REGION_LIST); + + if (conf->CLAMAV_ARG) + printf("CLAMAV_ARG %s %d\n", conf->CLAMAV_ARG, conf->CLAMAV_ARG_LEN); } void split_string(char string[], char delims[], char (*whitelist_ip)[WHITELIST_IP_NUM]) diff --git a/rhost.c b/rhost.c index 1f4f5fe..f5213b2 100644 --- a/rhost.c +++ b/rhost.c @@ -957,7 +957,7 @@ int main(int argc, char *argv[], char **env) read_conf(path, conf); //ptintf_conf(conf); - if (0 == conf->CLAMAV_ARG_LEN) + if (0 >= conf->CLAMAV_ARG_LEN) { printf("\033[31mError reading configuration file, please check the configuration file!\033[0m\n");