COMPILATION LISTING OF SEGMENT print_proc_auth Compiled by: Multics PL/I Compiler, Release 28d, of October 4, 1983 Compiled at: Honeywell Multics Op. - System M Compiled on: 08/10/84 1119.2 mst Fri Options: optimize map 1 /* *********************************************************** 2* * * 3* * Copyright, (C) Honeywell Information Systems Inc., 1982 * 4* * * 5* * Copyright (c) 1972 by Massachusetts Institute of * 6* * Technology and Honeywell Information Systems, Inc. * 7* * * 8* *********************************************************** */ 9 10 /* Procedure to print the access authorization of a process */ 11 /* Usage: print_proc_auth [options] 12* 13* no options: print process authorization using short level and category names. 14* 15* -long,-lg print process authorization using long level and category names. 16* 17* -all,-a: print the maximum authorization of this process also. 18* 19* If this process has any system privileges, they will also be printed */ 20 21 /* Originally coded by J. Whitmore 09/21/74 22* Modified 750417 by LJS 23* Modified 25 September 1983 by J. Spencer Love to add "comm" privilege and fix bugs. */ 24 25 ppa: 26 print_proc_auth: 27 procedure () options (variable); 28 29 dcl aptr pointer, /* arg pointer */ 30 alen fixed bin, /* arg length */ 31 bchar char (alen) based (aptr); /* arg string */ 32 33 dcl (current, max) bit (72) aligned; /* process authorizations */ 34 1 1 /* BEGIN INCLUDE FILE aim_template.incl.pl1 */ 1 2 1 3 /* Created 740723 by PG */ 1 4 /* Modified 06/28/78 by C. D. Tavares to add rcp privilege */ 1 5 /* Modified 83-05-10 by E. N. Kitltitz to add communications privilege */ 1 6 1 7 /* This structure defines the components of both an access 1 8* class and an access authorization as interpreted by the 1 9* Access Isolation Mechanism. */ 1 10 1 11 1 12 dcl 1 aim_template aligned based, /* authorization/access class template */ 1 13 2 categories bit (36), /* access categories */ 1 14 2 level fixed bin (17) unaligned, /* sensitivity level */ 1 15 2 privileges unaligned, /* special access privileges (in authorization only) */ 1 16 (3 ipc, /* interprocess communication privilege */ 1 17 3 dir, /* directory privilege */ 1 18 3 seg, /* segment privilege */ 1 19 3 soos, /* security out-of-service privilege */ 1 20 3 ring1, /* ring 1 access privilege */ 1 21 3 rcp, /* RCP resource access privilege */ 1 22 3 comm) bit (1), /* communications cross-AIM privilege */ 1 23 3 pad bit (11); 1 24 1 25 1 26 /* END INCLUDE FILE aim_template.incl.pl1 */ 35 36 37 dcl priv (18) char (8) varying static options (constant) init ("ipc", "dir", "seg", "soos", "ring1", "rcp", "comm", 38 "priv_8", "priv_9", "priv_10", "priv_11", "priv_12", "priv_13", "priv_14", "priv_15", "priv_16", "priv_17", 39 "priv_18"); 40 41 dcl auth_string char (512), /* string for authorization names */ 42 priv_string char (168) varying, /* string for privilege names */ 43 command char (24); /* entrypoint name for com_err_ */ 44 45 dcl long_sw bit (1) aligned init ("0"b), /* long option indicator */ 46 max_sw bit (1) aligned init ("0"b), /* -all option indicator */ 47 ec fixed bin (35), /* error code */ 48 i fixed bin, /* do loop index */ 49 nargs fixed bin; 50 51 dcl auth_p pointer, /* locator for auth structure */ 52 (addr, index, length, reverse, rtrim, string, substr) builtin; 53 54 dcl hcs_$get_authorization entry (bit (72) aligned, bit (72) aligned), 55 (ioa_, com_err_) entry options (variable), 56 cu_$arg_ptr entry (fixed bin, ptr, fixed bin, fixed bin (35)), 57 convert_authorization_$to_string entry (bit (72) aligned, char (*), fixed bin (35)), 58 cu_$arg_count entry returns (fixed bin), 59 convert_authorization_$to_string_short entry (bit (72) aligned, char (*), fixed bin (35)), 60 error_table_$badopt ext static fixed bin (35); 61 62 command = "print_proc_auth"; 63 nargs = cu_$arg_count (); 64 65 do i = 1 to nargs; 66 call cu_$arg_ptr (i, aptr, alen, ec); 67 if index (bchar, "-") ^= 1 then do; 68 call com_err_ (0, command, "Usage: ppa {-control_args}"); 69 return; 70 end; 71 if bchar = "-long" | bchar = "-lg" then long_sw = "1"b; 72 else if bchar = "-all" | bchar = "-a" then max_sw = "1"b; 73 else do; 74 ec = error_table_$badopt; 75 call com_err_ (ec, command, bchar); 76 return; 77 end; 78 79 end; 80 81 82 call hcs_$get_authorization (current, max); /* get the authorizations */ 83 84 if long_sw then 85 call convert_authorization_$to_string (current, auth_string, ec); 86 else call convert_authorization_$to_string_short (current, auth_string, ec); 87 88 if ec ^= 0 then /* if this happens, we're in trouble */ 89 call com_err_ (ec, command, "Could not convert current authorization."); 90 91 else do; 92 if auth_string = "" then call ioa_ ("^/Current authorization is un-named."); 93 else call print_formatted ("Current auth", auth_string); /* all was well, print it */ 94 end; 95 96 if max_sw then do; /* shall we print more info? */ 97 98 if long_sw then 99 call convert_authorization_$to_string (max, auth_string, ec); 100 else call convert_authorization_$to_string_short (max, auth_string, ec); 101 102 if ec ^= 0 then do; /* conversion trouble? */ 103 call com_err_ (ec, command, "Could not convert max authorization."); 104 end; 105 else do; 106 if auth_string = "" then call ioa_ ("Maximum authorization is un-named."); 107 else call print_formatted ("Maximum auth", auth_string); 108 end; 109 end; 110 111 112 auth_p = addr (current); /* the privileges are in the last 18 bits of current */ 113 priv_string = ""; /* and null the string */ 114 do i = 1 to 18; /* look at all the priv bits */ 115 116 if substr (string (auth_p -> privileges), i, 1) then do; /* add the name */ 117 118 priv_string = priv_string || priv (i) || ","; 119 120 end; /* look for other bits */ 121 end; 122 123 if length (priv_string) > 1 then do; /* Only print privileges if set. */ 124 125 auth_string = substr (priv_string, 1, length (priv_string) - 1); /* Remove comma. */ 126 127 call print_formatted (" System Priv", auth_string); 128 end; 129 130 call ioa_ (); 131 132 return; 133 134 print_formatted: proc (title, string); 135 136 dcl (title, string) char (*), 137 ioa_$nnl entry options (variable), 138 (len, ind, max_len, max_ch, pos) fixed bin, 139 ll fixed bin init (71); /* maximum number of characters per line */ 140 141 ind = 1; /* initialize the string index */ 142 143 max_len = length (rtrim (string)); /* number of good chars */ 144 145 pos = length (title) + 4; /* get last used print position */ 146 147 do while ((max_len-ind + 1) >50); /* get ready to format */ 148 149 max_ch = ll - pos; /* max chars left for this line */ 150 len = index (reverse (substr (string, ind, max_ch)), ",") - 1; /* find last comma */ 151 /* in the string of chars that could */ 152 /* fit on this line */ 153 if len < 0 then len = 0; /* If no comma, get it right. */ 154 len = max_ch - len; /* number of chars for this line */ 155 call ioa_ ("^[^/^a:^;^s^]^vt^a", (ind = 1), title, pos, substr (string, ind, len)); 156 ind = ind + len; /* update the index */ 157 if substr (string, ind, 1) = " " then ind = ind + 1; /* Skip spaces in -long string */ 158 end; 159 160 call ioa_ ("^[^/^a:^;^s^]^vt^a", (ind = 1), title, pos, substr (string, ind)); 161 162 return; 163 164 end print_formatted; 165 166 end print_proc_auth; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 08/10/84 1119.0 print_proc_auth.pl1 >special_ldd>on>08/10/84-6894>print_proc_auth.pl1 35 1 09/07/83 1610.6 aim_template.incl.pl1 >ldd>include>aim_template.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. addr builtin function dcl 51 ref 112 aim_template based structure level 1 dcl 1-12 alen 000102 automatic fixed bin(17,0) dcl 29 set ref 66* 67 71 71 72 72 75 75 aptr 000100 automatic pointer dcl 29 set ref 66* 67 71 71 72 72 75 auth_p 000376 automatic pointer dcl 51 set ref 112* 116 auth_string 000110 automatic char(512) unaligned dcl 41 set ref 84* 86* 92 93* 98* 100* 106 107* 125* 127* bchar based char unaligned dcl 29 set ref 67 71 71 72 72 75* com_err_ 000014 constant entry external dcl 54 ref 68 75 88 103 command 000363 automatic char(24) unaligned dcl 41 set ref 62* 68* 75* 88* 103* convert_authorization_$to_string 000020 constant entry external dcl 54 ref 84 98 convert_authorization_$to_string_short 000024 constant entry external dcl 54 ref 86 100 cu_$arg_count 000022 constant entry external dcl 54 ref 63 cu_$arg_ptr 000016 constant entry external dcl 54 ref 66 current 000104 automatic bit(72) dcl 33 set ref 82* 84* 86* 112 ec 000373 automatic fixed bin(35,0) dcl 45 set ref 66* 74* 75* 84* 86* 88 88* 98* 100* 102 103* error_table_$badopt 000026 external static fixed bin(35,0) dcl 54 ref 74 hcs_$get_authorization 000010 constant entry external dcl 54 ref 82 i 000374 automatic fixed bin(17,0) dcl 45 set ref 65* 66* 114* 116 118* ind 000411 automatic fixed bin(17,0) dcl 136 set ref 141* 147 150 155 155 155 156* 156 157 157* 157 160 160 160 index builtin function dcl 51 ref 67 150 ioa_ 000012 constant entry external dcl 54 ref 92 106 130 155 160 len 000410 automatic fixed bin(17,0) dcl 136 set ref 150* 153 153* 154* 154 155 155 156 length builtin function dcl 51 ref 123 125 143 145 ll 000415 automatic fixed bin(17,0) initial dcl 136 set ref 136* 149 long_sw 000371 automatic bit(1) initial dcl 45 set ref 45* 71* 84 98 max 000106 automatic bit(72) dcl 33 set ref 82* 98* 100* max_ch 000413 automatic fixed bin(17,0) dcl 136 set ref 149* 150 154 max_len 000412 automatic fixed bin(17,0) dcl 136 set ref 143* 147 max_sw 000372 automatic bit(1) initial dcl 45 set ref 45* 72* 96 nargs 000375 automatic fixed bin(17,0) dcl 45 set ref 63* 65 pos 000414 automatic fixed bin(17,0) dcl 136 set ref 145* 149 155* 160* priv 000000 constant varying char(8) initial array dcl 37 ref 118 priv_string 000310 automatic varying char(168) dcl 41 set ref 113* 118* 118 123 125 125 privileges 1(18) based structure level 2 packed unaligned dcl 1-12 ref 116 reverse builtin function dcl 51 ref 150 rtrim builtin function dcl 51 ref 143 string builtin function dcl 51 in procedure "print_proc_auth" ref 116 string parameter char unaligned dcl 136 in procedure "print_formatted" ref 134 143 150 155 155 157 160 160 substr builtin function dcl 51 ref 116 125 150 155 155 157 160 160 title parameter char unaligned dcl 136 set ref 134 145 155* 160* NAME DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. ioa_$nnl 000000 constant entry external dcl 136 NAMES DECLARED BY EXPLICIT CONTEXT. ppa 000223 constant entry external dcl 25 print_formatted 001000 constant entry internal dcl 134 ref 93 107 127 print_proc_auth 000213 constant entry external dcl 25 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 1412 1442 1263 1422 Length 1650 1263 30 172 126 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME print_proc_auth 335 external procedure is an external procedure. print_formatted internal procedure shares stack frame of external procedure print_proc_auth. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME print_proc_auth 000100 aptr print_proc_auth 000102 alen print_proc_auth 000104 current print_proc_auth 000106 max print_proc_auth 000110 auth_string print_proc_auth 000310 priv_string print_proc_auth 000363 command print_proc_auth 000371 long_sw print_proc_auth 000372 max_sw print_proc_auth 000373 ec print_proc_auth 000374 i print_proc_auth 000375 nargs print_proc_auth 000376 auth_p print_proc_auth 000410 len print_formatted 000411 ind print_formatted 000412 max_len print_formatted 000413 max_ch print_formatted 000414 pos print_formatted 000415 ll print_formatted THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. r_e_as alloc_cs cat_realloc_cs call_ext_out_desc call_ext_out return shorten_stack ext_entry THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. com_err_ convert_authorization_$to_string convert_authorization_$to_string_short cu_$arg_count cu_$arg_ptr hcs_$get_authorization ioa_ THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. error_table_$badopt LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 45 000206 25 000212 62 000231 63 000234 65 000243 66 000253 67 000270 68 000304 69 000331 71 000332 72 000345 74 000360 75 000363 76 000406 79 000407 82 000411 84 000422 86 000446 88 000467 92 000516 93 000537 96 000547 98 000551 100 000575 102 000616 103 000620 104 000644 106 000645 107 000666 112 000675 113 000677 114 000700 116 000705 118 000712 120 000751 121 000752 123 000754 125 000757 127 000763 130 000772 132 000777 134 001000 136 001016 141 001020 143 001022 145 001037 147 001042 149 001047 150 001052 153 001065 154 001067 155 001071 156 001144 157 001147 158 001157 160 001160 162 001243 ----------------------------------------------------------- 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