From 568861d2d79423487cd23bb04f2d36025cbfe7c4 Mon Sep 17 00:00:00 2001 From: alexpeshkoff Date: Wed, 25 Jun 2014 11:20:42 +0000 Subject: [PATCH] Cleanup - removed unused any more service time only switches trusted_user & trusted_role --- src/alice/alice.cpp | 23 +---------------- src/alice/alice.h | 2 -- src/alice/aliceswi.h | 18 ++++--------- src/alice/exe.cpp | 13 ---------- src/alice/tdr.cpp | 12 --------- src/burp/burp.cpp | 31 ---------------------- src/burp/burp.h | 1 - src/burp/burpswi.h | 4 --- src/burp/restore.epp | 8 ------ src/jrd/constants.h | 7 +---- src/jrd/svc.cpp | 24 ----------------- src/jrd/tra.cpp | 4 +-- src/jrd/trace/TraceCmdLine.cpp | 23 ----------------- src/jrd/trace/traceswi.h | 12 +++------ src/utilities/gsec/gsecswi.h | 16 ++++-------- src/utilities/gstat/dba.epp | 23 ----------------- src/utilities/gstat/dbaswi.h | 12 +++------ src/utilities/nbackup/nbackup.cpp | 43 +++++-------------------------- src/utilities/nbackup/nbkswi.h | 10 +++---- 19 files changed, 31 insertions(+), 255 deletions(-) diff --git a/src/alice/alice.cpp b/src/alice/alice.cpp index 5121eb5399..dde3b2c94b 100644 --- a/src/alice/alice.cpp +++ b/src/alice/alice.cpp @@ -136,8 +136,6 @@ int alice(Firebird::UtilSvc* uSvc) #ifdef TRUSTED_AUTH tdgbl->ALICE_data.ua_trusted = false; #endif - tdgbl->ALICE_data.ua_tr_user = NULL; - tdgbl->ALICE_data.ua_tr_role = false; // Start by parsing switches @@ -198,24 +196,6 @@ int alice(Firebird::UtilSvc* uSvc) version = true; } - /*** - if (table->in_sw_value & sw_trusted_svc) - { - uSvc->checkService(); - if (--argc <= 0) { - ALICE_error(13); // msg 13: user name required - } - tdgbl->ALICE_data.ua_tr_user = *argv++; - continue; - } - if (table->in_sw_value & sw_trusted_role) - { - uSvc->checkService(); - tdgbl->ALICE_data.ua_tr_role = true; - continue; - } - ***/ - #ifdef TRUSTED_AUTH if (table->in_sw_value & sw_trusted_auth) { @@ -472,8 +452,7 @@ int alice(Firebird::UtilSvc* uSvc) ALICE_exit(FINI_OK, tdgbl); } - if (!flags || !(flags & ~(sw_user | sw_password | sw_fetch_password | - sw_trusted_auth/* | sw_trusted_svc | sw_trusted_role*/))) + if (!flags || !(flags & ~(sw_user | sw_password | sw_fetch_password | sw_trusted_auth))) { if (!help && !uSvc->isService()) { diff --git a/src/alice/alice.h b/src/alice/alice.h index 7af9cd9741..5697cff014 100644 --- a/src/alice/alice.h +++ b/src/alice/alice.h @@ -58,8 +58,6 @@ struct user_action ULONG ua_switches; const char* ua_user; const char* ua_password; - const char* ua_tr_user; - bool ua_tr_role; #ifdef TRUSTED_AUTH bool ua_trusted; #endif diff --git a/src/alice/aliceswi.h b/src/alice/aliceswi.h index 1dccd1439b..864267506a 100644 --- a/src/alice/aliceswi.h +++ b/src/alice/aliceswi.h @@ -60,8 +60,6 @@ const SINT64 sw_buffers = 0x0000000020000000L; const SINT64 sw_mode = 0x0000000040000000L; const SINT64 sw_set_db_dialect = 0x0000000080000000L; const SINT64 sw_trusted_auth = QUADCONST(0x0000000100000000); // Byte 4, Bit 0 -//const SINT64 sw_trusted_svc = QUADCONST(0x0000000200000000); -//const SINT64 sw_trusted_role = QUADCONST(0x0000000400000000); const SINT64 sw_fetch_password = QUADCONST(0x0000000800000000); const SINT64 sw_nolinger = QUADCONST(0x0000001000000000); @@ -115,11 +113,9 @@ enum alice_switches #ifdef TRUSTED_AUTH IN_SW_ALICE_TRUSTED_AUTH = 44, #endif -// IN_SW_ALICE_TRUSTED_USER = 45, -// IN_SW_ALICE_TRUSTED_ROLE = 46, - IN_SW_ALICE_HIDDEN_ONLINE = 47, - IN_SW_ALICE_FETCH_PASSWORD = 48, - IN_SW_ALICE_NOLINGER = 49 + IN_SW_ALICE_HIDDEN_ONLINE = 45, + IN_SW_ALICE_FETCH_PASSWORD = 46, + IN_SW_ALICE_NOLINGER = 47 }; static const char* const ALICE_SW_ASYNC = "ASYNC"; @@ -199,7 +195,7 @@ static const Switches::in_sw_tab_t alice_in_sw_table[] = sw_list, 0, false, 41, 2, NULL}, // msg 41: \t-prompt\t\tprompt for commit/rollback (-l) {IN_SW_ALICE_PASSWORD, 0, "PASSWORD", sw_password, - 0, (sw_trusted_auth /*| sw_trusted_svc | sw_trusted_role */| sw_fetch_password), + 0, (sw_trusted_auth | sw_fetch_password), false, 42, 2, NULL}, // msg 42: \t-password\tdefault password #ifdef DEV_BUILD @@ -233,15 +229,11 @@ static const Switches::in_sw_tab_t alice_in_sw_table[] = 0, (sw_user | sw_password), false, 115, 3, NULL}, // msg 115: -trusted use trusted authentication #endif -/* {IN_SW_ALICE_TRUSTED_USER, 0, TRUSTED_USER_SWITCH, sw_trusted_svc, - 0, (sw_trusted_svc | sw_user | sw_password), false, 0, TRUSTED_USER_SWITCH_LEN, NULL}, - {IN_SW_ALICE_TRUSTED_ROLE, 0, TRUSTED_ROLE_SWITCH, sw_trusted_role, - sw_trusted_svc, (sw_user | sw_password), false, 0, TRUSTED_ROLE_SWITCH_LEN, NULL}, */ {IN_SW_ALICE_NO_RESERVE, 0, "USE", sw_no_reserve, 0, ~(sw_no_reserve | sw_user | sw_password | sw_nolinger), false, 49, 1, NULL}, // msg 49: \t-use\t\tuse full or reserve space for versions {IN_SW_ALICE_USER, 0, "USER", sw_user, - 0, (sw_trusted_auth /*| sw_trusted_svc | sw_trusted_role*/), false, 50, 4, NULL}, + 0, sw_trusted_auth, false, 50, 4, NULL}, // msg 50: \t-user\t\tdefault user name {IN_SW_ALICE_VALIDATE, isc_spb_rpr_validate_db, "VALIDATE", sw_validate, 0, ~(sw_validate | sw_user | sw_password | sw_nolinger), false, 51, 1, NULL}, diff --git a/src/alice/exe.cpp b/src/alice/exe.cpp index aa7ee1739a..c2d2c1dc21 100644 --- a/src/alice/exe.cpp +++ b/src/alice/exe.cpp @@ -347,19 +347,6 @@ static void buildDpb(Firebird::ClumpletWriter& dpb, const SINT64 switches) tdgbl->ALICE_data.ua_password, strlen(tdgbl->ALICE_data.ua_password)); } - if (tdgbl->ALICE_data.ua_tr_user) - { - tdgbl->uSvc->checkService(); - dpb.insertString(isc_dpb_trusted_auth, - tdgbl->ALICE_data.ua_tr_user, strlen(tdgbl->ALICE_data.ua_tr_user)); - } - - if (tdgbl->ALICE_data.ua_tr_role) - { - tdgbl->uSvc->checkService(); - dpb.insertString(isc_dpb_trusted_role, ADMIN_ROLE, strlen(ADMIN_ROLE)); - } - #ifdef TRUSTED_AUTH if (tdgbl->ALICE_data.ua_trusted) { diff --git a/src/alice/tdr.cpp b/src/alice/tdr.cpp index ebcc465a7a..c4c012587a 100644 --- a/src/alice/tdr.cpp +++ b/src/alice/tdr.cpp @@ -196,18 +196,6 @@ bool TDR_attach_database(ISC_STATUS* status_vector, tdr* trans, const TEXT* path dpb.insertString(tdgbl->uSvc->isService() ? isc_dpb_password_enc : isc_dpb_password, tdgbl->ALICE_data.ua_password, strlen(tdgbl->ALICE_data.ua_password)); } - if (tdgbl->ALICE_data.ua_tr_user) - { - tdgbl->uSvc->checkService(); - dpb.insertString(isc_dpb_trusted_auth, - tdgbl->ALICE_data.ua_tr_user, - strlen(reinterpret_cast(tdgbl->ALICE_data.ua_tr_user))); - } - if (tdgbl->ALICE_data.ua_tr_role) - { - tdgbl->uSvc->checkService(); - dpb.insertString(isc_dpb_trusted_role, ADMIN_ROLE, strlen(ADMIN_ROLE)); - } trans->tdr_db_handle = 0; diff --git a/src/burp/burp.cpp b/src/burp/burp.cpp index bd18aa7111..1d8f616106 100644 --- a/src/burp/burp.cpp +++ b/src/burp/burp.cpp @@ -691,17 +691,6 @@ int gbak(Firebird::UtilSvc* uSvc) } tdgbl->setupSkipData(argv[itr]); break; - /*** - case IN_SW_BURP_TRUSTED_USER: - uSvc->checkService(); - if (++itr >= argc) - { - BURP_error(188, true); - // trusted user name parameter missing - } - tdgbl->gbl_sw_tr_user = argv[itr]; - break; - ***/ case IN_SW_BURP_ROLE: if (++itr >= argc) { @@ -1039,26 +1028,6 @@ int gbak(Firebird::UtilSvc* uSvc) } break; - /*** - case IN_SW_BURP_TRUSTED_USER: - uSvc->checkService(); - if (!authBlock) - { - dpb.deleteWithTag(isc_dpb_trusted_auth); - dpb.insertString(isc_dpb_trusted_auth, tdgbl->gbl_sw_tr_user, strlen(tdgbl->gbl_sw_tr_user)); - } - break; - - case IN_SW_BURP_TRUSTED_ROLE: - uSvc->checkService(); - if (!authBlock) - { - dpb.deleteWithTag(isc_dpb_trusted_role); - dpb.insertString(isc_dpb_trusted_role, ADMIN_ROLE, strlen(ADMIN_ROLE)); - } - break; - ***/ - #ifdef TRUSTED_AUTH case IN_SW_BURP_TRUSTED_AUTH: if (!dpb.find(isc_dpb_trusted_auth)) diff --git a/src/burp/burp.h b/src/burp/burp.h index eae7c5746c..bb164611f8 100644 --- a/src/burp/burp.h +++ b/src/burp/burp.h @@ -953,7 +953,6 @@ public: const SCHAR* gbl_sw_sql_role; const SCHAR* gbl_sw_user; const SCHAR* gbl_sw_password; - const SCHAR* gbl_sw_tr_user; SLONG gbl_sw_skip_count; SLONG gbl_sw_page_buffers; burp_fil* gbl_sw_files; diff --git a/src/burp/burpswi.h b/src/burp/burpswi.h index bfd5f3d041..cc4b244b9b 100644 --- a/src/burp/burpswi.h +++ b/src/burp/burpswi.h @@ -83,8 +83,6 @@ const int IN_SW_BURP_NOD = 39; // do not run database triggers #ifdef TRUSTED_AUTH const int IN_SW_BURP_TRUSTED_AUTH = 40; // force trusted auth #endif -//const int IN_SW_BURP_TRUSTED_USER = 41; // trusted user name to use on attach -//const int IN_SW_BURP_TRUSTED_ROLE = 42; // use trusted role on attach const int IN_SW_BURP_FIX_FSS_DATA = 43; // fix unicode_fss data const int IN_SW_BURP_FIX_FSS_METADATA = 44; // fix unicode_fss metadata @@ -173,8 +171,6 @@ static const Switches::in_sw_tab_t reference_burp_in_sw_table[] = {IN_SW_BURP_TRUSTED_AUTH, 0, "TRUSTED", 0, 0, 0, false, 295, 3, NULL, boGeneral}, // msg 295: @1TRU(STED) use trusted authentication #endif -// {IN_SW_BURP_TRUSTED_USER, 0, TRUSTED_USER_SWITCH, 0, 0, 0, false, 0, TRUSTED_USER_SWITCH_LEN, NULL, boGeneral}, -// {IN_SW_BURP_TRUSTED_ROLE, 0, TRUSTED_ROLE_SWITCH, 0, 0, 0, false, 0, TRUSTED_ROLE_SWITCH_LEN, NULL, boGeneral}, /* {IN_SW_BURP_U, 0, "UNPROTECTED", 0, 0, 0, false, 0, 5, NULL, boGeneral}, */ diff --git a/src/burp/restore.epp b/src/burp/restore.epp index a7a9543c26..7b02d8cf09 100644 --- a/src/burp/restore.epp +++ b/src/burp/restore.epp @@ -623,10 +623,6 @@ void add_access_dpb(BurpGlobals* tdgbl, Firebird::ClumpletWriter& dpb) dpb.insertString(tdgbl->uSvc->isService() ? isc_dpb_password_enc : isc_dpb_password, tdgbl->gbl_sw_password, strlen(tdgbl->gbl_sw_password)); } - if (tdgbl->gbl_sw_tr_user) - { - dpb.insertString(isc_dpb_trusted_auth, tdgbl->gbl_sw_tr_user, strlen(tdgbl->gbl_sw_tr_user)); - } dpb.insertByte(isc_dpb_no_db_triggers, 1); } @@ -902,10 +898,6 @@ void create_database(BurpGlobals* tdgbl, const TEXT* file_name) dpb.insertString(tdgbl->uSvc->isService() ? isc_dpb_password_enc : isc_dpb_password, tdgbl->gbl_sw_password, strlen(tdgbl->gbl_sw_password)); } - if (tdgbl->gbl_sw_tr_user) - { - dpb.insertString(isc_dpb_trusted_auth, tdgbl->gbl_sw_tr_user, strlen(tdgbl->gbl_sw_tr_user)); - } if (page_buffers) { dpb.insertInt(isc_dpb_set_page_buffers, page_buffers); diff --git a/src/jrd/constants.h b/src/jrd/constants.h index bcdaafd0cb..0caae81850 100644 --- a/src/jrd/constants.h +++ b/src/jrd/constants.h @@ -423,12 +423,7 @@ const int DDL_TRIGGER_DROP_MAPPING = 47; // is specified by the client application #define USERNAME_SWITCH "USER" #define PASSWORD_SWITCH "PASSWORD" -/*** -#define TRUSTED_USER_SWITCH "TRUSTED_SVC" -#define TRUSTED_USER_SWITCH_LEN (sizeof(TRUSTED_USER_SWITCH) - 1) -#define TRUSTED_ROLE_SWITCH "TRUSTED_ROLE" -#define TRUSTED_ROLE_SWITCH_LEN (sizeof(TRUSTED_ROLE_SWITCH) - 1) -***/ + const TraNumber MAX_TRA_NUMBER = ~TraNumber(0); #endif // JRD_CONSTANTS_H diff --git a/src/jrd/svc.cpp b/src/jrd/svc.cpp index ffd7b0202d..96ce646be2 100644 --- a/src/jrd/svc.cpp +++ b/src/jrd/svc.cpp @@ -282,18 +282,6 @@ void Service::getOptions(ClumpletReader& spb) case isc_spb_command_line: spb.getString(svc_command_line); - /*** - { - // HACK: this does not care about the words on allowed places. - string cLine = svc_command_line; - cLine.upper(); - if (cLine.find(TRUSTED_USER_SWITCH) != string::npos || - cLine.find(TRUSTED_ROLE_SWITCH) != string::npos) - { - (Arg::Gds(isc_bad_spb_form) << Arg::Gds(isc_no_trusted_spb)).raise(); - } - } - ***/ break; case isc_spb_expected_db: @@ -2823,18 +2811,6 @@ bool Service::process_switches(ClumpletReader& spb, string& switches) { string s; spb.getString(s); - - /*** - // HACK: this does not care about the words on allowed places. - string cLine = s; - cLine.upper(); - if (cLine.find(TRUSTED_USER_SWITCH) != string::npos || - cLine.find(TRUSTED_ROLE_SWITCH) != string::npos) - { - (Arg::Gds(isc_bad_spb_form) << Arg::Gds(isc_no_trusted_spb)).raise(); - } - ***/ - switches += s; switches += ' '; } diff --git a/src/jrd/tra.cpp b/src/jrd/tra.cpp index a435780c29..e53e9fe2bd 100644 --- a/src/jrd/tra.cpp +++ b/src/jrd/tra.cpp @@ -2526,9 +2526,9 @@ static THREAD_ENTRY_DECLARE sweep_database(THREAD_ENTRY_PARAM database) Firebird::ClumpletWriter dpb(Firebird::ClumpletReader::Tagged, MAX_DPB_SIZE, isc_dpb_version1); dpb.insertByte(isc_dpb_sweep, isc_dpb_records); - // use trusted authentication to attach database + // use embedded authentication to attach database const char* szAuthenticator = "sweeper"; - dpb.insertString(isc_dpb_trusted_auth, szAuthenticator, strlen(szAuthenticator)); + dpb.insertString(isc_dpb_user_name, szAuthenticator, strlen(szAuthenticator)); ISC_STATUS_ARRAY status_vector = {0}; isc_db_handle db_handle = 0; diff --git a/src/jrd/trace/TraceCmdLine.cpp b/src/jrd/trace/TraceCmdLine.cpp index d6b8c74490..3acd6f6195 100644 --- a/src/jrd/trace/TraceCmdLine.cpp +++ b/src/jrd/trace/TraceCmdLine.cpp @@ -356,29 +356,6 @@ void fbtrace(UtilSvc* uSvc, TraceSvcIntf* traceSvc) adminRole = true; break; - /*** - case IN_SW_TRACE_TRUSTED_USER: - if (!uSvc->isService()) - usage(uSvc, isc_trace_switch_svc_only, sw->in_sw_name); - - if (!user.empty()) - usage(uSvc, isc_trace_switch_once, sw->in_sw_name); - - argv++; - if (argv < end && *argv) - user = *argv; - else - usage(uSvc, isc_trace_param_val_miss, sw->in_sw_name); - break; - - case IN_SW_TRACE_TRUSTED_ROLE: - if (!uSvc->isService()) - usage(uSvc, isc_trace_switch_svc_only, sw->in_sw_name); - - adminRole = true; - break; - ***/ - case IN_SW_TRACE_SERVICE_NAME: if (uSvc->isService()) continue; diff --git a/src/jrd/trace/traceswi.h b/src/jrd/trace/traceswi.h index a2d627c3d4..83d0f268f3 100644 --- a/src/jrd/trace/traceswi.h +++ b/src/jrd/trace/traceswi.h @@ -36,12 +36,10 @@ const int IN_SW_TRACE_NAME = 7; const int IN_SW_TRACE_ID = 8; const int IN_SW_TRACE_USERNAME = 9; const int IN_SW_TRACE_PASSWORD = 10; -const int IN_SW_TRACE_TRUSTED_USER = 11; -const int IN_SW_TRACE_TRUSTED_ROLE = 12; -const int IN_SW_TRACE_SERVICE_NAME = 13; -const int IN_SW_TRACE_FETCH_PWD = 14; -const int IN_SW_TRACE_TRUSTED_AUTH = 15; -const int IN_SW_TRACE_VERSION = 16; +const int IN_SW_TRACE_SERVICE_NAME = 11; +const int IN_SW_TRACE_FETCH_PWD = 12; +const int IN_SW_TRACE_TRUSTED_AUTH = 13; +const int IN_SW_TRACE_VERSION = 14; // list of possible actions (services) for use with trace services @@ -73,8 +71,6 @@ static const struct Switches::in_sw_tab_t trace_auth_in_sw_table [] = {IN_SW_TRACE_PASSWORD, 0, PASSWORD_SWITCH, 0, 0, 0, false, 0, 1, NULL}, {IN_SW_TRACE_SERVICE_NAME, 0, "SERVICE", 0, 0, 0, false, 0, 2, NULL}, {IN_SW_TRACE_TRUSTED_AUTH, 0, "TRUSTED", 0, 0, 0, false, 0, 1, NULL}, -// {IN_SW_TRACE_TRUSTED_USER, 0, TRUSTED_USER_SWITCH, 0, 0, 0, false, 0, TRUSTED_USER_SWITCH_LEN, NULL}, -// {IN_SW_TRACE_TRUSTED_ROLE, 0, TRUSTED_ROLE_SWITCH, 0, 0, 0, false, 0, TRUSTED_ROLE_SWITCH_LEN, NULL}, {IN_SW_TRACE_USERNAME, 0, USERNAME_SWITCH, 0, 0, 0, false, 0, 1, NULL}, {0, 0, NULL, 0, 0, 0, false, 0, 0, NULL} // End of List }; diff --git a/src/utilities/gsec/gsecswi.h b/src/utilities/gsec/gsecswi.h index 5eabf607d6..dbdc6432d7 100644 --- a/src/utilities/gsec/gsecswi.h +++ b/src/utilities/gsec/gsecswi.h @@ -53,15 +53,13 @@ const int IN_SW_GSEC_DBA_PASSWORD = 18; // Database Admin. Password const int IN_SW_GSEC_SQL_ROLE_NAME = 19; // SQL Role to assume const int IN_SW_GSEC_AMBIG = 20; // ambiguous switch //const int IN_SW_GSEC_USERNAME = 21; // placeholder for the username -//const int IN_SW_GSEC_DBA_TRUSTED_USER = 22; // Database Admin. Trusted User name -//const int IN_SW_GSEC_DBA_TRUSTED_ROLE = 23; // use trusted role for auth #ifdef TRUSTED_AUTH -const int IN_SW_GSEC_TRUSTED_AUTH = 24; // Use trusted authentication +const int IN_SW_GSEC_TRUSTED_AUTH = 22; // Use trusted authentication #endif -const int IN_SW_GSEC_FETCH_PASSWORD = 25; // Fetch Password (Database Admin.) -const int IN_SW_GSEC_MAPPING = 26; // Change auto admin mapping -const int IN_SW_GSEC_ADMIN = 27; // Grant/revoke RDB$ADMIN in security database -const int IN_SW_GSEC_DIS_ADM = 28; // display user(s) with admin info +const int IN_SW_GSEC_FETCH_PASSWORD = 23; // Fetch Password (Database Admin.) +const int IN_SW_GSEC_MAPPING = 24; // Change auto admin mapping +const int IN_SW_GSEC_ADMIN = 25; // Grant/revoke RDB$ADMIN in security database +const int IN_SW_GSEC_DIS_ADM = 26; // display user(s) with admin info static const struct Switches::in_sw_tab_t gsec_in_sw_table [] = { @@ -86,10 +84,6 @@ static const struct Switches::in_sw_tab_t gsec_in_sw_table [] = {IN_SW_GSEC_DBA_PASSWORD, 0, "PASSWORD", 0, 0, 0, false, 0, 2, NULL}, // Database Admin. Password {IN_SW_GSEC_FETCH_PASSWORD, 0, "FETCH_PASSWORD", 0, 0, 0, false, 0, 2, NULL}, // Fetch Database Admin. Password {IN_SW_GSEC_SQL_ROLE_NAME, isc_spb_sql_role_name, "ROLE", 0, 0, 0, false, 0, 2, NULL}, // SQL Role to assume -/* {IN_SW_GSEC_DBA_TRUSTED_USER, 0, TRUSTED_USER_SWITCH, 0, 0, 0, false, 0, - TRUSTED_USER_SWITCH_LEN, NULL}, // Database Admin. Trusted User name - {IN_SW_GSEC_DBA_TRUSTED_ROLE, 0, TRUSTED_ROLE_SWITCH, 0, 0, 0, false, 0, - TRUSTED_ROLE_SWITCH_LEN, NULL}, // Use trusted role for auth */ #ifdef TRUSTED_AUTH {IN_SW_GSEC_TRUSTED_AUTH, 0, "TRUSTED", 0, 0, 0, false, 0, 1, NULL}, // Database Admin. Trusted User name #endif diff --git a/src/utilities/gstat/dba.epp b/src/utilities/gstat/dba.epp index ac64d2bd11..ba0184272e 100644 --- a/src/utilities/gstat/dba.epp +++ b/src/utilities/gstat/dba.epp @@ -362,7 +362,6 @@ int gstat(Firebird::UtilSvc* uSvc) // TEXT tr_buff[128], *tr_user = tr_buff; // MOVE_CLEAR(tr_buff, sizeof(tr_buff)); - // bool trusted_role = false; #ifdef TRUSTED_AUTH bool trusted_auth = false; @@ -455,18 +454,6 @@ int gstat(Firebird::UtilSvc* uSvc) } } break; - /*** - case IN_SW_DBA_TRUSTED_USER: - uSvc->checkService(); - if (argv < end) - fb_utils::copy_terminate(tr_user, *argv++, sizeof(tr_buff)); - break; - case IN_SW_DBA_TRUSTED_ROLE: - uSvc->checkService(); - trusted_role = true; - break; - ***/ - #ifdef TRUSTED_AUTH case IN_SW_DBA_TRUSTEDAUTH: trusted_auth = true; @@ -752,16 +739,6 @@ int gstat(Firebird::UtilSvc* uSvc) password, strlen(password)); } - /*** - if (*tr_user) - { - uSvc->checkService(); - dpb.insertString(isc_dpb_trusted_auth, tr_user, strlen(tr_user)); - if (trusted_role) - dpb.insertString(isc_dpb_trusted_role, ADMIN_ROLE, strlen(ADMIN_ROLE)); - } - ***/ - #ifdef TRUSTED_AUTH if (trusted_auth) dpb.insertTag(isc_dpb_trusted_auth); diff --git a/src/utilities/gstat/dbaswi.h b/src/utilities/gstat/dbaswi.h index 103e64c41e..271392aedb 100644 --- a/src/utilities/gstat/dbaswi.h +++ b/src/utilities/gstat/dbaswi.h @@ -44,14 +44,12 @@ const int IN_SW_DBA_PASSWORD = 9; // password const int IN_SW_DBA_RECORD = 10; // analyze record versions const int IN_SW_DBA_RELATION = 11; // analyze specific relations const int IN_SW_DBA_NOCREATION = 12; // don't print creation date -const int IN_SW_DBA_TRUSTED_USER = 13; // trusted user name -const int IN_SW_DBA_TRUSTED_ROLE = 14; // use predefined trusted role #ifdef TRUSTED_AUTH -const int IN_SW_DBA_TRUSTEDAUTH = 15; // trusted user name +const int IN_SW_DBA_TRUSTEDAUTH = 13; // trusted user name #endif -const int IN_SW_DBA_FETCH_PASS = 16; // fetch password from file -const int IN_SW_DBA_ENCRYPTION = 17; // analyze pages encryption -const int IN_SW_DBA_HELP = 18; // show help +const int IN_SW_DBA_FETCH_PASS = 14; // fetch password from file +const int IN_SW_DBA_ENCRYPTION = 15; // analyze pages encryption +const int IN_SW_DBA_HELP = 16; // show help const static struct Switches::in_sw_tab_t dba_in_sw_table[] = { @@ -69,8 +67,6 @@ const static struct Switches::in_sw_tab_t dba_in_sw_table[] = {IN_SW_DBA_RELATION, isc_spb_sts_table, "TABLE", 0,0,0, false, 35, 1, NULL}, // msg 35: -t tablename // special switch to avoid including creation date, only for tests (no message) {IN_SW_DBA_NOCREATION, isc_spb_sts_nocreation, "NOCREATION", 0,0,0, false, 0, 1, NULL}, // msg (ignored) -n suppress creation date -// {IN_SW_DBA_TRUSTED_USER, 0, TRUSTED_USER_SWITCH, 0,0,0, false, 0, TRUSTED_USER_SWITCH_LEN, NULL}, // msg 0 - ignored -// {IN_SW_DBA_TRUSTED_ROLE, 0, TRUSTED_ROLE_SWITCH, 0,0,0, false, 0, TRUSTED_ROLE_SWITCH_LEN, NULL}, // msg 0 - ignored #ifdef TRUSTED_AUTH {IN_SW_DBA_TRUSTEDAUTH, 0, "TRUSTED", 0,0,0, false, 36, 2, NULL}, // msg 36: -tr use trusted authentication #endif diff --git a/src/utilities/nbackup/nbackup.cpp b/src/utilities/nbackup/nbackup.cpp index b61b9a24b7..d60f10fb0a 100644 --- a/src/utilities/nbackup/nbackup.cpp +++ b/src/utilities/nbackup/nbackup.cpp @@ -273,11 +273,10 @@ class NBackup { public: NBackup(UtilSvc* _uSvc, const PathName& _database, const string& _username, - const string& _password, bool _run_db_triggers/*, const string& _trustedUser, - bool _trustedRole*/, bool _direct_io, const string& _deco) + const string& _password, bool _run_db_triggers, bool _direct_io, const string& _deco) : uSvc(_uSvc), newdb(0), trans(0), database(_database), - username(_username), password(_password), /*trustedUser(_trustedUser),*/ - run_db_triggers(_run_db_triggers), /*trustedRole(_trustedRole), */direct_io(_direct_io), + username(_username), password(_password), + run_db_triggers(_run_db_triggers), direct_io(_direct_io), dbase(0), backup(0), decompress(_deco), childId(0), db_size_pages(0), m_odsNumber(0), m_silent(false), m_printed(false) { @@ -327,8 +326,8 @@ private: isc_tr_handle trans; // transaction handle PathName database; - string username, password/*, trustedUser*/; - bool run_db_triggers, /*trustedRole, */direct_io; + string username, password; + bool run_db_triggers, direct_io; PathName dbname; // Database file name PathName bakname; @@ -770,20 +769,6 @@ void NBackup::attach_database() if (password.hasData()) dpb.insertString(isc_dpb_password, password); - - /*** - if (trustedUser.hasData()) - { - uSvc->checkService(); - dpb.insertString(isc_dpb_trusted_auth, trustedUser); - } - - if (trustedRole) - { - uSvc->checkService(); - dpb.insertString(isc_dpb_trusted_role, ADMIN_ROLE, strlen(ADMIN_ROLE)); - } - ***/ } if (!run_db_triggers) @@ -1591,8 +1576,6 @@ void nbackup(UtilSvc* uSvc) NBackup::BackupFiles backup_files; int level; bool print_size = false, version = false; -// string trustedUser; -// bool trustedRole = false; string onOff; const Switches switches(nbackup_action_in_sw_table, FB_NELEM(nbackup_action_in_sw_table), @@ -1615,20 +1598,6 @@ void nbackup(UtilSvc* uSvc) switch (rc->in_sw) { - /*** - case IN_SW_NBK_TRUSTED_USER: - uSvc->checkService(); - if (++itr >= argc) - missingParameterForSwitch(uSvc, argv[itr - 1]); - - trustedUser = argv[itr]; - break; - - case IN_SW_NBK_TRUSTED_ROLE: - uSvc->checkService(); - trustedRole = true; - break; - ***/ case IN_SW_NBK_USER_NAME: if (++itr >= argc) missingParameterForSwitch(uSvc, argv[itr - 1]); @@ -1798,7 +1767,7 @@ void nbackup(UtilSvc* uSvc) usage(uSvc, isc_nbackup_size_with_lock); } - NBackup nbk(uSvc, database, username, password, run_db_triggers, /*trustedUser, trustedRole, */direct_io, decompress); + NBackup nbk(uSvc, database, username, password, run_db_triggers, direct_io, decompress); try { switch (op) diff --git a/src/utilities/nbackup/nbkswi.h b/src/utilities/nbackup/nbkswi.h index fc05fc9065..2e113399d8 100644 --- a/src/utilities/nbackup/nbkswi.h +++ b/src/utilities/nbackup/nbkswi.h @@ -44,11 +44,9 @@ const int IN_SW_NBK_PASSWORD = 8; const int IN_SW_NBK_SIZE = 9; const int IN_SW_NBK_FETCH = 10; const int IN_SW_NBK_VERSION = 11; -const int IN_SW_NBK_TRUSTED_USER = 12; -const int IN_SW_NBK_TRUSTED_ROLE = 13; -const int IN_SW_NBK_HELP = 14; -const int IN_SW_NBK_DIRECT = 15; -const int IN_SW_NBK_DECOMPRESS = 16; +const int IN_SW_NBK_HELP = 12; +const int IN_SW_NBK_DIRECT = 13; +const int IN_SW_NBK_DECOMPRESS = 14; static const struct Switches::in_sw_tab_t nbackup_in_sw_table [] = @@ -77,8 +75,6 @@ static const struct Switches::in_sw_tab_t nbackup_action_in_sw_table [] = {IN_SW_NBK_PASSWORD, 0, "PASSWORD", 0, 0, 0, false, 14, 1, NULL, nboGeneral}, {IN_SW_NBK_FETCH, 0, "FETCH_PASSWORD", 0, 0, 0, false, 15, 2, NULL, nboGeneral}, {IN_SW_NBK_VERSION, 0, "Z", 0, 0, 0, false, 18, 1, NULL, nboGeneral}, -// {IN_SW_NBK_TRUSTED_USER, 0, TRUSTED_USER_SWITCH, 0, 0, 0, false, 0, TRUSTED_USER_SWITCH_LEN, NULL, nboGeneral}, -// {IN_SW_NBK_TRUSTED_ROLE, 0, TRUSTED_ROLE_SWITCH, 0, 0, 0, false, 0, TRUSTED_ROLE_SWITCH_LEN, NULL, nboGeneral}, {IN_SW_NBK_HELP, 0, "?", 0, 0, 0, false, 0, 1, NULL, 0}, {IN_SW_NBK_0, 0, NULL, 0, 0, 0, false, 0, 0, NULL, 0} // End of List };