mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 19:23:03 +01:00
Fixed CORE-1810: Usernames with '.' character
This commit is contained in:
parent
5616b3656a
commit
4a919885e1
@ -2239,18 +2239,21 @@ static void dyn_user(Global* gbl, const UCHAR** ptr)
|
||||
switch(verb)
|
||||
{
|
||||
case isc_dyn_user_add:
|
||||
text.upper();
|
||||
userData.operation = ADD_OPER;
|
||||
text.copyTo(userData.user_name, sizeof(userData.user_name));
|
||||
userData.user_name_entered = true;
|
||||
break;
|
||||
|
||||
case isc_dyn_user_mod:
|
||||
text.upper();
|
||||
userData.operation = MOD_OPER;
|
||||
text.copyTo(userData.user_name, sizeof(userData.user_name));
|
||||
userData.user_name_entered = true;
|
||||
break;
|
||||
|
||||
case isc_dyn_user_del:
|
||||
text.upper();
|
||||
userData.operation = DEL_OPER;
|
||||
text.copyTo(userData.user_name, sizeof(userData.user_name));
|
||||
userData.user_name_entered = true;
|
||||
|
@ -501,6 +501,7 @@ static bool get_switches(
|
||||
**************************************/
|
||||
TEXT msg[MSG_LENGTH];
|
||||
int l;
|
||||
char quote;
|
||||
SSHORT err_msg_no;
|
||||
|
||||
/* look at each argument. it's either a switch or a parameter.
|
||||
@ -526,8 +527,17 @@ static bool get_switches(
|
||||
case IN_SW_GSEC_DEL:
|
||||
case IN_SW_GSEC_DIS:
|
||||
case IN_SW_GSEC_MOD:
|
||||
for (l = 0; l < 32 && string[l] && string[l] != ' '; l++)
|
||||
quote = ' ';
|
||||
for (l = 0; l < 32 && string[l] && string[l] != quote; )
|
||||
{
|
||||
if (l == 0 && (*string == '\'' || *string == '"'))
|
||||
{
|
||||
quote = *string++;
|
||||
continue;
|
||||
}
|
||||
user_data->user_name[l] = UPPER(string[l]);
|
||||
++l;
|
||||
}
|
||||
if (l == 32) {
|
||||
GSEC_diag(GsecMsg76);
|
||||
/* invalid user name (maximum 31 bytes allowed) */
|
||||
|
Loading…
Reference in New Issue
Block a user