COMPILATION LISTING OF SEGMENT secure_mrds_db Compiled by: Multics PL/I Compiler, Release 33e, of October 6, 1992 Compiled at: CGI Compiled on: 2000-04-18_1145.27_Tue_mdt Options: optimize map 1 /* *********************************************************** 2* * * 3* * * 4* * Copyright, (C) Honeywell Information Systems Inc., 1981 * 5* * * 6* * * 7* *********************************************************** */ 8 9 /* ****************************************************** 10* * * 11* * * 12* * Copyright (c) 1972 by Massachusetts Institute of * 13* * Technology and Honeywell Information Systems, Inc. * 14* * * 15* * * 16* ****************************************************** */ 17 18 /* HISTORY: 19* 20* Originally written by Jim Gray - - November 1980 21* 22* 81-01-20 Jim Gray : modified to take advantage of extended interface 23* of mrds_dm_db_secured, replacing mrds_dm_get_secured_status, and mrds_dm_set_db_secured. 24* 25* 83-02-03 Roger Lackey : Removed unreferenced variables and entries, added 26* dcl for builtins. 27**/ 28 29 secure_mrds_db: smdb: procedure (); 30 31 /* DESCRIPTION: 32* 33* This routine is used to set/reset/display a "secured" bit in the database 34* that affects how database security is handled. 35* If the bit is not set, the databse operations are as per mr8.0 mrds. 36* If the bit is set, the openings must be via new version 37* security submodels, and model commands are only usable by a DBA. 38* NOTE: use of this command requires "sma" access on the database directory, 39* and "rw" access on the db_model segment. 40* 41**/ 42 43 /* PARAMETERS: 44* 45* db_path - - (input) char(*), the relative or absolute pathname of 46* a version 4 database(earlier versions are not supported by this command) 47* 48* control_arg - - (input) char(*), either "-set", "-reset" or "-display" 49* may be optionally given as a control argument(only 1). 50* The action without control arguments is to set the secured bit to on, 51* (i.e. -set is the default) 52* the -reset control causes it to be set to off, and the -display 53* control argument will display the current value of the secured bit. 54* 55**/ 56 57 /* inititalize */ 58 59 code = 0; 60 data_model_ptr = null (); 61 on cleanup call clean_up (); 62 63 /* get the argument list */ 64 65 call cu_$arg_list_ptr (al_ptr); 66 nargs = arg_list.arg_count / 2; 67 num_ptrs = arg_list.arg_count; 68 69 if nargs < 1 | nargs > 2 then 70 call com_err_ (error_table_$wrong_no_of_args, caller_name, "^/^a^/", 71 "Usage: smdb db_path [-set|-reset|-display]"); 72 else do; 73 74 /* get optional control arguments and set defaultts */ 75 76 secure, change = ON; /* defaults */ 77 78 if nargs = 2 then do; /* control arg supplied */ 79 80 call cu_$arg_ptr (2, arg_ptr, arg_len, code); 81 if code ^= 0 then 82 call com_err_ (code, caller_name, "^/^a", 83 "Unable to get the control argument."); 84 else do; 85 86 if arg = "-set" then ; 87 else if arg = "-reset" | arg = "-rs" then 88 secure = OFF; 89 else if arg = "-display" | arg = "-di" then 90 change = OFF; 91 else do; 92 code = error_table_$badopt; 93 call com_err_ (code, caller_name, "^/^a^a^a", 94 "Unknown control argument """, arg, """ given."); 95 end; 96 end; 97 end; 98 99 if code ^= 0 then ; 100 else do; 101 102 /* get the database pathname argument */ 103 104 call cu_$arg_ptr (1, arg_ptr, arg_len, code); 105 if code ^= 0 then 106 call com_err_ (code, caller_name, "^/^a", 107 "Unable to get database pathname argument."); 108 else do; 109 110 call mrds_dsl_get_version$get_path_info ((arg), addr (local_area), 111 mrds_path_info_structure_version, mrds_path_info_ptr, code); 112 113 if mrds_path_info_ptr = null () then 114 db_path = arg; 115 else do; 116 db_path = mrds_path_info.absolute_path; 117 version = mrds_path_info.mrds_version; 118 end; 119 120 if code ^= 0 then 121 call com_err_ (code, caller_name, "^/^a^a^a", 122 "Unable to get version of the database using the path """, db_path, """."); 123 else do; 124 125 /* check that we do not have a submodel, or database version < 4 */ 126 127 if mrds_path_info.type.submodel then do; 128 code = error_table_$badcall; 129 call com_err_ (code, caller_name, "^/^a ^a", 130 "Data submodels are not supported by this command. ", db_path); 131 end; 132 else if version < 4 then do; 133 code = mrds_error_$version_not_supported; 134 call com_err_ (code, caller_name, "^/^a^a^a ^d ^a", 135 "The pathname """, db_path, """ referes to a version", version, 136 "database (< 4) not supported by this command."); 137 end; 138 139 140 141 /* if valid version 4 database path, process the command */ 142 143 if code ^= 0 then ; 144 else call process_security (); 145 146 end; 147 end; 148 end; 149 end; 150 151 call clean_up (); 152 153 return; 154 155 process_security: procedure (); 156 157 /* routine to open data model, and change/display security bit 158* now that we have a good database pathname */ 159 160 call mrds_dm_open (db_path, mode, data_model_ptr, code); 161 if code ^= 0 then 162 call com_err_ (code, caller_name, "^/^a^a^a", 163 "Unable to open the database model using the path """, db_path, """."); 164 165 else do; 166 167 if change then do; 168 169 /* change the database secured bit according to the option given */ 170 171 if secure then 172 call mrds_dm_db_secured$set_db_secured (data_model_ptr, code); 173 else call mrds_dm_db_secured$reset_db_secured (data_model_ptr, code); 174 175 if code ^= 0 then 176 call com_err_ (code, caller_name, "^/^a^a^a", 177 "Unable to change the database security using the path """, db_path, """."); 178 end; 179 180 /* display the current secured bit status */ 181 182 if code = 0 then do; 183 184 call mrds_dm_db_secured$get_secured_status (data_model_ptr, addr (local_area), 185 database_state_structure_version, database_state_ptr, code); 186 if code ^= 0 then 187 call com_err_ (code, caller_name, "^/^a^a^a", 188 "Unable to get the status of the security for database at """, db_path, """."); 189 else do; 190 191 if database_state.secured then 192 call ioa_ ("^/The database at ""^a"" has been secured.", db_path); 193 else call ioa_ ("^/The database at ""^a"" is not secured.", db_path); 194 195 end; 196 end; 197 end; 198 199 end; 200 201 clean_up: procedure (); 202 203 /* routine to clean up after error or normal termination */ 204 205 if data_model_ptr = null () then ; 206 else do; 207 208 call mrds_dm_close (data_model_ptr, code); 209 data_model_ptr = null (); 210 211 end; 212 213 end; 214 215 declare code fixed bin (35); /* error status encoding */ 216 declare cleanup condition; /* signaled upon quit - release */ 217 declare error_table_$badopt fixed bin (35) ext;/* unknown control arg */ 218 declare data_model_ptr ptr; /* points to database model */ 219 declare mrds_error_$version_not_supported fixed bin (35) ext; /* not version 4 db */ 220 declare mrds_dm_open entry (char (168), fixed bin, ptr, fixed bin (35)); /* opens database model */ 221 declare mode fixed bin init (2);/* retrieval model opening mode */ 222 declare mrds_dm_close entry (ptr, fixed bin (35)); /* closes database model */ 223 declare ON bit (1) init ("1"b); /* true value */ 224 declare OFF bit (1) init ("0"b); /* false value */ 225 declare error_table_$wrong_no_of_args fixed bin (35) ext; /* args ^= 1 or 2 */ 226 declare mrds_dsl_get_version$get_path_info entry 227 (char (*), ptr, fixed bin, ptr, fixed bin (35)); /* gets version of db */ 228 declare db_path char (168); /* pathname of database */ 229 declare version fixed bin; /* version number of dtabase */ 230 declare ioa_ entry options (variable); /* reports secured bit status */ 231 declare change bit (1); /* on => change existing secured bit status */ 232 declare secure bit (1); /* on => set secured bit to on */ 233 declare cu_$arg_list_ptr entry (ptr); /* gets argument list */ 234 declare cu_$arg_ptr entry (fixed bin, ptr, fixed bin (21), fixed bin (35)); /* gets arg N */ 235 declare arg char (arg_len) based (arg_ptr); /* argument */ 236 declare arg_len fixed bin (21); /* length of argument */ 237 declare arg_ptr ptr; /* points to argument */ 238 declare com_err_ entry options (variable); /* reports errors */ 239 declare caller_name char (32) init ("secure_mrds_db"); /* name of calling routine */ 240 declare mrds_dm_db_secured$get_secured_status entry (ptr, ptr, fixed bin, 241 ptr, fixed bin (35)); /* gets state of secured bit in db */ 242 declare local_area area (1024); /* space for database state structure */ 243 declare mrds_dm_db_secured$set_db_secured entry (ptr, fixed bin (35)); /* sets secured bit to on */ 244 declare mrds_dm_db_secured$reset_db_secured entry (ptr, fixed bin (35)); /* resets secured bit */ 245 declare nargs fixed bin; /* number of arguments */ 246 declare error_table_$badcall fixed bin (35) ext;/* submodel path given */ 247 declare (addr, empty, null) builtin; 248 1 1 /* BEGIN mdbm_arg_list.incl.pl1 -- jaw 5/31/78 */ 1 2 /* the duplicate mrds_arg_list.incl.pl1 was eliminated by Jim Gray, Nov. 1979 */ 1 3 1 4 /* layout of argument list for IDS and DBM entries with options (variable) */ 1 5 1 6 dcl 1 arg_list based (al_ptr), 1 7 2 arg_count fixed bin (17) unal, /* 2 * no. of args. */ 1 8 2 code fixed bin (17) unal, /* 4 => normal, 8 => special */ 1 9 2 desc_count fixed bin (17) unal, /* 2 * no. of descriptors */ 1 10 2 pad fixed bin (17) unal, /* must be 0 */ 1 11 2 arg_des_ptr (num_ptrs) ptr; /* argument/descriptor pointer */ 1 12 1 13 dcl al_ptr ptr; 1 14 dcl num_ptrs fixed bin; 1 15 1 16 /* END mdbm_arg_list.incl.pl1 */ 1 17 249 250 2 1 /* BEGIN INCLUDE FILE mrds_database_state.incl.pl1 - - 81-01-20 Jim Gray */ 2 2 2 3 /* HISTORY: 2 4* 2 5* 81-01-20 Jim Gray : original created for the mmi_$get_secured_status interface 2 6* 2 7**/ 2 8 2 9 /* DESCRIPTION: 2 10* 2 11* This structure returns the database state (secured or unsecured) 2 12* for determining how commands and subroutines will behave for each case. 2 13* The secured bit was kept separate from the unsecured, 2 14* rather than it's logical "not", to allow for future extensibility 2 15* of database secured states. 2 16* 2 17**/ 2 18 2 19 2 20 declare 1 database_state aligned based (database_state_ptr), 2 21 2 version fixed bin, /* version number of this structure */ 2 22 2 unsecured bit (1) unal, /* database not secured */ 2 23 2 secured bit (1) unal, /* database has been secured */ 2 24 2 mbz bit (34) unal ; 2 25 2 26 2 27 declare database_state_ptr ptr ; /* pointer for referring to the structure */ 2 28 2 29 declare database_state_structure_version fixed bin init (1) int static options (constant) ; 2 30 2 31 /* END INCLUDE FILE mrds_database_state.incl.pl1 */ 251 252 3 1 /* BEGIN INCLUDE FILE mrds_path_info.incl.pl1 - - Jim Gray 81-01-22 */ 3 2 3 3 /* HISTORY: 3 4* 3 5* 81-01-22 Jim Gray : originaly created for the dsl_$get_path_info interface, 3 6* a slight extension to the undocumented mrds_dsl_get_version$header. 3 7* 3 8**/ 3 9 3 10 /* DESCRIPTION: 3 11* 3 12* This structure returns information about a relative pathname, given 3 13* to a pathname accepting mrds interface. The information returned 3 14* is the absolute pathname, plus in the case that 3 15* the relative path points to a mrds database or submodel 3 16* whether it is a model or a submodel, the mrds version of 3 17* the model or submodel, it's creator, and the time of creation. 3 18* 3 19**/ 3 20 3 21 3 22 declare 1 mrds_path_info aligned based (mrds_path_info_ptr), 3 23 2 version fixed bin, /* version number for this structure */ 3 24 2 absolute_path char (168), /* the absolute path from the input relative path */ 3 25 2 type, 3 26 3 not_mrds bit (1) unal, /* on => path not to model or submodel */ 3 27 3 model bit (1) unal, /* on => path to database model, thus possible .db suffix */ 3 28 3 submodel bit (1) unal, /* on => path to submodel, thus possible .dsm suffix */ 3 29 3 mbz1 bit (33) unal, 3 30 2 mrds_version fixed bin, /* the mrds version number of the model or submodel */ 3 31 2 creator_id char (32), /* the person.project.tag of the creator */ 3 32 2 creation_time fixed bin (71), /* convert date to binary form of time model/submodel created */ 3 33 2 mbz2 bit (36) unal ; 3 34 3 35 3 36 declare mrds_path_info_ptr ptr ; 3 37 3 38 declare mrds_path_info_structure_version fixed bin init (1) int static options (constant) ; 3 39 3 40 /* END INCLUDE FILE mrds_path_info.incl.pl1 */ 253 254 255 end; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 04/18/00 1145.2 secure_mrds_db.pl1 >udd>sm>ds>w>ml>secure_mrds_db.pl1 249 1 10/14/83 1709.0 mdbm_arg_list.incl.pl1 >ldd>incl>mdbm_arg_list.incl.pl1 251 2 10/14/83 1708.8 mrds_database_state.incl.pl1 >ldd>incl>mrds_database_state.incl.pl1 253 3 10/14/83 1708.8 mrds_path_info.incl.pl1 >ldd>incl>mrds_path_info.incl.pl1 NAMES DECLARED IN THIS COMPILATION. IDENTIFIER OFFSET LOC STORAGE CLASS DATA TYPE ATTRIBUTES AND REFERENCES (* indicates a set context) NAMES DECLARED BY DECLARE STATEMENT. OFF 000114 automatic bit(1) initial packed unaligned dcl 224 set ref 87 89 224* ON 000113 automatic bit(1) initial packed unaligned dcl 223 set ref 76 223* absolute_path 1 based char(168) level 2 dcl 3-22 ref 116 addr builtin function dcl 247 ref 110 110 184 184 al_ptr 002210 automatic pointer dcl 1-13 set ref 65* 66 67 arg based char packed unaligned dcl 235 set ref 86 87 87 89 89 93* 110 113 arg_count based fixed bin(17,0) level 2 packed packed unaligned dcl 1-6 ref 66 67 arg_len 000172 automatic fixed bin(21,0) dcl 236 set ref 80* 86 87 87 89 89 93 93 104* 110 113 arg_list based structure level 1 unaligned dcl 1-6 arg_ptr 000174 automatic pointer dcl 237 set ref 80* 86 87 87 89 89 93 104* 110 113 caller_name 000176 automatic char(32) initial packed unaligned dcl 239 set ref 69* 81* 93* 105* 120* 129* 134* 161* 175* 186* 239* change 000170 automatic bit(1) packed unaligned dcl 231 set ref 76* 89* 167 cleanup 000102 stack reference condition dcl 216 ref 61 code 000100 automatic fixed bin(35,0) dcl 215 set ref 59* 80* 81 81* 92* 93* 99 104* 105 105* 110* 120 120* 128* 129* 133* 134* 143 160* 161 161* 171* 173* 175 175* 182 184* 186 186* 208* com_err_ 000032 constant entry external dcl 238 ref 69 81 93 105 120 129 134 161 175 186 cu_$arg_list_ptr 000026 constant entry external dcl 233 ref 65 cu_$arg_ptr 000030 constant entry external dcl 234 ref 80 104 data_model_ptr 000110 automatic pointer dcl 218 set ref 60* 160* 171* 173* 184* 205 208* 209* database_state based structure level 1 dcl 2-20 database_state_ptr 002214 automatic pointer dcl 2-27 set ref 184* 191 database_state_structure_version 000033 constant fixed bin(17,0) initial dcl 2-29 set ref 184* db_path 000115 automatic char(168) packed unaligned dcl 228 set ref 113* 116* 120* 129* 134* 160* 161* 175* 186* 191* 193* empty builtin function dcl 247 ref 242 error_table_$badcall 000042 external static fixed bin(35,0) dcl 246 ref 128 error_table_$badopt 000010 external static fixed bin(35,0) dcl 217 ref 92 error_table_$wrong_no_of_args 000020 external static fixed bin(35,0) dcl 225 set ref 69* ioa_ 000024 constant entry external dcl 230 ref 191 193 local_area 000206 automatic area(1024) dcl 242 set ref 110 110 184 184 242* mode 000112 automatic fixed bin(17,0) initial dcl 221 set ref 160* 221* mrds_dm_close 000016 constant entry external dcl 222 ref 208 mrds_dm_db_secured$get_secured_status 000034 constant entry external dcl 240 ref 184 mrds_dm_db_secured$reset_db_secured 000040 constant entry external dcl 244 ref 173 mrds_dm_db_secured$set_db_secured 000036 constant entry external dcl 243 ref 171 mrds_dm_open 000014 constant entry external dcl 220 ref 160 mrds_dsl_get_version$get_path_info 000022 constant entry external dcl 226 ref 110 mrds_error_$version_not_supported 000012 external static fixed bin(35,0) dcl 219 ref 133 mrds_path_info based structure level 1 dcl 3-22 mrds_path_info_ptr 002216 automatic pointer dcl 3-36 set ref 110* 113 116 117 127 mrds_path_info_structure_version 000033 constant fixed bin(17,0) initial dcl 3-38 set ref 110* mrds_version 54 based fixed bin(17,0) level 2 dcl 3-22 ref 117 nargs 002206 automatic fixed bin(17,0) dcl 245 set ref 66* 69 69 78 null builtin function dcl 247 ref 60 113 205 209 num_ptrs 002212 automatic fixed bin(17,0) dcl 1-14 set ref 67* secure 000171 automatic bit(1) packed unaligned dcl 232 set ref 76* 87* 171 secured 1(01) based bit(1) level 2 packed packed unaligned dcl 2-20 ref 191 submodel 53(02) based bit(1) level 3 packed packed unaligned dcl 3-22 ref 127 type 53 based structure level 2 dcl 3-22 version 000167 automatic fixed bin(17,0) dcl 229 set ref 117* 132 134* NAMES DECLARED BY EXPLICIT CONTEXT. clean_up 001550 constant entry internal dcl 201 ref 61 151 process_security 001225 constant entry internal dcl 155 ref 144 secure_mrds_db 000341 constant entry external dcl 29 smdb 000331 constant entry external dcl 29 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 2030 2074 1600 2040 Length 2344 1600 44 234 227 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME smdb 1352 external procedure is an external procedure. on unit on line 61 64 on unit process_security internal procedure shares stack frame of external procedure smdb. clean_up 70 internal procedure is called by several nonquick procedures. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME smdb 000100 code smdb 000110 data_model_ptr smdb 000112 mode smdb 000113 ON smdb 000114 OFF smdb 000115 db_path smdb 000167 version smdb 000170 change smdb 000171 secure smdb 000172 arg_len smdb 000174 arg_ptr smdb 000176 caller_name smdb 000206 local_area smdb 002206 nargs smdb 002210 al_ptr smdb 002212 num_ptrs smdb 002214 database_state_ptr smdb 002216 mrds_path_info_ptr smdb THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. alloc_char_temp call_ext_out_desc call_ext_out call_int_this call_int_other return_mac enable_op shorten_stack ext_entry int_entry trunc_fx2 divide_fx1 op_empty_ THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. com_err_ cu_$arg_list_ptr cu_$arg_ptr ioa_ mrds_dm_close mrds_dm_db_secured$get_secured_status mrds_dm_db_secured$reset_db_secured mrds_dm_db_secured$set_db_secured mrds_dm_open mrds_dsl_get_version$get_path_info THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. error_table_$badcall error_table_$badopt error_table_$wrong_no_of_args mrds_error_$version_not_supported LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 221 000313 223 000315 224 000317 239 000320 242 000323 29 000330 59 000347 60 000350 61 000352 65 000374 66 000403 67 000414 69 000416 76 000456 78 000461 80 000463 81 000502 86 000537 87 000546 89 000561 92 000574 93 000577 99 000644 104 000647 105 000666 110 000723 113 000765 116 001000 117 001004 120 001006 127 001055 128 001061 129 001064 131 001121 132 001122 133 001125 134 001130 143 001214 144 001217 151 001220 153 001224 155 001225 160 001226 161 001243 167 001312 171 001314 173 001330 175 001341 182 001407 184 001411 186 001432 191 001501 193 001526 199 001546 201 001547 205 001555 208 001563 209 001573 213 001576 ----------------------------------------------------------- Historical Background This edition of the Multics software materials and documentation is provided and donated to Massachusetts Institute of Technology by Group BULL including BULL HN Information Systems Inc. as a contribution to computer science knowledge. This donation is made also to give evidence of the common contributions of Massachusetts Institute of Technology, Bell Laboratories, General Electric, Honeywell Information Systems Inc., Honeywell BULL Inc., Groupe BULL and BULL HN Information Systems Inc. to the development of this operating system. Multics development was initiated by Massachusetts Institute of Technology Project MAC (1963-1970), renamed the MIT Laboratory for Computer Science and Artificial Intelligence in the mid 1970s, under the leadership of Professor Fernando Jose Corbato. Users consider that Multics provided the best software architecture for managing computer hardware properly and for executing programs. Many subsequent operating systems incorporated Multics principles. Multics was distributed in 1975 to 2000 by Group Bull in Europe , and in the U.S. by Bull HN Information Systems Inc., as successor in interest by change in name only to Honeywell Bull Inc. and Honeywell Information Systems Inc. . ----------------------------------------------------------- Permission to use, copy, modify, and distribute these programs and their documentation for any purpose and without fee is hereby granted,provided that the below copyright notice and historical background appear in all copies and that both the copyright notice and historical background and this permission notice appear in supporting documentation, and that the names of MIT, HIS, BULL or BULL HN not be used in advertising or publicity pertaining to distribution of the programs without specific prior written permission. Copyright 1972 by Massachusetts Institute of Technology and Honeywell Information Systems Inc. Copyright 2006 by BULL HN Information Systems Inc. Copyright 2006 by Bull SAS All Rights Reserved