@@ -198,8 +198,8 @@ function read_query(packet)
198
198
string.sub (user_pwd , pos + 1 )
199
199
}
200
200
end
201
- elseif string.find (query , " ^add %s+pwd %s+(.+):(.+)$" ) then
202
- local user , pwd = string.match (query , " ^add %s+pwd %s+(.+):(.+)$" )
201
+ elseif string.find (query , " ^[aA][dD][dD] %s+[pP][wW][dD] %s+(.+):(.+)$" ) then
202
+ local user , pwd = string.match (query , " ^[aA][dD][dD] %s+[pP][wW][dD] %s+(.+):(.+)$" )
203
203
local ret = proxy .global .backends (user , pwd , 1 )
204
204
205
205
if ret == 1 then
@@ -216,8 +216,8 @@ function read_query(packet)
216
216
{ name = " status" ,
217
217
type = proxy .MYSQL_TYPE_STRING },
218
218
}
219
- elseif string.find (query , " ^add %s+enpwd %s+(.+):(.+)$" ) then
220
- local user , pwd = string.match (query , " ^add %s+enpwd %s+(.+):(.+)$" )
219
+ elseif string.find (query , " ^[aA][dD][dD] %s+[eE][nN][pP][wW][dD] %s+(.+):(.+)$" ) then
220
+ local user , pwd = string.match (query , " ^[aA][dD][dD] %s+[eE][nN][pP][wW][dD] %s+(.+):(.+)$" )
221
221
local ret = proxy .global .backends (user , pwd , 2 )
222
222
223
223
if ret == 1 then
@@ -234,8 +234,8 @@ function read_query(packet)
234
234
{ name = " status" ,
235
235
type = proxy .MYSQL_TYPE_STRING },
236
236
}
237
- elseif string.find (query , " ^remove %s+pwd %s+(.+)$" ) then
238
- local user = string.match (query , " ^remove %s+pwd %s+(.+)$" )
237
+ elseif string.find (query , " ^[rR][eE][mM][oO][vV][eE] %s+[pP][wW][dD] %s+(.+)$" ) then
238
+ local user = string.match (query , " ^[rR][eE][mM][oO][vV][eE] %s+[pP][wW][dD] %s+(.+)$" )
239
239
local ret = proxy .global .backends (user , nil , 3 )
240
240
241
241
if ret == 1 then
@@ -280,7 +280,8 @@ function read_query(packet)
280
280
rows [# rows + 1 ] = { " REMOVE CLIENT $client" , " example: \" remove client 192.168.1.2\" , ..." }
281
281
282
282
rows [# rows + 1 ] = { " SELECT * FROM pwds" , " lists the pwds" }
283
- rows [# rows + 1 ] = { " ADD PWD $pwd" , " example: \" add pwd user:password\" , ..." }
283
+ rows [# rows + 1 ] = { " ADD PWD $pwd" , " example: \" add pwd user:raw_password\" , ..." }
284
+ rows [# rows + 1 ] = { " ADD ENPWD $pwd" , " example: \" add enpwd user:encrypted_password\" , ..." }
284
285
rows [# rows + 1 ] = { " REMOVE PWD $pwd" , " example: \" remove pwd user\" , ..." }
285
286
286
287
rows [# rows + 1 ] = { " SAVE CONFIG" , " save the backends to config file" }
0 commit comments