From 4a919885e1377a8d52c3b2fc84d51db65ddbabfd Mon Sep 17 00:00:00 2001 From: alexpeshkoff Date: Fri, 4 Apr 2008 15:46:04 +0000 Subject: [PATCH] Fixed CORE-1810: Usernames with '.' character --- src/jrd/dyn.epp | 3 +++ src/utilities/gsec/gsec.cpp | 12 +++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/jrd/dyn.epp b/src/jrd/dyn.epp index 7e4b5746bb..617f69359b 100644 --- a/src/jrd/dyn.epp +++ b/src/jrd/dyn.epp @@ -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; diff --git a/src/utilities/gsec/gsec.cpp b/src/utilities/gsec/gsec.cpp index 0b8ef84e6d..491eff9efb 100644 --- a/src/utilities/gsec/gsec.cpp +++ b/src/utilities/gsec/gsec.cpp @@ -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) */