COMPILATION LISTING OF SEGMENT ls_cleanup_connections_ Compiled by: Multics PL/I Compiler, Release 29, of July 28, 1986 Compiled at: Honeywell Bull, Phx. Az., Sys-M Compiled on: 08/04/87 1303.5 mst Tue Options: optimize map 1 /****^ ******************************************** 2* * * 3* * Copyright, (C) Honeywell Bull Inc., 1987 * 4* * * 5* ******************************************** */ 6 7 /****^ HISTORY COMMENTS: 8* 1) change(85-08-01,Coren), approve(87-07-10,MCR7679), audit(87-03-18,GDixon), 9* install(87-08-04,MR12.1-1055): 10* Initial coding. 11* 2) change(87-03-18,GDixon), approve(87-07-10,MCR7679), 12* audit(87-05-19,Parisek), install(87-08-04,MR12.1-1055): 13* Correct coding standard violations. 14* 3) change(87-05-28,GDixon), approve(87-07-10,MCR7679), 15* audit(87-07-02,Parisek), install(87-08-04,MR12.1-1055): 16* A) Remove orphan connections from active_connection_list which DSA does 17* not know about. 18* B) Remove orphan connections from active_connection_list which have no 19* force_disconnect entry. 20* END HISTORY COMMENTS */ 21 22 /* format: style4,delnl,insnl,^ifthendo */ 23 24 ls_cleanup_connections_: 25 procedure (); 26 27 /* This routine is called during login_server initialization. Its job is to 28* go through the active_connection_list and find any connections whose owner 29* and user (if different) are both dead (i.e., invalid process IDs), and try 30* to disconnect them. 31**/ 32 33 /* AUTOMATIC */ 34 35 dcl code fixed bin (35); 36 dcl more bit (1); 37 dcl offset bit (18); 38 dcl owner_process_id bit (36) aligned; 39 dcl user_process_id bit (36) aligned; 40 dcl orphan bit (1); 41 dcl force_disconnect_name char (64); 42 43 dcl 1 current_active_connection_info aligned like active_connection_info; 44 45 dcl 1 next_active_connection_info aligned like active_connection_info; 46 47 48 /* ENTRIES */ 49 50 dcl com_err_ entry () options (variable); 51 dcl cv_entry_ entry (char (*), ptr, fixed bin (35)) returns (entry); 52 dcl hcs_$validate_processid entry (bit (36) aligned, fixed bin (35)); 53 dcl hpriv_connection_list_$delete_name entry (char (*) aligned, fixed bin (35)); 54 dcl hpriv_connection_list_$get_next entry (bit (18), ptr, fixed bin (35)); 55 56 dcl entry_to_call entry (char (*), fixed bin (35)) variable; 57 58 59 /* EXTERNAL STATIC */ 60 61 dcl ( 62 error_table_$io_no_permission, 63 error_table_$noentry, 64 error_table_$process_unknown 65 ) fixed bin (35) external static; 66 67 68 /* INTERNAL STATIC */ 69 70 dcl PROG_NAME char (23) internal static options (constant) initial ("ls_cleanup_connections_"); 71 72 73 /* BUILTINS & CONDITIONS */ 74 75 dcl (addr, null) builtin; 76 77 next_active_connection_info.version = ACT_INFO_VERSION_1; 78 79 more = Get_next (""b); 80 do while (more); 81 offset = next_active_connection_info.offset; 82 83 owner_process_id = next_active_connection_info.owner_process_id; 84 call hcs_$validate_processid (owner_process_id, code); 85 if code ^= 0 86 then do; 87 if code ^= error_table_$process_unknown 88 then call com_err_ (code, PROG_NAME, "From hcs_$validate_processid."); 89 90 user_process_id = next_active_connection_info.user_process_id; 91 if user_process_id = ""b 92 then orphan = "1"b; 93 94 else if user_process_id = owner_process_id 95 then orphan = "1"b; 96 97 else do; 98 call hcs_$validate_processid (user_process_id, code); 99 orphan = (code ^= 0); 100 if code ^= 0 & code ^= error_table_$process_unknown 101 then call com_err_ (code, PROG_NAME, "From hcs_$validate_processid."); 102 103 end; 104 105 if orphan 106 then current_active_connection_info = next_active_connection_info; 107 end; 108 109 else orphan = "0"b; 110 111 /* Have to get the next one before we process this one, because force_disconnect 112* will probably result in current one's deletion */ 113 114 more = Get_next (offset); 115 116 if orphan 117 then do; 118 force_disconnect_name = current_active_connection_info.force_disconnect_entry; 119 120 if force_disconnect_name ^= "" 121 then do; 122 123 entry_to_call = cv_entry_ (force_disconnect_name, null (), code); 124 if code = 0 125 then call entry_to_call ((current_active_connection_info.connection_name), code); 126 127 128 if code ^= 0 129 then call com_err_ (code, PROG_NAME, "Force disconnecting ^a using ^a.", 130 current_active_connection_info.connection_name, force_disconnect_name); 131 if code = error_table_$io_no_permission 132 & current_active_connection_info.network_service_type = "DSA" 133 then do; /* DSA no longer recognizes session. */ 134 call hpriv_connection_list_$delete_name (current_active_connection_info.connection_name, 135 code); 136 if code ^= 0 137 then call com_err_ (code, PROG_NAME, "Deleting ^a from connection list.", 138 current_active_connection_info.connection_name); 139 end; 140 end; 141 142 else do; 143 call com_err_ (0, PROG_NAME, "No force_disconnect entry for ^a.", 144 current_active_connection_info.connection_name); 145 call hpriv_connection_list_$delete_name (current_active_connection_info.connection_name, code); 146 if code ^= 0 147 then call com_err_ (code, PROG_NAME, "Deleting ^a from connection list.", 148 current_active_connection_info.connection_name); 149 end; 150 end; 151 end; 152 153 EXIT: 154 return; 155 156 Get_next: 157 procedure (a_offset) returns (bit (1)); 158 159 dcl a_offset bit (18); 160 161 dcl offset bit (18); 162 dcl code fixed bin (35); 163 164 offset = a_offset; 165 call hpriv_connection_list_$get_next (offset, addr (next_active_connection_info), code); 166 if code = error_table_$noentry 167 then return ("0"b); 168 169 else if code ^= 0 170 then do; 171 call com_err_ (code, PROG_NAME, "Calling hpriv_connection_list_$get_next."); 172 go to EXIT; 173 end; 174 175 else return ("1"b); 176 end Get_next; 177 1 1 /* BEGIN: active_connection_info.incl.pl1 * * * * * */ 1 2 1 3 /****^ HISTORY COMMENTS: 1 4* 1) change(86-06-30,Coren), approve(86-06-30,MCR7415), 1 5* audit(86-07-02,Margolin), install(86-07-11,MR12.0-1092): 1 6* Initial implementation. 1 7* 2) change(87-04-07,GDixon), approve(87-06-24,MCR7681), 1 8* audit(87-06-24,Hartogs), install(87-08-04,MR12.1-1056): 1 9* Add .force_accounting_flush_entry element. 1 10* 3) change(87-05-13,Brunelle), approve(87-06-24,MCR7681), 1 11* audit(87-06-24,Hartogs), install(87-08-04,MR12.1-1056): 1 12* Add .owner_group_id field. 1 13* END HISTORY COMMENTS */ 1 14 1 15 /* Defines the information returned to the outer ring about a single entry in 1 16* the active connection list */ 1 17 1 18 dcl active_connection_info_ptr pointer; 1 19 1 20 dcl 1 active_connection_info aligned based (active_connection_info_ptr), 1 21 2 version char (8), /* "actiNNNN" */ 1 22 2 connection_name char (32), /* name of the connection */ 1 23 2 network_service_type char (32), /* name of service */ 1 24 2 user_process_id bit (36), /* process assigned as the user */ 1 25 2 user_group_id char (32), /* likewise */ 1 26 2 owner_process_id bit (36), /* process that created the connection */ 1 27 2 owner_group_id char (32), /* likewise */ 1 28 2 terminate_event_channel fixed bin (71), /* channel to wake the owner if user process terminates */ 1 29 2 owner_initializer_handle bit (72), /* handle for communicating with initializer */ 1 30 2 force_disconnect_entry char (64), /* name of entry to call to force disconnection */ 1 31 /* (in case owner is gone) */ 1 32 2 force_accounting_flush_entry char (64), /* name of entry to call to force accounting flush */ 1 33 2 connection_handle fixed bin (35), /* handle used in calling service entries */ 1 34 2 usage_type fixed bin, /* login, etc. see ls_usage_types.incl.pl1 */ 1 35 2 flags, 1 36 3 delegated bit (1) unaligned, /* assigned to user by owner */ 1 37 3 mbz_bits bit (35) unaligned, 1 38 2 offset bit (18); /* offset of entry in connection list segment */ 1 39 1 40 dcl ACT_INFO_VERSION_1 char (8) internal static options (constant) initial ("acti0001"); 1 41 1 42 1 43 /* END OF: active_connection_info.incl.pl1 * * * * * */ 178 179 180 end ls_cleanup_connections_; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 08/04/87 1221.9 ls_cleanup_connections_.pl1 >special_ldd>install>MR12.1-1054>ls_cleanup_connections_.pl1 178 1 08/04/87 1140.5 active_connection_info.incl.pl1 >spec>install>1056>active_connection_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. ACT_INFO_VERSION_1 000000 constant char(8) initial unaligned dcl 1-40 ref 77 PROG_NAME 000002 constant char(23) initial unaligned dcl 70 set ref 87* 100* 128* 136* 143* 146* 171* a_offset parameter bit(18) unaligned dcl 159 ref 156 164 active_connection_info based structure level 1 dcl 1-20 addr builtin function dcl 75 ref 165 165 code 000100 automatic fixed bin(35,0) dcl 35 in procedure "ls_cleanup_connections_" set ref 84* 85 87 87* 98* 99 100 100 100* 123* 124 124* 128 128* 131 134* 136 136* 145* 146 146* code 000371 automatic fixed bin(35,0) dcl 162 in procedure "Get_next" set ref 165* 166 169 171* com_err_ 000010 constant entry external dcl 50 ref 87 100 128 136 143 146 171 connection_name 2 000126 automatic char(32) level 2 dcl 43 set ref 124 128* 134* 136* 143* 145* 146* current_active_connection_info 000126 automatic structure level 1 dcl 43 set ref 105* cv_entry_ 000012 constant entry external dcl 51 ref 123 entry_to_call 000356 automatic entry variable dcl 56 set ref 123* 124 error_table_$io_no_permission 000022 external static fixed bin(35,0) dcl 61 ref 131 error_table_$noentry 000024 external static fixed bin(35,0) dcl 61 ref 166 error_table_$process_unknown 000026 external static fixed bin(35,0) dcl 61 ref 87 100 force_disconnect_entry 50 000126 automatic char(64) level 2 dcl 43 set ref 118 force_disconnect_name 000106 automatic char(64) unaligned dcl 41 set ref 118* 120 123* 128* hcs_$validate_processid 000014 constant entry external dcl 52 ref 84 98 hpriv_connection_list_$delete_name 000016 constant entry external dcl 53 ref 134 145 hpriv_connection_list_$get_next 000020 constant entry external dcl 54 ref 165 more 000101 automatic bit(1) unaligned dcl 36 set ref 79* 80 114* network_service_type 12 000126 automatic char(32) level 2 dcl 43 set ref 131 next_active_connection_info 000242 automatic structure level 1 dcl 45 set ref 105 165 165 null builtin function dcl 75 ref 123 123 offset 113 000242 automatic bit(18) level 2 in structure "next_active_connection_info" dcl 45 in procedure "ls_cleanup_connections_" set ref 81 offset 000370 automatic bit(18) unaligned dcl 161 in procedure "Get_next" set ref 164* 165* offset 000102 automatic bit(18) unaligned dcl 37 in procedure "ls_cleanup_connections_" set ref 81* 114* orphan 000105 automatic bit(1) unaligned dcl 40 set ref 91* 94* 99* 105 109* 116 owner_process_id 000103 automatic bit(36) dcl 38 in procedure "ls_cleanup_connections_" set ref 83* 84* 94 owner_process_id 33 000242 automatic bit(36) level 2 in structure "next_active_connection_info" dcl 45 in procedure "ls_cleanup_connections_" set ref 83 user_process_id 000104 automatic bit(36) dcl 39 in procedure "ls_cleanup_connections_" set ref 90* 91 94 98* user_process_id 22 000242 automatic bit(36) level 2 in structure "next_active_connection_info" dcl 45 in procedure "ls_cleanup_connections_" set ref 90 version 000242 automatic char(8) level 2 dcl 45 set ref 77* NAME DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. active_connection_info_ptr automatic pointer dcl 1-18 NAMES DECLARED BY EXPLICIT CONTEXT. EXIT 000556 constant label dcl 153 ref 172 Get_next 000557 constant entry internal dcl 156 ref 79 114 ls_cleanup_connections_ 000105 constant entry external dcl 24 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 1016 1046 666 1026 Length 1260 666 30 176 127 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME ls_cleanup_connections_ 356 external procedure is an external procedure. Get_next internal procedure shares stack frame of external procedure ls_cleanup_connections_. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME ls_cleanup_connections_ 000100 code ls_cleanup_connections_ 000101 more ls_cleanup_connections_ 000102 offset ls_cleanup_connections_ 000103 owner_process_id ls_cleanup_connections_ 000104 user_process_id ls_cleanup_connections_ 000105 orphan ls_cleanup_connections_ 000106 force_disconnect_name ls_cleanup_connections_ 000126 current_active_connection_info ls_cleanup_connections_ 000242 next_active_connection_info ls_cleanup_connections_ 000356 entry_to_call ls_cleanup_connections_ 000370 offset Get_next 000371 code Get_next THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. r_ne_as call_ent_var_desc call_ext_out_desc call_ext_out return_mac ext_entry THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. com_err_ cv_entry_ hcs_$validate_processid hpriv_connection_list_$delete_name hpriv_connection_list_$get_next THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. error_table_$io_no_permission error_table_$noentry error_table_$process_unknown LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 24 000104 77 000112 79 000114 80 000120 81 000123 83 000125 84 000127 85 000140 87 000142 90 000170 91 000172 94 000176 98 000203 99 000214 100 000217 105 000247 107 000254 109 000255 114 000256 116 000260 118 000262 120 000265 123 000271 124 000320 128 000341 131 000376 134 000406 136 000422 140 000454 143 000455 145 000506 146 000523 151 000555 153 000556 156 000557 164 000561 165 000566 166 000603 169 000615 171 000617 172 000642 175 000643 ----------------------------------------------------------- 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