COMPILATION LISTING OF SEGMENT cv_acl_ Compiled by: Multics PL/I Compiler, Release 27d, of October 11, 1982 Compiled at: Honeywell LISD Phoenix, System M Compiled on: 11/04/82 1756.1 mst Thu 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 11 cv_acl_: procedure (aclp, n, line, len, asw); 12 13 14 /* 15* 16* This procedure accepts a standard-format access control list entry 17* (one only), and formats it for printing, returning the formatted 18* string to the caller. Options allow the mode field, the user name, 19* and error message corresponding to the status code to be suppressed. 20* It is expected that when extended access is fully implemented, an 21* additional argument will specify the acl type. 22* 23* Option bit ("asw") definitions: 24* 25* bit 1 on add mode field 26* bit 2 on add error message 27* bit 3 on suppress user name 28* 29* Other option bit definitions may be added from time to time, in a 30* transparent way, i.e. having the bit set to 0 or omitted will 31* result in no change from the previous version of the program. 32* 33* P. Bos, May 1972 34* 35* Modified Apr. 1973 by Peter B. Kelley to change acl structure to new 36* hcs_ acl primitives. 37* Modified Jun. 1973 by P.B. Kelley removed "a" bit from ACL defs. 38* added cv_dir_acl_ entry and its associated 39* mode representations. 40* 41**/ 42 43 44 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 45 46 47 dcl aclp ptr, /* pointer to acl array */ 48 n fixed bin, /* array index of acl entry to format */ 49 line char(*), /* formatted output string */ 50 len fixed bin, /* number of significant chars in line */ 51 asw bit(*); /* option bits */ 52 53 dcl check_fs_errcode_ entry (fixed bin(35), char(8) aligned, char(100) aligned); 54 55 dcl (addr, fixed, length, substr) builtin; 56 57 dcl (e, i, l, ll, lmax) fixed bin; 58 59 dcl (p, sp, mp) ptr; 60 61 dcl sws bit(3) aligned; /* fixed-length copy of "asw" */ 62 63 dcl chars char(i) based(p), /* based char string */ 64 dummy char(8) aligned, /* passed to check_fs_errcode_ */ 65 info char(100) aligned; /* him too */ 66 67 dcl 1 s based (sp), /* overlaid on sws */ 68 (2 msw bit(1), /* non-zero if mode field to be added */ 69 2 esw bit(1), /* non-zero if error message to be added */ 70 2 nsw bit(1)) unal; /* non-zero if user name to be suppressed */ 71 72 dcl 1 SEG_mode aligned int static, /* segment mode representations */ 73 2 mode (0:7) char(4) init ( 74 "null", /* "000" */ 75 "w", /* "001" */ 76 "e", /* "010" */ 77 "ew", /* "011" */ 78 "r", /* "100" */ 79 "rw", /* "101" */ 80 "re", /* "110" */ 81 "rew"); /* "111" */ 82 83 dcl 1 DIR_mode aligned int static, /* directory mode representations */ 84 2 mode (0:7) char(4) init ( 85 "null", /* "000" */ 86 "a", /* "001" */ 87 "m", /* "010" */ 88 "ma", /* "011" */ 89 "s", /* "100" */ 90 "sa", /* "101" */ 91 "sm", /* "110" */ 92 "sma"); /* "111" */ 93 94 dcl 1 M based (mp) aligned, /* for referencing appropriate struc. */ 95 2 mode (0:7) char(4); 96 97 dcl 1 acl (n) aligned based (aclp), /* acl entry */ 98 2 userid char(32), /* user name */ 99 2 mode bit(36), /* 1-3 "rew", rest 0 */ 100 2 pad bit (36), /* must be 0 */ 101 2 code fixed bin (35); /* status code during processing */ 102 103 dcl 1 diracl (n) aligned based (aclp), /* dir acl entry */ 104 2 userid char(32), /* user name */ 105 2 mode bit(36), /* 1-3 "sma", rest 0 */ 106 2 code fixed bin (35); /* status code during processing */ 107 108 dcl acl_code fixed bin (35); /* copy of status code */ 109 110 /* */ 111 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 112 113 mp = addr(SEG_mode); /* point to segment modes */ 114 e = 1; 115 goto COMMON; 116 117 cv_dir_acl_: entry (aclp, n, line, len, asw); 118 119 mp = addr(DIR_mode); /* point to directory modes */ 120 e = 2; 121 122 COMMON: line = ""; /* initialize output string */ 123 l = 0; /* no chars in it yet */ 124 lmax = length (line); /* better not put more in */ 125 sws = asw; /* copy option bits */ 126 sp = addr (sws); /* and get pointer for overlay */ 127 if s.msw then do; /* user wants mode printed */ 128 if e = 1 then 129 call addchr (mp->M.mode (fixed (substr (acl(n).mode,1,3))) || " ");/* insert it (field width 10) */ 130 else 131 call addchr (mp->M.mode(fixed(substr(diracl(n).mode,1,3)))||" ");/* insert it(field width 10) */ 132 end; 133 if ^s.nsw then do; /* if user name not suppressed */ 134 ll = l; /* save current line length for later */ 135 if e = 1 then 136 p = addr (acl(n).userid); /* get pointer to name */ 137 else 138 p = addr ( diracl(n).userid); 139 i = 32; /* 32 chars long */ 140 call adjust (p, i); /* strip leading & trailing blanks */ 141 call addchr (chars); /* insert into line */ 142 end; 143 if s.esw then do; /* user wants error message */ 144 if e = 1 145 then acl_code = acl(n).code; /* copy segment acl code */ 146 else 147 acl_code = diracl(n).code; /* dir acl code in different place */ 148 if acl_code ^= 0 then do; /* looks like an error */ 149 if ^s.nsw then do; /* if we had user name, form neat columns */ 150 if l - ll < 20 then /* most user names ought to fit in 20 chars */ 151 l = ll + 20; /* add blanks if less than that */ 152 else /* if too big, */ 153 l = l + 1; /* add a blank */ 154 if l > lmax then do; /* make sure we didn't run out */ 155 l = ll + i; /* reset it if we did */ 156 go to rtn; /* and exit */ 157 end; 158 end; 159 call check_fs_errcode_( acl_code, dummy, info); /* get error message */ 160 p = addr (info); /* get pointer to it */ 161 i = 100; /* 100 chars long */ 162 call adjust (p, i); /* strip blanks */ 163 call addchr (chars); /* insert what's left */ 164 end; 165 end; 166 167 rtn: len = l; /* give caller length of string */ 168 return; /* and return to him */ 169 /* */ 170 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 171 172 173 addchr: procedure (arg); /* procedure to add arg to line */ 174 175 176 dcl arg char(*); /* char string to insert into line */ 177 178 dcl t fixed bin; /* temp */ 179 180 181 t = length (arg); /* get size of string to add */ 182 if t > lmax - l then /* maximum of lmax chars in message */ 183 t = lmax - l; /* make sure we don't run off end */ 184 if t ^= 0 then do; /* still room, put it in */ 185 substr (line, l+1, t) = arg; /* after what's already there */ 186 l = l + t; /* line got longer */ 187 end; 188 return; /* done */ 189 190 end addchr; 191 192 193 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 194 195 196 adjust: procedure (argp, argl); /* procedure to strip leading, trailing blanks */ 197 198 199 dcl argp ptr, /* pointer to char string */ 200 argl fixed bin; /* length of string */ 201 202 dcl t fixed bin; /* temp */ 203 204 dcl 1 c based (argp), /* char array overlaid on string */ 205 2 char (argl) char(1) unal; /* makes better code than substr */ 206 207 208 do t = 1 to argl; /* scan from front for first non-blank */ 209 if c.char(t) ^= " " then /* non-blank? */ 210 go to first; /* yes, exit loop */ 211 end; 212 first: argp = addr (c.char(t)); /* adjust pointer to point to it */ 213 argl = argl - t + 1; /* adjust length */ 214 if argl ^= 0 then do; /* if string not all blank */ 215 do t = argl to 1 by -1; /* scan from end for last non-blank */ 216 if c.char(t) ^= " " then /* found it? */ 217 go to last; /* yes, skip */ 218 end; 219 last: argl = t; /* set new length */ 220 end; 221 return; /* bye... */ 222 223 end adjust; 224 225 226 end cv_acl_; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 11/04/82 1624.3 cv_acl_.pl1 >dumps>old>recomp>cv_acl_.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. DIR_mode 000020 internal static structure level 1 dcl 83 set ref 119 M based structure level 1 dcl 94 SEG_mode 000010 internal static structure level 1 dcl 72 set ref 113 acl based structure array level 1 dcl 97 acl_code 000151 automatic fixed bin(35,0) dcl 108 set ref 144* 146* 148 159* aclp parameter pointer dcl 47 ref 11 117 128 130 135 137 144 146 addr builtin function dcl 55 ref 113 119 126 135 137 160 212 arg parameter char unaligned dcl 176 ref 173 181 185 argl parameter fixed bin(17,0) dcl 199 set ref 196 208 213* 213 214 215 219* argp parameter pointer dcl 199 set ref 196 209 212* 212 216 asw parameter bit unaligned dcl 47 ref 11 117 125 c based structure level 1 packed unaligned dcl 204 char based char(1) array level 2 packed unaligned dcl 204 set ref 209 212 216 chars based char unaligned dcl 63 set ref 141* 163* check_fs_errcode_ 000030 constant entry external dcl 53 ref 159 code 11 based fixed bin(35,0) array level 2 in structure "diracl" dcl 103 in procedure "cv_acl_" ref 146 code 12 based fixed bin(35,0) array level 2 in structure "acl" dcl 97 in procedure "cv_acl_" ref 144 diracl based structure array level 1 dcl 103 dummy 000116 automatic char(8) dcl 63 set ref 159* e 000100 automatic fixed bin(17,0) dcl 57 set ref 114* 120* 128 135 144 esw 0(01) based bit(1) level 2 packed unaligned dcl 67 ref 143 fixed builtin function dcl 55 ref 128 130 i 000101 automatic fixed bin(17,0) dcl 57 set ref 139* 140* 141 141 155 161* 162* 163 163 info 000120 automatic char(100) dcl 63 set ref 159* 160 l 000102 automatic fixed bin(17,0) dcl 57 set ref 123* 134 150 150* 152* 152 154 155* 167 182 182 185 186* 186 len parameter fixed bin(17,0) dcl 47 set ref 11 117 167* length builtin function dcl 55 ref 124 181 line parameter char unaligned dcl 47 set ref 11 117 122* 124 185* ll 000103 automatic fixed bin(17,0) dcl 57 set ref 134* 150 150 155 lmax 000104 automatic fixed bin(17,0) dcl 57 set ref 124* 154 182 182 mode 10 based bit(36) array level 2 in structure "diracl" dcl 103 in procedure "cv_acl_" ref 130 mode 10 based bit(36) array level 2 in structure "acl" dcl 97 in procedure "cv_acl_" ref 128 mode based char(4) array level 2 in structure "M" dcl 94 in procedure "cv_acl_" ref 128 130 mp 000112 automatic pointer dcl 59 set ref 113* 119* 128 130 msw based bit(1) level 2 packed unaligned dcl 67 ref 127 n parameter fixed bin(17,0) dcl 47 ref 11 117 128 130 135 137 144 146 nsw 0(02) based bit(1) level 2 packed unaligned dcl 67 ref 133 149 p 000106 automatic pointer dcl 59 set ref 135* 137* 140* 141 160* 162* 163 s based structure level 1 packed unaligned dcl 67 sp 000110 automatic pointer dcl 59 set ref 126* 127 133 143 149 substr builtin function dcl 55 set ref 128 130 185* sws 000114 automatic bit(3) dcl 61 set ref 125* 126 t 000160 automatic fixed bin(17,0) dcl 178 in procedure "addchr" set ref 181* 182 182* 184 185 186 t 000170 automatic fixed bin(17,0) dcl 202 in procedure "adjust" set ref 208* 209* 212 213 215* 216* 219 userid based char(32) array level 2 in structure "acl" dcl 97 in procedure "cv_acl_" set ref 135 userid based char(32) array level 2 in structure "diracl" dcl 103 in procedure "cv_acl_" set ref 137 NAMES DECLARED BY EXPLICIT CONTEXT. COMMON 000071 constant label dcl 122 ref 115 addchr 000346 constant entry internal dcl 173 ref 128 130 141 163 adjust 000404 constant entry internal dcl 196 ref 140 162 cv_acl_ 000015 constant entry external dcl 11 cv_dir_acl_ 000044 constant entry external dcl 117 first 000426 constant label dcl 212 ref 209 last 000460 constant label dcl 219 ref 216 rtn 000342 constant label dcl 167 ref 156 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 542 574 501 552 Length 736 501 32 126 41 20 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME cv_acl_ 139 external procedure is an external procedure. addchr internal procedure shares stack frame of external procedure cv_acl_. adjust internal procedure shares stack frame of external procedure cv_acl_. STORAGE FOR INTERNAL STATIC VARIABLES. LOC IDENTIFIER BLOCK NAME 000010 SEG_mode cv_acl_ 000020 DIR_mode cv_acl_ STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME cv_acl_ 000100 e cv_acl_ 000101 i cv_acl_ 000102 l cv_acl_ 000103 ll cv_acl_ 000104 lmax cv_acl_ 000106 p cv_acl_ 000110 sp cv_acl_ 000112 mp cv_acl_ 000114 sws cv_acl_ 000116 dummy cv_acl_ 000120 info cv_acl_ 000151 acl_code cv_acl_ 000160 t addchr 000170 t adjust THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. call_ext_out return ext_entry_desc THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. check_fs_errcode_ NO EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 11 000010 113 000035 114 000037 115 000041 117 000042 119 000064 120 000067 122 000071 123 000077 124 000100 125 000102 126 000110 127 000112 128 000116 130 000142 133 000162 134 000167 135 000171 137 000204 139 000213 140 000215 141 000217 143 000232 144 000237 146 000252 148 000261 149 000262 150 000266 152 000276 154 000277 155 000302 156 000305 159 000306 160 000321 161 000323 162 000325 163 000327 167 000342 168 000345 173 000346 181 000357 182 000360 184 000367 185 000371 186 000402 188 000403 196 000404 208 000406 209 000415 211 000424 212 000426 213 000435 214 000441 215 000442 216 000446 218 000455 219 000460 221 000462 ----------------------------------------------------------- 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