Merge branch 'master' of http://git.komect.net/ISG/secogateway
This commit is contained in:
commit
16c4b122bb
|
@ -28,7 +28,7 @@ enum
|
|||
/* 数据库TABLE属性 */
|
||||
#define DB_ROWS 20 /* 支持的最大列数 */
|
||||
#define DB_COLUMN 1 /* 单次查询获取的条目数 */
|
||||
#define DB_ROWS_MAX_LEN 50 /* 列支持的最大长度。单位:字节 */
|
||||
#define DB_ROWS_MAX_LEN 99 /* 列支持的最大长度。单位:字节 */
|
||||
|
||||
/*********************************************************************************
|
||||
* Description:
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
#include "stdlib.h"
|
||||
#include "redisMq.h"
|
||||
|
||||
|
||||
/*定义结构体 存认证参数*/
|
||||
auth_parameters_t *auth_para;
|
||||
|
||||
|
@ -33,6 +32,14 @@ int authparInit()
|
|||
if(NULL == auth_para) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
memset(auth_para, 0, sizeof(auth_parameters_t));
|
||||
/*设置默认值*/
|
||||
auth_para->port = 8080;
|
||||
auth_para->timehorizon = 1;
|
||||
auth_para->failcount = 5;
|
||||
auth_para->locktime = 10;
|
||||
auth_para->aging_time = 10;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -109,7 +116,7 @@ int set_agingtimecfg_waitack(int *agingtime)
|
|||
|
||||
/*检查IP地址是否有效,端口号是否被占用 */
|
||||
int _valid_port(int port)
|
||||
{
|
||||
{
|
||||
int fd;
|
||||
int i;
|
||||
struct sockaddr_in addr;
|
||||
|
@ -118,10 +125,10 @@ int _valid_port(int port)
|
|||
if(fd == -1) { /*检查是否正常初始化socket */
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
addr.sin_family = AF_INET; /*地址结构的协议簇 */
|
||||
addr.sin_port = htons(port); /*地址结构的端口地址,网络字节序 */
|
||||
|
||||
inet_pton(AF_INET, "127.0.0.1", &addr.sin_addr);
|
||||
i = (bind(fd, (struct sockaddr *)&addr, sizeof(struct sockaddr)));
|
||||
printf("the value of i:%d\n", i);
|
||||
close(fd);
|
||||
|
@ -134,10 +141,46 @@ int _valid_port(int port)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/*获取json串类型*/
|
||||
ret_code authpara_config_json_type(pointer input, uint *conf_type)
|
||||
{
|
||||
const char *pString = (char *)input;
|
||||
cJSON *cjson, *type;
|
||||
|
||||
if(!pString) {
|
||||
return RET_INPUTERR;
|
||||
}
|
||||
|
||||
printf("json:[%s]\n", pString);
|
||||
|
||||
/*JSON字符串到JSON格式 */
|
||||
cjson = cJSON_Parse(input);
|
||||
|
||||
if(!cjson) {
|
||||
return RET_INPUTERR;
|
||||
}
|
||||
|
||||
/*获取操作类型 add、mod、del */
|
||||
type = cJSON_GetObjectItem(cjson, "type");
|
||||
|
||||
if(!type) {
|
||||
cJSON_Delete(cjson);
|
||||
return RET_INPUTERR;
|
||||
}
|
||||
|
||||
if(conf_type) {
|
||||
*conf_type = type->valueint;
|
||||
}
|
||||
|
||||
cJSON_Delete(cjson);
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
|
||||
/* iuput格式:{"type": 0, "data": {"port": 1010,"timehorizon": 10,"failcount": 20,"locktime":30, "aging_time":10}}*/
|
||||
ret_code authpara_config_json_parse(pointer input, uint *conf_type, auth_parameters_t *authpara_buff)
|
||||
{
|
||||
char *pString = (char *)input;
|
||||
char *pString = (char *)input;
|
||||
cJSON *cjson, *type, *data;
|
||||
|
||||
printf("json:[%s]\n", pString);
|
||||
|
@ -197,6 +240,7 @@ ret_code authpara_config_json_parse(pointer input, uint *conf_type, auth_paramet
|
|||
return RET_OK;
|
||||
}
|
||||
|
||||
#if 0
|
||||
/* 发布配置的本地Portal server 的port*/
|
||||
void local_portal_port(char *port)
|
||||
{
|
||||
|
@ -221,7 +265,7 @@ void local_portal_port(char *port)
|
|||
redisPubUninit();
|
||||
return;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
ret_code authpara_config_chk(uint source, uint *config_type,
|
||||
pointer input, int *input_len,
|
||||
|
@ -232,43 +276,74 @@ ret_code authpara_config_chk(uint source, uint *config_type,
|
|||
}
|
||||
|
||||
|
||||
ret_code authpara_config_proc(uint source, uint config_type,
|
||||
ret_code authpara_config_mod_proc(uint source, uint config_type,
|
||||
pointer input, int input_len,
|
||||
pointer output, int *output_len)
|
||||
{
|
||||
configure_result_t *configure_result;
|
||||
configure_result_t configure_result;
|
||||
cJSON *res;
|
||||
char auth_port[20];
|
||||
ret_code ret = RET_OK;
|
||||
auth_parameters_t auth_parameters = {0};
|
||||
auth_parameters_t *auth_parameters;
|
||||
uint conf_type = AUTHPARA_CONFIG_MOD;
|
||||
char *ret_char = NULL;
|
||||
unsigned int ret_int = 0;
|
||||
int portresult = 0;
|
||||
|
||||
authpara_config_json_parse(input, &conf_type, &auth_parameters);
|
||||
auth_parameters = (auth_parameters_t *)malloc(sizeof(auth_parameters_t));
|
||||
|
||||
if(auth_parameters == NULL) {
|
||||
return RET_NOMEM;
|
||||
}
|
||||
|
||||
authpara_config_json_parse(input, &conf_type, auth_parameters);
|
||||
|
||||
/*判断长度*/
|
||||
if(input_len < sizeof(auth_parameters_t)) {
|
||||
return RET_INPUTERR;
|
||||
}
|
||||
|
||||
portresult = _valid_port(auth_parameters.port);
|
||||
|
||||
/*判断端口号是否占用*/
|
||||
portresult = _valid_port(auth_parameters->port);
|
||||
printf("portresult:%d\n", portresult);
|
||||
|
||||
if(portresult == 1) {
|
||||
if(portresult != 0) {
|
||||
cJSON *port;
|
||||
char *ret_port;
|
||||
unsigned int port_int = 0;
|
||||
/*创建json对象 */
|
||||
port = cJSON_CreateObject();
|
||||
|
||||
if(!port) {
|
||||
ret = RET_ERR;
|
||||
return ret;
|
||||
}
|
||||
|
||||
cJSON_AddNumberToObject(port, "resultcode", 1);
|
||||
cJSON_AddStringToObject(port, "message", "mod failure");
|
||||
ret_port = cJSON_PrintUnformatted(port);
|
||||
port_int = strlen(ret_port);
|
||||
|
||||
if(output_len) {
|
||||
*output_len = port_int + 1;
|
||||
}
|
||||
|
||||
/*超出2k的内存,报错 */
|
||||
if(port_int >= 1024 * 2) {
|
||||
free(ret_port);
|
||||
cJSON_Delete(port);
|
||||
return RET_NOMEM;
|
||||
}
|
||||
|
||||
memcpy(output, ret_port, port_int);
|
||||
|
||||
free(ret_port);
|
||||
cJSON_Delete(port);
|
||||
return RET_CHKERR;
|
||||
}
|
||||
|
||||
|
||||
/*数据库修改 存入全局变量*/
|
||||
configure_result = (configure_result_t *)malloc(sizeof(configure_result_t));
|
||||
|
||||
if(NULL == configure_result) {
|
||||
return RET_NOMEM;
|
||||
}
|
||||
|
||||
mod_authpara(auth_parameters.port, auth_parameters.timehorizon, auth_parameters.failcount,
|
||||
auth_parameters.locktime, auth_parameters.aging_time, configure_result);
|
||||
mod_authpara(auth_parameters->port, auth_parameters->timehorizon, auth_parameters->failcount,
|
||||
auth_parameters->locktime, auth_parameters->aging_time, &configure_result);
|
||||
|
||||
/*共享内存 传送用户态和内核态之间的配置信息*/
|
||||
|
||||
|
@ -315,16 +390,81 @@ ret_code authpara_config_proc(uint source, uint config_type,
|
|||
res = cJSON_CreateObject();
|
||||
|
||||
if(!res) {
|
||||
free(configure_result);
|
||||
ret = RET_ERR;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*将json对象转换成json字符串 返回处理结果*/
|
||||
printf("resultcode = %d\n", configure_result->resultcode);
|
||||
printf("message = %s\n", configure_result->message);
|
||||
cJSON_AddNumberToObject(res, "resultcode", configure_result->resultcode);
|
||||
cJSON_AddStringToObject(res, "message", configure_result->message);
|
||||
printf("resultcode = %d\n", configure_result.resultcode);
|
||||
printf("message = %s\n", configure_result.message);
|
||||
cJSON_AddNumberToObject(res, "resultcode", configure_result.resultcode);
|
||||
cJSON_AddStringToObject(res, "message", configure_result.message);
|
||||
ret_char = cJSON_PrintUnformatted(res);
|
||||
ret_int = strlen(ret_char);
|
||||
|
||||
if(output_len) {
|
||||
*output_len = ret_int + 1;
|
||||
}
|
||||
|
||||
/*超出2k的内存,报错 */
|
||||
if(ret_int >= 1024 * 2) {
|
||||
free(ret_char);
|
||||
cJSON_Delete(res);
|
||||
return RET_NOMEM;
|
||||
}
|
||||
|
||||
memcpy(output, ret_char, ret_int);
|
||||
|
||||
free(auth_parameters);
|
||||
free(ret_char);
|
||||
cJSON_Delete(res);
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
|
||||
ret_code authpara_config_get_proc(uint source, uint config_type,
|
||||
pointer input, int input_len,
|
||||
pointer output, int *output_len)
|
||||
{
|
||||
cJSON *res;
|
||||
cJSON *data;
|
||||
ret_code ret = RET_OK;
|
||||
uint conf_type = AUTHPARA_CONFIG_MOD;
|
||||
char *ret_data = NULL;
|
||||
char *ret_char = NULL;
|
||||
unsigned int ret_int = 0;
|
||||
int portresult = 0;
|
||||
|
||||
/*获取的数据存入全局变量*/
|
||||
/*创建json对象 */
|
||||
data = cJSON_CreateObject();
|
||||
|
||||
if(!data) {
|
||||
ret = RET_ERR;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*将json对象转换成json字符串 返回处理结果*/
|
||||
cJSON_AddNumberToObject(data, "port", auth_para->port);
|
||||
cJSON_AddNumberToObject(data, "timehorizon", auth_para->timehorizon);
|
||||
cJSON_AddNumberToObject(data, "failcount", auth_para->failcount);
|
||||
cJSON_AddNumberToObject(data, "locktime", auth_para->locktime);
|
||||
cJSON_AddNumberToObject(data, "aging_time", auth_para->aging_time);
|
||||
|
||||
ret_data = cJSON_PrintUnformatted(data);
|
||||
|
||||
/*创建json对象 */
|
||||
res = cJSON_CreateObject();
|
||||
|
||||
if(!res) {
|
||||
ret = RET_ERR;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*将json对象转换成json字符串 返回处理结果*/
|
||||
cJSON_AddNumberToObject(res, "resultcode", 2);
|
||||
cJSON_AddStringToObject(res, "message", "get success");
|
||||
cJSON_AddStringToObject(res, "data", ret_data);
|
||||
ret_char = cJSON_PrintUnformatted(res);
|
||||
ret_int = strlen(ret_char);
|
||||
|
||||
|
@ -334,7 +474,6 @@ ret_code authpara_config_proc(uint source, uint config_type,
|
|||
|
||||
/*超出2k的内存,报错 */
|
||||
if(ret_int >= 1024 * 2) {
|
||||
free(configure_result);
|
||||
free(ret_char);
|
||||
cJSON_Delete(res);
|
||||
return RET_NOMEM;
|
||||
|
@ -343,7 +482,39 @@ ret_code authpara_config_proc(uint source, uint config_type,
|
|||
memcpy(output, ret_char, ret_int);
|
||||
|
||||
free(ret_char);
|
||||
free(ret_data);
|
||||
cJSON_Delete(res);
|
||||
free(configure_result);
|
||||
cJSON_Delete(data);
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
|
||||
ret_code authpara_config_proc(uint source, uint config_type,
|
||||
pointer input, int input_len,
|
||||
pointer output, int *output_len)
|
||||
{
|
||||
ret_code ret = RET_OK;
|
||||
uint conf_type = AUTHPARA_CONFIG_GET;
|
||||
|
||||
authpara_config_json_type(input, &conf_type);
|
||||
rpc_log_info("config type is %d\n", conf_type);
|
||||
|
||||
switch(conf_type) {
|
||||
case AUTHPARA_CONFIG_MOD:
|
||||
ret = authpara_config_mod_proc(source, conf_type,
|
||||
input, input_len,
|
||||
output, output_len);
|
||||
break;
|
||||
|
||||
case AUTHPARA_CONFIG_GET:
|
||||
ret = authpara_config_get_proc(source, conf_type,
|
||||
input, input_len,
|
||||
output, output_len);
|
||||
break;
|
||||
|
||||
default:
|
||||
ret = RET_NOTSUPPORT;
|
||||
}
|
||||
|
||||
return RET_OK;
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#define HORIZON_MIN_VALUE 0 /*认证时间范围的最小值 */
|
||||
|
||||
#define AUTHPARA_CONFIG_MOD 0
|
||||
#define AUTHPARA_CONFIG_GET 1
|
||||
|
||||
|
||||
/*配置消息 */
|
||||
|
@ -40,17 +41,30 @@ int set_agingtimecfg_waitack(int *agingtime);
|
|||
/*检查IP地址是否有效,端口号是否被占用 */
|
||||
int _valid_port(int port);
|
||||
|
||||
/*获取json串类型*/
|
||||
ret_code authpara_config_json_type(pointer input, uint *conf_type);
|
||||
|
||||
/* iuput格式:{"type": 0, "data": {"port": 1010,"timehorizon": 10,"failcount": 20,"locktime":30, "aging_time":10}}*/
|
||||
ret_code authpara_config_json_parse(pointer input, uint *conf_type, auth_parameters_t *authpara_buff);
|
||||
|
||||
/*检查增加的参数格式是否正确 */
|
||||
ret_code authpara_config_chk(uint source, uint *config_type,
|
||||
pointer input, int *input_len,
|
||||
pointer output, int *output_len);
|
||||
pointer input, int *input_len,
|
||||
pointer output, int *output_len);
|
||||
|
||||
/*修改认证参数*/
|
||||
ret_code authpara_config_mod_proc(uint source, uint config_type,
|
||||
pointer input, int input_len,
|
||||
pointer output, int *output_len);
|
||||
|
||||
/*查询认证参数*/
|
||||
ret_code authpara_config_get_proc(uint source, uint config_type,
|
||||
pointer input, int input_len,
|
||||
pointer output, int *output_len);
|
||||
|
||||
ret_code authpara_config_proc(uint source, uint config_type,
|
||||
pointer input, int input_len,
|
||||
pointer output, int *output_len);
|
||||
pointer input, int input_len,
|
||||
pointer output, int *output_len);
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ freeauth_configure_t freeauth_array[RULE_MAX_NUM] = {0};
|
|||
/*存储序列号的数组*/
|
||||
int rule_order[RULE_MAX_NUM] = {0};
|
||||
|
||||
#define UNAMESIZE (60 + 1)
|
||||
#define UNAMESIZE (63 + 1)
|
||||
#define SPECHAR(element) (strpbrk((element), "~!@#$%^&*()_+{}|:\"<>?\\,./;\'[]-=`")) //校验特殊字符
|
||||
|
||||
#ifdef FREEAUTH_ACK_COOKIES
|
||||
|
|
|
@ -271,7 +271,7 @@ void mov_authfree(char *name, int after_arry, authfree_result_t *authfree_result
|
|||
|
||||
}
|
||||
|
||||
/*修改成功*/
|
||||
/*移动成功*/
|
||||
authfree_result->resultcode = MOV_RULE_SUCCESS;
|
||||
authfree_result->message = get_sql_ret_message(authfree_result->resultcode);
|
||||
}
|
||||
|
@ -407,12 +407,12 @@ void mod_authfree(int rule_priority, char *name, uint32_t sip, uint32_t dip, int
|
|||
return;
|
||||
}
|
||||
|
||||
/*修改对应未认证权限数数组*/
|
||||
/*修改对应未认证权限数数组 优先级和未认证权限名不能修改*/
|
||||
for(i = 0; i < RULE_MAX_NUM; i++) {
|
||||
/*两个字符串相等 strcmp值为0*/
|
||||
if(0 == strcmp(freeauth_array[i].name, name)) {
|
||||
printf("%s(%d) freeauth_array[%d] = %p\n", __FUNCTION__, __LINE__, i, &freeauth_array[i]);
|
||||
freeauth_array[i].rule_priority = rule_priority;
|
||||
//freeauth_array[i].rule_priority = rule_priority;
|
||||
freeauth_array[i].sip = sip;
|
||||
freeauth_array[i].dip = dip;
|
||||
freeauth_array[i].dport = dport;
|
||||
|
|
|
@ -14,17 +14,19 @@
|
|||
extern auth_parameters_t *auth_para;
|
||||
extern void * auth_hdbc;
|
||||
|
||||
char * mes[]={"mod success", "mod failure"};
|
||||
char * mes[]={"mod success", "mod failure", "get success", "get failure"};
|
||||
|
||||
/*前端type类型只有修改,修改数据库中的内容,返回值为code message——修改成功 修改失败*/
|
||||
void mod_authpara(int port, int timehorizon, int failcount, int locktime, int aging_time, configure_result_t *configure_result)
|
||||
{
|
||||
#if 0
|
||||
authparInit();
|
||||
//void * authpara_hdbc;
|
||||
void * authpara_hdbc;
|
||||
char * ret_sql = NULL;
|
||||
int ret;
|
||||
int num;
|
||||
int r = -1;
|
||||
#endif
|
||||
|
||||
if (NULL == configure_result)
|
||||
{
|
||||
|
@ -88,7 +90,10 @@ void mod_authpara(int port, int timehorizon, int failcount, int locktime, int ag
|
|||
auth_para->failcount = failcount;
|
||||
auth_para->locktime = locktime;
|
||||
auth_para->aging_time = aging_time;
|
||||
|
||||
|
||||
printf("[%d %d %d %d %d]\n", auth_para->port, auth_para->timehorizon, auth_para->failcount,
|
||||
auth_para->locktime, auth_para->aging_time);
|
||||
|
||||
configure_result->resultcode = 0;
|
||||
configure_result->message = mes[configure_result->resultcode];
|
||||
return;
|
||||
|
|
|
@ -149,7 +149,6 @@ int log_level_to_str(const u8 level, char *str, u32 len)
|
|||
|
||||
int write_conf_content(FILE *fp, const u8 level, const char *filter_mod, void *arg)
|
||||
{
|
||||
int i;
|
||||
int ret = -1;
|
||||
char line[MAX_LINE_SZ + 100] = {0};
|
||||
ULOG_DEBUG(g_log, "filter module:%s\n", filter_mod);
|
||||
|
@ -243,7 +242,7 @@ void rpc_conf_proc(rpc_conn *conn, pointer input, int input_len, int need_len, r
|
|||
|
||||
if (input_len < need_len) {
|
||||
if (snprintf(str_err, sizeof(str_err),
|
||||
"The input paramter of rpc log is needed length of %u, but the actual length is %u",
|
||||
"The input paramter of rpc log is needed length of %d, but the actual length is %d",
|
||||
need_len, input_len) < 0) {
|
||||
strncpy(str_err, "Setting error message is failure", sizeof(str_err));
|
||||
ULOG_ERR(g_log, str_err);
|
||||
|
@ -395,10 +394,8 @@ ret_code get_log_file_conf(const char *key_str, char *value_str, int value_len)
|
|||
return ret;
|
||||
}
|
||||
|
||||
ssize_t n, n1, n2;
|
||||
ssize_t n;
|
||||
char *line = NULL;
|
||||
char tmp_key[MAX_LINE_SZ], tmp_value[MAX_LINE_SZ];
|
||||
|
||||
while ((getline(&line, &n, g_conf_fp)) != -1)
|
||||
{
|
||||
if (strstr(line, key_str) == NULL )
|
||||
|
|
|
@ -138,7 +138,6 @@ ret_code console_initial()
|
|||
char *pos = NULL;
|
||||
char *pos2 = NULL;
|
||||
char ttyfile_str[128] = "";
|
||||
size_t str_len = 0;
|
||||
|
||||
fp = fopen(CM_LOG_CONF_CONSOLE_FILE, "r");
|
||||
if (NULL == fp) {
|
||||
|
@ -155,6 +154,7 @@ ret_code console_initial()
|
|||
|
||||
ssize_t n;
|
||||
char *line = NULL;
|
||||
int str_len;
|
||||
while ((getline(&line, &n, fp)) != -1)
|
||||
{
|
||||
pos = strstr(line, "/");
|
||||
|
|
|
@ -74,7 +74,6 @@ static ret_code write_pty_conf()
|
|||
static void *pty_monitor_thread(void *arg)
|
||||
{
|
||||
struct epoll_event events[MAX_EVENT_NUMBER];
|
||||
int ret;
|
||||
ret_code ret_c;
|
||||
char buf[MAX_LINE_SZ];
|
||||
ssize_t len;
|
||||
|
@ -84,7 +83,7 @@ static void *pty_monitor_thread(void *arg)
|
|||
ULOG_DEBUG(g_log, "Monitor pty is begining");
|
||||
while (1) {
|
||||
//ULOG_DEBUG(g_log, "Epoll is waiting");
|
||||
ret = epoll_wait(g_epoll_fd, events, MAX_EVENT_NUMBER, 1000);
|
||||
int ret = epoll_wait(g_epoll_fd, events, MAX_EVENT_NUMBER, 1000);
|
||||
if (ret == -1) {
|
||||
if (errno == EBADF) {
|
||||
ULOG_DEBUG(g_log, "Epoll has been shut or invalid");
|
||||
|
@ -273,7 +272,7 @@ static int config_log_pty(const log_pty_t *conf)
|
|||
/* off时,将log-sched配置文件中pty日志级别调成默认值info,即level=6 */
|
||||
if (0 == ret) {
|
||||
memset(value_str, 0, sizeof(value_str));
|
||||
sprintf(value_str, "%u", 6);
|
||||
snprintf(value_str, sizeof(value_str), "%u", LOG_INFO);
|
||||
if (write_log_file_conf(LOG_CONF_KEY_PTY_LEVEL_STR, value_str) != 0) {
|
||||
ULOG_ERR(g_log, "Pty-level which is written is failure");
|
||||
return -1;
|
||||
|
|
|
@ -35,11 +35,11 @@ static op_func remote_funcs[] = {
|
|||
|
||||
static int match_remote_config(const char *line, const void *src)
|
||||
{
|
||||
char text_level[MAX_LINE_SZ], old_redirect[MAX_LINE_SZ];
|
||||
char text_level[MAX_LINE_SZ + 1], old_redirect[MAX_LINE_SZ + 1];
|
||||
int n;
|
||||
|
||||
ULOG_DEBUG(g_log, "The line:%s will be matched", line);
|
||||
n = sscanf(line, "%s"REDIRECT_SEPERATE"%s", text_level, old_redirect);
|
||||
n = sscanf(line, "%1024s"REDIRECT_SEPERATE"%1024s", text_level, old_redirect);
|
||||
if (n == 2) {
|
||||
// 匹配到
|
||||
// 是否相同配置判读
|
||||
|
@ -81,7 +81,6 @@ static int remote_conf_content(FILE *fp, const u8 level, const char *filter_mod,
|
|||
|
||||
|
||||
ssize_t n, n1;
|
||||
char text_level[MAX_LINE_SZ], old_redirect[MAX_LINE_SZ];
|
||||
while ((n = getline(&line, &n, bak_fp)) != -1) {
|
||||
int match = match_cb(line, arg);
|
||||
if (match == -1) {
|
||||
|
@ -141,7 +140,7 @@ static int remote_conf_level_content(FILE *fp, const u8 level)
|
|||
char text_level[MAX_LINE_SZ], old_redirect[MAX_LINE_SZ];
|
||||
char rewrite_line[MAX_LINE_SZ];
|
||||
while ((n1 = getline(&line, &n, bak_fp)) != -1) {
|
||||
n3 = sscanf(line, "%s"REDIRECT_SEPERATE"%s", text_level, old_redirect);
|
||||
n3 = sscanf(line, "%1024s"REDIRECT_SEPERATE"%1024s", text_level, old_redirect);
|
||||
if (n3 == 2) {
|
||||
// 匹配到
|
||||
// 改变该行日志级别
|
||||
|
|
|
@ -56,6 +56,7 @@ typedef enum { WEBM_HANDLE_INVALID_INDEX = -1,
|
|||
WEBM_HANDLE_CONFIG_SHARED_NETWORK_GET,
|
||||
|
||||
WEBM_HANDLE_CONFIG_MOD_AUTHPARA,
|
||||
WEBM_HANDLE_CONFIG_GET_AUTHPARA,
|
||||
WEBM_HANDLE_CONFIG_ADD_AUTHRULE,
|
||||
WEBM_HANDLE_CONFIG_MOV_AUTHRULE,
|
||||
WEBM_HANDLE_CONFIG_DEL_AUTHRULE,
|
||||
|
@ -298,7 +299,15 @@ extern int webm_config_send_proc(server *srv, uint32_t config_type, uint64 confg
|
|||
WEBM_HANDLE_CONFIG_MOD_AUTHPARA, \
|
||||
"/FSG-CF/userauth-parameters-mod", \
|
||||
CM_CONFIG_SET, \
|
||||
FREEPARAMETERS_CONFIG , \
|
||||
FREEPARAMETERS_CONFIG, \
|
||||
webm_config_send_proc \
|
||||
}, \
|
||||
\
|
||||
{\
|
||||
WEBM_HANDLE_CONFIG_GET_AUTHPARA, \
|
||||
"/FSG-CF/userauth-parameters-get", \
|
||||
CM_CONFIG_SET, \
|
||||
FREEPARAMETERS_CONFIG, \
|
||||
webm_config_send_proc \
|
||||
}, \
|
||||
\
|
||||
|
|
Loading…
Reference in New Issue