3030 switch constants refer to data items. The remaining switch constants
3131 refer to actual switches. */
3232
33- const int IN_SW_GSEC_0 = 0 ; // not a known switch
34- const int IN_SW_GSEC_UID = 1 ; // uid is specified
35- const int IN_SW_GSEC_GID = 2 ; // gid is specified
36- const int IN_SW_GSEC_SYSUSER = 3 ; // sys_user name is specified
37- const int IN_SW_GSEC_GROUP = 4 ; // group is specified
38- const int IN_SW_GSEC_PASSWORD = 5 ; // password is specified
39- const int IN_SW_GSEC_FNAME = 6 ; // first name is specified
40- const int IN_SW_GSEC_MNAME = 7 ; // middle name/initial is specified
41- const int IN_SW_GSEC_LNAME = 8 ; // last name is specified
42- const int IN_SW_GSEC_ADD = 9 ; // add a user
43- const int IN_SW_GSEC_DEL = 10 ; // delete a user
44- const int IN_SW_GSEC_DIS = 11 ; // display user(s)
45- const int IN_SW_GSEC_MOD = 12 ; // modify a user
46- const int IN_SW_GSEC_QUIT = 13 ; // quit from interactive session
47- const int IN_SW_GSEC_HELP = 14 ; // help
48- const int IN_SW_GSEC_Z = 15 ; // version
49- const int IN_SW_GSEC_DATABASE = 16 ; // database to manage
50- const int IN_SW_GSEC_DBA_USER_NAME = 17 ; // Database Admin. User name
51- const int IN_SW_GSEC_DBA_PASSWORD = 18 ; // Database Admin. Password
52- const int IN_SW_GSEC_SQL_ROLE_NAME = 19 ; // SQL Role to assume
53- const int IN_SW_GSEC_AMBIG = 20 ; // ambiguous switch
54- //const int IN_SW_GSEC_USERNAME = 21; // placeholder for the username
33+ inline constexpr int IN_SW_GSEC_0 = 0 ; // not a known switch
34+ inline constexpr int IN_SW_GSEC_UID = 1 ; // uid is specified
35+ inline constexpr int IN_SW_GSEC_GID = 2 ; // gid is specified
36+ inline constexpr int IN_SW_GSEC_SYSUSER = 3 ; // sys_user name is specified
37+ inline constexpr int IN_SW_GSEC_GROUP = 4 ; // group is specified
38+ inline constexpr int IN_SW_GSEC_PASSWORD = 5 ; // password is specified
39+ inline constexpr int IN_SW_GSEC_FNAME = 6 ; // first name is specified
40+ inline constexpr int IN_SW_GSEC_MNAME = 7 ; // middle name/initial is specified
41+ inline constexpr int IN_SW_GSEC_LNAME = 8 ; // last name is specified
42+ inline constexpr int IN_SW_GSEC_ADD = 9 ; // add a user
43+ inline constexpr int IN_SW_GSEC_DEL = 10 ; // delete a user
44+ inline constexpr int IN_SW_GSEC_DIS = 11 ; // display user(s)
45+ inline constexpr int IN_SW_GSEC_MOD = 12 ; // modify a user
46+ inline constexpr int IN_SW_GSEC_QUIT = 13 ; // quit from interactive session
47+ inline constexpr int IN_SW_GSEC_HELP = 14 ; // help
48+ inline constexpr int IN_SW_GSEC_Z = 15 ; // version
49+ inline constexpr int IN_SW_GSEC_DATABASE = 16 ; // database to manage
50+ inline constexpr int IN_SW_GSEC_DBA_USER_NAME = 17 ; // Database Admin. User name
51+ inline constexpr int IN_SW_GSEC_DBA_PASSWORD = 18 ; // Database Admin. Password
52+ inline constexpr int IN_SW_GSEC_SQL_ROLE_NAME = 19 ; // SQL Role to assume
53+ inline constexpr int IN_SW_GSEC_AMBIG = 20 ; // ambiguous switch
54+ //inline constexpr int IN_SW_GSEC_USERNAME = 21; // placeholder for the username
5555#ifdef TRUSTED_AUTH
56- const int IN_SW_GSEC_TRUSTED_AUTH = 22 ; // Use trusted authentication
56+ inline constexpr int IN_SW_GSEC_TRUSTED_AUTH = 22 ; // Use trusted authentication
5757#endif
58- const int IN_SW_GSEC_FETCH_PASSWORD = 23 ; // Fetch Password (Database Admin.)
59- const int IN_SW_GSEC_MAPPING = 24 ; // Change auto admin mapping
60- const int IN_SW_GSEC_ADMIN = 25 ; // Grant/revoke RDB$ADMIN in security database
61- const int IN_SW_GSEC_DIS_ADM = 26 ; // display user(s) with admin info
58+ inline constexpr int IN_SW_GSEC_FETCH_PASSWORD = 23 ; // Fetch Password (Database Admin.)
59+ inline constexpr int IN_SW_GSEC_MAPPING = 24 ; // Change auto admin mapping
60+ inline constexpr int IN_SW_GSEC_ADMIN = 25 ; // Grant/revoke RDB$ADMIN in security database
61+ inline constexpr int IN_SW_GSEC_DIS_ADM = 26 ; // display user(s) with admin info
6262
63- static const struct Switches ::in_sw_tab_t gsec_in_sw_table [] =
63+ static inline constexpr struct Switches ::in_sw_tab_t gsec_in_sw_table [] =
6464{
65- {IN_SW_GSEC_ADD , 0 , "ADD" , 0 , 0 , 0 , false, false, 0 , 1 , NULL }, // add user
65+ {IN_SW_GSEC_ADD , 0 , "ADD" , 0 , 0 , 0 , false, false, 0 , 1 , NULL }, // add user
6666 {IN_SW_GSEC_UID , isc_spb_sec_userid , "UID" , 0 , 0 , 0 , false, false, 0 , 1 , NULL }, // user's ID
6767 {IN_SW_GSEC_GID , isc_spb_sec_groupid , "GID" , 0 , 0 , 0 , false, false, 0 , 2 , NULL }, // user's group ID
6868 {IN_SW_GSEC_SYSUSER , 0 , "SYSUSER" , 0 , 0 , 0 , false, false, 0 , 1 , NULL }, // sys_user's name
@@ -72,7 +72,7 @@ static const struct Switches::in_sw_tab_t gsec_in_sw_table [] =
7272 {IN_SW_GSEC_MNAME , isc_spb_sec_middlename , "MNAME" , 0 , 0 , 0 , false, false, 0 , 2 , NULL }, // user's middle name/initial
7373 {IN_SW_GSEC_LNAME , isc_spb_sec_lastname , "LNAME" , 0 , 0 , 0 , false, false, 0 , 1 , NULL }, // user's last name
7474 {IN_SW_GSEC_DEL , 0 , "DELETE" , 0 , 0 , 0 , false, false, 0 , 2 , NULL }, // delete user
75- {IN_SW_GSEC_DIS , 0 , "OLD_DISPLAY" , 0 , 0 , 0 , false, false, 0 , 11 , NULL }, // Display user(s) without admin info
75+ {IN_SW_GSEC_DIS , 0 , "OLD_DISPLAY" , 0 , 0 , 0 , false, false, 0 , 11 , NULL }, // Display user(s) without admin info
7676 {IN_SW_GSEC_DIS_ADM , 0 , "DISPLAY" , 0 , 0 , 0 , false, false, 0 , 2 , NULL }, // display user(s) with admin info
7777 {IN_SW_GSEC_MOD , 0 , "MODIFY" , 0 , 0 , 0 , false, false, 0 , 2 , NULL }, // modify user
7878 {IN_SW_GSEC_QUIT , 0 , "QUIT" , 0 , 0 , 0 , false, false, 0 , 1 , NULL }, // exit command line interface
@@ -81,18 +81,18 @@ static const struct Switches::in_sw_tab_t gsec_in_sw_table [] =
8181 {IN_SW_GSEC_DATABASE , isc_spb_dbname , "DATABASE" , 0 , 0 , 0 , false, false, 0 , 2 , NULL }, // specify database to use
8282 {IN_SW_GSEC_DBA_USER_NAME , 0 , "USER" , 0 , 0 , 0 , false, false, 0 , 1 , NULL }, // Database Admin. User name
8383 {IN_SW_GSEC_DBA_PASSWORD , 0 , "PASSWORD" , 0 , 0 , 0 , false, false, 0 , 2 , NULL }, // Database Admin. Password
84- {IN_SW_GSEC_FETCH_PASSWORD , 0 , "FETCH_PASSWORD" , 0 , 0 , 0 , false, false, 0 , 2 , NULL }, // Fetch Database Admin. Password
84+ {IN_SW_GSEC_FETCH_PASSWORD , 0 , "FETCH_PASSWORD" , 0 , 0 , 0 , false, false, 0 , 2 , NULL }, // Fetch Database Admin. Password
8585 {IN_SW_GSEC_SQL_ROLE_NAME , isc_spb_sql_role_name , "ROLE" , 0 , 0 , 0 , false, false, 0 , 2 , NULL }, // SQL Role to assume
8686#ifdef TRUSTED_AUTH
8787 {IN_SW_GSEC_TRUSTED_AUTH , 0 , "TRUSTED" , 0 , 0 , 0 , false, false, 0 , 1 , NULL }, // Database Admin. Trusted User name
8888#endif
89- {IN_SW_GSEC_MAPPING , 0 , "MAPPING" , 0 , 0 , 0 , false, false, 0 , 2 , NULL }, // Change mapping of domain admins to sysdba in sec. DB
90- {IN_SW_GSEC_ADMIN , isc_spb_sec_admin , "ADMIN" , 0 , 0 , 0 , false, false, 0 , 3 , NULL }, // Grant/revoke RDB$ADMIN in security database
89+ {IN_SW_GSEC_MAPPING , 0 , "MAPPING" , 0 , 0 , 0 , false, false, 0 , 2 , NULL }, // Change mapping of domain admins to sysdba in sec. DB
90+ {IN_SW_GSEC_ADMIN , isc_spb_sec_admin , "ADMIN" , 0 , 0 , 0 , false, false, 0 , 3 , NULL }, // Grant/revoke RDB$ADMIN in security database
9191 {IN_SW_GSEC_0 , 0 , NULL , 0 , 0 , 0 , false, false, 0 , 0 , NULL } // End of List
9292};
9393
9494// Used in svc.cpp only
95- static const struct Switches ::in_sw_tab_t gsec_action_in_sw_table [] =
95+ static inline constexpr struct Switches ::in_sw_tab_t gsec_action_in_sw_table [] =
9696{
9797 {IN_SW_GSEC_ADD , isc_action_svc_add_user , "ADD" , 0 , 0 , 0 , false, false, 0 , 1 , NULL }, // add user
9898 {IN_SW_GSEC_DEL , isc_action_svc_delete_user , "DELETE" , 0 , 0 , 0 , false, false, 0 , 2 , NULL }, // delete user
0 commit comments