Mod aaa-12 修改用户认证-端口占用问题

RCA:
SOL:
修改人:chenling
检视人:
This commit is contained in:
ChenLing 2019-09-12 16:16:30 +08:00
parent 8def9e3b6c
commit c454de6c7b
3 changed files with 24 additions and 8 deletions

View File

@ -305,6 +305,15 @@ ret_code authpara_config_mod_proc(uint source, uint config_type,
return RET_INPUTERR;
}
/*判断值是否修改 端口号不同 说明已经做了修改 其他值没有冲突 端口号需要判断冲突*/
rpc_log_info("port: %d local port:%d\n", auth_parameters->port, auth_para->port);
if(auth_para->port != auth_parameters->port)
{
if( 1 == _valid_port(auth_parameters->port)){
err_msg = "认证端口被占用";
}
}
if((auth_parameters->timehorizon < HORIZON_MIN_VALUE) || (auth_parameters->timehorizon > HORIZON_MAX_VALUE)) {
err_msg = "认证时间范围无效";
} else if((auth_parameters->failcount < FAIL_MIN_NUM) || (auth_parameters->failcount > FAIL_MAX_NUM)) {
@ -315,8 +324,6 @@ ret_code authpara_config_mod_proc(uint source, uint config_type,
err_msg = "老化时间无效";
} else if((auth_parameters->port < PARA_DPORT_MIN_NUM) || (auth_parameters->port > PARA_DPORT_MAX_NUM)) {
err_msg = "认证端口无效";
}else if( 1 == _valid_port(auth_parameters->port)){
err_msg = "认证端口被占用";
}
if(err_msg != NULL) {

View File

@ -82,6 +82,15 @@ void mod_authpara(int port, int timehorizon, int failcount, int locktime, int ag
return;
}
/*判断值是否修改 端口号不同 说明已经做了修改 其他值没有冲突 端口号需要判断冲突*/
rpc_log_info("port: %d, auth_para->port: %d\n", port, auth_para->port);
if(port != auth_para->port)
{
if( 1 == _valid_port(port)){
err_msg = "认证端口被占用";
}
}
/*修改的时候判断修改的参数是否有效*/
if((timehorizon < HORIZON_MIN_VALUE) || (timehorizon > HORIZON_MAX_VALUE)) {
err_msg = "认证时间范围无效";
@ -93,9 +102,7 @@ void mod_authpara(int port, int timehorizon, int failcount, int locktime, int ag
err_msg = "老化时间无效";
} else if((port < PARA_DPORT_MIN_NUM) || (port > PARA_DPORT_MAX_NUM)) {
err_msg = "认证端口无效";
} else if( 1 == _valid_port(port)){
err_msg = "认证端口被占用";
}
}
if(err_msg != NULL) {
configure_result->resultcode = MOD_AUTHPARA_FAIL;

View File

@ -87,9 +87,9 @@ typedef struct {
} mod_portal_plugin_data;
char * mes[]={"SUCCESS", "ErrorUsernameOrpassword", "NotInVaildTime",
"OutMaxOnlineNum", "UserIsLocked", "LackConfigInfo",
"OverMaxOnlineNum", "OtherErr"};
char * mes[]={"认证成功", "用户名或密码错误", "不在有效时间范围内",
             "只允许单个用户登录", "用户锁定", "缺少配置信息", "输入错误",
             "超过最大用户连接数", "其他错误", "连接数据库失败"};
/**
@ -686,3 +686,5 @@ int mod_portal_plugin_init(plugin *p) {
return 0;
}