Skip to content

Commit

Permalink
Fixed CORE-1263 - gsec incorrectly processes some switches
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexPeshkoff committed May 21, 2007
1 parent b50f66c commit 4487203
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/msgs/facilities2.sql
Expand Up @@ -25,7 +25,7 @@ set bulk_insert INSERT INTO FACILITIES (LAST_CHANGE, FACILITY, FAC_CODE, MAX_NUM
--('1996-11-07 13:38:43', 'GJRN', 16, 241)
--
('2007-02-25 08:33:07', 'ISQL', 17, 157)
('2007-04-07 13:11:00', 'GSEC', 18, 92)
('2007-04-07 13:11:00', 'GSEC', 18, 93)
('2002-03-05 02:30:12', 'LICENSE', 19, 60)
('2002-03-05 02:31:54', 'DOS', 20, 74)
('2007-04-07 13:11:00', 'GSTAT', 21, 37)
Expand Down
1 change: 1 addition & 0 deletions src/msgs/messages2.sql
Expand Up @@ -2982,6 +2982,7 @@ Fetches = !f', NULL, NULL);
-- Do not change the arguments of the previous GSEC messages.
-- Write the new GSEC messages here.
('GsecMsg91', 'printhelp', 'gsec.cpp', NULL, 18, 91, NULL, '-trusted (use trusted authentication)', NULL, NULL);
('GsecMsg92', 'main', 'gsec.cpp', NULL, 18, 92, NULL, 'Invalid switch specified in interactive mode', NULL, NULL);
-- LICENSE
('license_no_file', 'NODE_license', 'jrd/node.c', NULL, 19, 0, NULL, 'The license file does not exist or could not be opened for read', NULL, NULL);
('stop_stop_1', 'not_licensed', 'jrd/node.c', 'This message has 20 leading space characters (2 tab chars and 4 '' '') in
Expand Down
10 changes: 9 additions & 1 deletion src/utilities/gsec/gsec.cpp
Expand Up @@ -399,11 +399,19 @@ int common_main(int argc,
char* local_argv[MAXARGS];
for (;;) {
/* Clear out user data each time through this loop. */
MOVE_CLEAR(tdsec->tsec_user_data, sizeof(internal_user_data));
MOVE_CLEAR(user_data, sizeof(internal_user_data));
if (get_line(&local_argc, local_argv, stuff, sizeof(stuff)))
break;
if (local_argc > 1) {
ret = parse_cmd_line(local_argc, local_argv, tdsec);
if (user_data->dba_user_name_entered ||
user_data->dba_password_entered ||
user_data->database_name_entered)
{
GSEC_print(GsecMsg92);
continue;
}

databaseName.copyTo(user_data->database_name, sizeof(user_data->database_name));
user_data->database_name_entered = databaseNameEntered;
if (ret == 1)
Expand Down
1 change: 1 addition & 0 deletions src/utilities/gsec/gsec.h
Expand Up @@ -269,6 +269,7 @@ const USHORT GsecMsg88 = 88; /* -z */
const USHORT GsecMsg89 = 89; /* displaying version number: */
const USHORT GsecMsg90 = 90; /* z (interactive only) */
const USHORT GsecMsg91 = 91; /* -trusted (use trusted authentication) */
const USHORT GsecMsg92 = 92; /* invalid switch specified in interactive mode */

#endif /* UTILITIES_GSEC_H */

0 comments on commit 4487203

Please sign in to comment.