Skip to content

Commit

Permalink
Fixed CORE-1810: Usernames with '.' character
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexPeshkoff committed Apr 4, 2008
1 parent 5616b36 commit 4a91988
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/jrd/dyn.epp
Expand Up @@ -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;
Expand Down
12 changes: 11 additions & 1 deletion src/utilities/gsec/gsec.cpp
Expand Up @@ -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.
Expand All @@ -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) */
Expand Down

0 comments on commit 4a91988

Please sign in to comment.