From: Claudio V. C. <ro...@us...> - 2009-05-06 09:18:32
|
Build Version : T2.5.0.23784 Firebird 2.5 Beta 1 (writeBuildNum.sh,v 1.23948 2009/05/06 09:18:23 robocop Exp ) Update of /cvsroot/firebird/firebird2/src/utilities/gsec In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv28805/src/utilities/gsec Modified Files: gsec.cpp gsec.h security.epp Log Message: More constants instead of hardcoded numbers. Index: gsec.cpp =================================================================== RCS file: /cvsroot/firebird/firebird2/src/utilities/gsec/gsec.cpp,v retrieving revision 1.109 retrieving revision 1.110 diff -b -U3 -r1.109 -r1.110 --- gsec.cpp 28 Apr 2009 13:08:02 -0000 1.109 +++ gsec.cpp 6 May 2009 09:18:21 -0000 1.110 @@ -412,7 +412,8 @@ /* msg27: "-------------------------------------------------------------------------------------------" */ } - util_output("%-31.31s %5d %5d %s %s %s\n", data->user_name, + util_output("%-*.*s %5d %5d %s %s %s\n", + USERNAME_LENGTH, USERNAME_LENGTH, data->user_name, data->uid, data->gid, data->first_name, data->middle_name, data->last_name); } @@ -530,7 +531,7 @@ case IN_SW_GSEC_DIS: case IN_SW_GSEC_MOD: quote = ' '; - for (l = 0; l < 32 && string[l] && string[l] != quote; ) + for (l = 0; l < MAX_SQL_IDENTIFIER_SIZE && string[l] && string[l] != quote; ) { if (l == 0 && (*string == '\'' || *string == '"')) { @@ -540,7 +541,7 @@ user_data->user_name[l] = UPPER(string[l]); ++l; } - if (l == 32) { + if (l == MAX_SQL_IDENTIFIER_SIZE) { GSEC_diag(GsecMsg76); /* invalid user name (maximum 31 bytes allowed) */ return false; Index: gsec.h =================================================================== RCS file: /cvsroot/firebird/firebird2/src/utilities/gsec/gsec.h,v retrieving revision 1.38 retrieving revision 1.39 diff -b -U3 -r1.38 -r1.39 --- gsec.h 25 Feb 2009 05:39:46 -0000 1.38 +++ gsec.h 6 May 2009 09:18:21 -0000 1.39 @@ -26,6 +26,7 @@ #include "../jrd/ThreadData.h" #include "../jrd/jrd_pwd.h" +#include "../jrd/constants.h" const USHORT GSEC_MSG_FAC = 18; const int MSG_LENGTH = 128; @@ -41,14 +42,14 @@ const int MOD_OPER = 4; const int QUIT_OPER = 5; const int HELP_OPER = 6; -const int VERSION_OPER = 7; +//const int VERSION_OPER = 7; const int MAP_SET_OPER = 8; const int MAP_DROP_OPER = 9; const int USER_NAME_LEN = 133; const int ALT_NAME_LEN = 129; -const int NAME_LEN = 33; -const int PASS_LEN = MAX_PASSWORD_LENGTH + 1; +const int NAME_LEN = MAX_SQL_IDENTIFIER_SIZE; +//const int PASS_LEN = MAX_PASSWORD_LENGTH + 1; const int _SERVER_LEN = 128; const int DATABASE_LEN = _SERVER_LEN + MAXPATHLEN; @@ -91,9 +92,9 @@ TEXT dba_password [NAME_LEN]; // the user's name bool dba_password_entered; // user name entered flag bool dba_password_specified; // database specified flag - TEXT sql_role_name [NAME_LEN]; // the user's name - bool sql_role_name_entered; // user name entered flag - bool sql_role_name_specified; // database specified flag + TEXT sql_role_name [NAME_LEN]; // the user's role + bool sql_role_name_entered; // role entered flag + bool sql_role_name_specified; // role specified flag TEXT database_name [DATABASE_LEN]; // database to manage name bool database_name_entered; // database entered flag bool database_name_specified; // database specified flag Index: security.epp =================================================================== RCS file: /cvsroot/firebird/firebird2/src/utilities/gsec/security.epp,v retrieving revision 1.27 retrieving revision 1.28 diff -b -U3 -r1.27 -r1.28 --- security.epp 4 Apr 2009 16:39:28 -0000 1.27 +++ security.epp 6 May 2009 09:18:21 -0000 1.28 @@ -40,7 +40,6 @@ DATABASE DB = STATIC FILENAME "security2.fdb"; -static const char* SYSDBA_USER_NAME = "SYSDBA"; static Firebird::GlobalPtr<Firebird::Mutex> execLineMutex; // protects various gpre generated structures SSHORT SECURITY_exec_line(ISC_STATUS* isc_status, |