COMPILATION LISTING OF SEGMENT rebuild_dir Compiled by: Multics PL/I Compiler, Release 31a, of October 12, 1988 Compiled at: Bull HN, Phoenix AZ, System-M Compiled on: 03/15/89 0834.0 mst Wed 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 rebuild_dir: 12 proc; 13 14 15 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 16 /* */ 17 /* rebuild_dir - rebuild a partially clobbered directory from a dir_info segment. */ 18 /* Comments on missing segments: remakes directories or links. */ 19 /* */ 20 /* Status: */ 21 /* */ 22 /* 0) Created May, 1973 by T. H. VanVleck */ 23 /* 1) Modified Sept, 1982 by Jim Lippard to to not fault on "rebuild_dir >". */ 24 /* 2) Modified Oct, 1982 by G. C. Dixon - modernize code. */ 25 /* 3) Modified Dec, 1984 by Keith Loepere - dir_quota. 26* /* */ 27 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 28 29 dcl ap ptr, /* ptr to arg */ 30 al fixed bin (21), /* length of arg */ 31 an fixed bin, 32 bchr char (al) unal based (ap), /* pickup for argument */ 33 bitc fixed bin (24), 34 datstr char (24), 35 dn char (168), 36 dnen char (168), 37 ec fixed bin (35), /* error code */ 38 en char (32), 39 fdir char (168), 40 fent char (32), 41 (i, j) fixed bin, 42 loud bit (1), 43 my_userid char (32), 44 privmode bit (1), 45 rings (3) fixed bin, 46 xp ptr, 47 verbosity fixed bin init (1); 48 49 dcl (addr, binary, fixed, index, null, ptr, unspec) builtin; 50 51 dcl (cleanup, linkage_error) condition; 52 53 dcl 1 brsbuf aligned, /* auto storage for main dir branch */ 54 2 type bit (2) unal, 55 2 nnames bit (16) unal, 56 2 nrp bit (18) unal, 57 2 dtm bit (36) unal, 58 2 dtu bit (36) unal, 59 2 mode bit (5) unal, 60 2 padding bit (13) unal, 61 2 records bit (18) unal, 62 2 dtd bit (36) unal, 63 2 dtem bit (36) unal, 64 2 acct bit (36) unal, 65 2 curlen bit (12) unal, 66 2 bitcnt bit (24) unal, 67 2 did bit (4) unal, 68 2 mdid bit (4) unal, 69 2 copysw bit (1) unal, 70 2 pad2 bit (9) unal, 71 2 rbs (0:2) bit (6) unal, 72 2 uid bit (36) unal; 73 74 dcl 1 dir_acl (50) aligned, 75 2 access_name char (32), 76 2 modes bit (36), 77 2 statuscode fixed bin (35); 78 79 dcl 1 segment_acl (100) aligned, 80 2 access_name char (32), 81 2 modes bit (36), 82 2 mbz bit (36), 83 2 statuscode fixed bin (35); 84 85 dcl com_err_ entry options (variable), 86 cu_$arg_ptr entry (fixed bin, ptr, fixed bin(21), fixed bin(35)), 87 cu_$level_get entry (fixed bin), 88 date_time_ entry (fixed bin (71), char (*)), 89 expand_pathname_ entry (char(*), char(*), char(*), fixed bin(35)), 90 expand_pathname_$add_suffix entry (char(*), char(*), char(*), char(*), fixed bin(35)), 91 get_group_id_$tag_star entry() returns(char(32)), 92 hcs_$append_link entry (char(*), char(*), char(*), fixed bin(35)), 93 hcs_$chname_file entry (char(*), char(*), char(*), char(*), fixed bin(35)), 94 hcs_$create_branch_ entry (char(*), char(*), ptr, fixed bin(35)), 95 hcs_$initiate_count entry (char(*), char(*), char(*), fixed bin(24), fixed bin(2), ptr, fixed bin(35)), 96 hcs_$quota_move entry (char(*), char(*), fixed bin(18), fixed bin(35)), 97 hcs_$replace_acl entry (char(*), char(*), ptr, fixed bin, bit(1), fixed bin(35)), 98 hcs_$replace_dir_acl entry (char(*), char(*), ptr, fixed bin, bit(1), fixed bin(35)), 99 hcs_$replace_dir_inacl entry (char(*), char(*), ptr, fixed bin, bit(1) aligned, fixed bin(3), 100 fixed bin(35)), 101 hcs_$replace_inacl entry (char(*), char(*), ptr, fixed bin, bit(1), fixed bin(3), fixed bin(35)), 102 hcs_$set_max_length entry (char(*), char(*), fixed bin(19), fixed bin(35)), 103 hcs_$set_safety_sw entry (char(*), char(*), bit(1), fixed bin(35)), 104 hcs_$status_long entry (char(*), char(*), fixed bin(1), ptr, ptr, fixed bin(35)), 105 hcs_$terminate_noname entry (ptr, fixed bin(35)), 106 hphcs_$quota_set entry (char(*), fixed bin (18), fixed bin (35)), 107 hphcs_$set_sons_lvid entry (char (*), char (*), bit (36), fixed bin (35)), 108 ioa_ entry options (variable), 109 list_dir_info_ entry (ptr, fixed bin, char(1)), 110 pathname_ entry (char(*), char(*)) returns(char(168)); 111 112 dcl (error_table_$action_not_performed, 113 error_table_$bad_arg, 114 error_table_$badopt, 115 error_table_$improper_data_format, 116 error_table_$moderr, 117 error_table_$noentry, 118 error_table_$root, 119 error_table_$segnamedup) fixed bin(35) ext static; 120 dcl sys_info$default_max_length fixed bin (19) ext static; 121 1 1 /* BEGIN INCLUDE FILE ... saved_dir_info.incl.pl1 */ 1 2 /* Modified 07/10/82 by Jim Lippard to only have 2 dir ring brackets */ 1 3 1 4 dcl 1 fseg based (fptr) aligned, 1 5 2 fpath char (168) unal, 1 6 2 timeof fixed bin (71), 1 7 2 nents fixed bin, 1 8 2 freep fixed bin, 1 9 2 fpad (4) fixed bin, 1 10 2 ffirst fixed bin; 1 11 1 12 dcl fptr ptr; 1 13 1 14 dcl 1 seg_rec based (xp) aligned, 1 15 2 fnext bit (18), 1 16 2 n_names fixed bin, 1 17 2 brstat, 1 18 3 type bit (2) unal, 1 19 3 nnames bit (16) unal, 1 20 3 nrp bit (18) unal, 1 21 3 dtm bit (36) unal, 1 22 3 dtu bit (36) unal, 1 23 3 mode bit (5) unal, 1 24 3 padding bit (13) unal, 1 25 3 records bit (18) unal, 1 26 3 dtd bit (36) unal, 1 27 3 dtem bit (36) unal, 1 28 3 lvid bit (36) unal, 1 29 3 curlen bit (12) unal, 1 30 3 bitcnt bit (24) unal, 1 31 3 pad1 bit (8) unal, 1 32 3 copysw bit (1) unal, 1 33 3 tpd bit (1) unal, 1 34 3 mdir bit (1) unal, 1 35 3 damaged bit (1) unal, 1 36 3 pad2 bit (6) unal, 1 37 3 rbs (0:2) bit (6) unal, 1 38 3 uid bit (36) unal, 1 39 2 bc_author char (32) unal, 1 40 2 author char (32) unal, 1 41 2 max_lth fixed bin (19), 1 42 2 ssw bit (1) unal, 1 43 2 pad0 bit(35) unal, 1 44 2 nacls fixed bin, 1 45 2 acls (dummy refer (seg_rec.nacls)), 1 46 3 access_name char (32), 1 47 3 modes bit (36), 1 48 2 names (dummy refer (seg_rec.n_names)), 1 49 3 name char (32), 1 50 2 end_seg_rec fixed bin; 1 51 1 52 dcl 1 dir_rec based (xp) aligned, 1 53 2 fnext bit (18), 1 54 2 n_names fixed bin, 1 55 2 brstat, 1 56 3 type bit (2) unal, 1 57 3 nnames bit (16) unal, 1 58 3 nrp bit (18) unal, 1 59 3 dtm bit (36) unal, 1 60 3 dtu bit (36) unal, 1 61 3 mode bit (5) unal, 1 62 3 padding bit (13) unal, 1 63 3 records bit (18) unal, 1 64 3 dtd bit (36) unal, 1 65 3 dtem bit (36) unal, 1 66 3 slvid bit (36) unal, 1 67 3 curlen bit (12) unal, 1 68 3 bitcnt bit (24) unal, 1 69 3 pad1 bit (8) unal, 1 70 3 copysw bit (1) unal, 1 71 3 tpd bit (1) unal, 1 72 3 mdir bit (1) unal, /* TRUE if mater dir */ 1 73 3 damaged bit (1) unal, 1 74 3 pad2 bit (6) unal, 1 75 3 rbs (0:1) bit (6) unal, 1 76 3 pad3 bit (6) unal, 1 77 3 uid bit (36) unal, 1 78 2 bc_author char (32) unal, 1 79 2 author char (32) unal, 1 80 2 max_lth fixed bin (19), 1 81 2 ssw bit (1) unal, 1 82 2 pad0 bit(35) unal, 1 83 2 quota fixed bin (18), 1 84 2 nacls fixed bin, 1 85 2 acls (dummy refer (dir_rec.nacls)), 1 86 3 access_name char (32), 1 87 3 modes bit (36), 1 88 2 nisacls fixed bin, 1 89 2 isacls (dummy refer (dir_rec.nisacls)), 1 90 3 access_name char (32), 1 91 3 modes bit (36), 1 92 2 nidacls fixed bin, 1 93 2 idacls (dummy refer (dir_rec.nidacls)), 1 94 3 access_name char (32), 1 95 3 modes bit (36), 1 96 2 ncacls fixed bin, 1 97 2 cacls (dummy refer (dir_rec.ncacls)), 1 98 3 access_name char (32), 1 99 3 modes bit (36), 1 100 2 names (dummy refer (dir_rec.n_names)), 1 101 3 name char (32), 1 102 2 end_dir_rec fixed bin; 1 103 1 104 dcl 1 link_rec based (xp) aligned, 1 105 2 fnext bit (18), 1 106 2 n_names fixed bin, 1 107 2 brstat, 1 108 3 type bit (2) unal, 1 109 3 nnames bit (16) unal, 1 110 3 nrp bit (18) unal, 1 111 3 dtem bit (36) unal, 1 112 3 dtd bit (36) unal, 1 113 3 pnl bit (18) unal, 1 114 3 pnrp bit (18) unal, 1 115 2 target char (168), 1 116 2 names (dummy refer (link_rec.n_names)), 1 117 3 name char (32), 1 118 2 end_link_rec fixed bin; 1 119 1 120 dcl 1 aclval (nacl) based (tp) aligned, 1 121 2 access_name char (32), 1 122 2 modes bit (36); 1 123 1 124 dcl tp ptr; 1 125 1 126 /* END INCLUDE FILE ... saved_dir_info.incl.pl1 */ 122 123 2 1 /* BEGIN INCLUDE FILE - - - create_branch_info.incl.pl1 - - - created January 1975 */ 2 2 2 3 2 4 /****^ HISTORY COMMENTS: 2 5* 1) change(89-01-16,TLNguyen), approve(89-01-16,MCR8049), 2 6* audit(89-02-03,Parisek), install(89-03-15,MR12.3-1025): 2 7* 1. Declare version constant properly. 2 8* 2. Remove version 1 since it was never referenced and to force 2 9* callers to upgrade their programs. 2 10* END HISTORY COMMENTS */ 2 11 2 12 2 13 /* Modified December 1984 for dir_quota, Keith Loepere. */ 2 14 2 15 /* this include files gives the argument structure for create_branch_ */ 2 16 2 17 dcl 1 create_branch_info aligned based, 2 18 2 version fixed bin, /* set this to the largest value given below */ 2 19 2 switches unaligned, 2 20 3 dir_sw bit (1) unaligned, /* if on, a directory branch is wanted */ 2 21 3 copy_sw bit (1) unaligned, /* if on, initiating segment will be done by copying */ 2 22 3 chase_sw bit (1) unaligned, /* if on, if pathname is a link, it will be chased */ 2 23 3 priv_upgrade_sw bit (1) unaligned, /* privileged creation (ring 1) of upgraded object */ 2 24 3 parent_ac_sw bit (1) unaligned, /* if on, use parent's access class for seg or dir created */ 2 25 3 mbz1 bit (31) unaligned, /* pad to full word */ 2 26 2 mode bit (3) unaligned, /* segment or directory for acl for userid */ 2 27 2 mbz2 bit (33) unaligned, /* pad to full word */ 2 28 2 rings (3) fixed bin (3), /* branch's ring brackets */ 2 29 2 userid char (32), /* user's access control name */ 2 30 2 bitcnt fixed bin (24), /* bit count of the segment */ 2 31 2 quota fixed bin (18), /* for directories, this am't of quota will be moved to it */ 2 32 2 access_class bit (72), /* is the access class of the body of the branch */ 2 33 2 dir_quota fixed bin (18); /* for directories, this am't of dir quota will be moved to it */ 2 34 2 35 dcl create_branch_version_2 fixed bin int static options (constant) init (2); 2 36 2 37 /* END INCLUDE FILE - - - create_branch_info.incl.pl1 - - - */ 2 38 124 125 dcl 1 cbi like create_branch_info aligned; 126 127 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 128 129 130 call cu_$arg_ptr (1, ap, al, ec); 131 if ec ^= 0 then do; 132 call com_err_ (ec, "rebuild_dir", " 133 Usage: rebuild_dir dir_info_path {-control_args} 134 Args: -brief, -bf 135 -long, -lg 136 -priv"); 137 return; 138 end; 139 call expand_pathname_$add_suffix (bchr, "dir_info", fdir, fent, ec); 140 if ec ^= 0 then do; 141 call com_err_ (ec, "rebuild_dir", "^a", bchr); 142 return; 143 end; 144 145 call cu_$level_get (rings (1)); 146 rings (2), rings (3) = rings (1); 147 my_userid = get_group_id_$tag_star (); 148 loud = "1"b; 149 privmode = "0"b; 150 ec = 0; 151 do an = 2 by 1 while (ec = 0); 152 call cu_$arg_ptr (an, ap, al, ec); 153 if ec = 0 then do; 154 if bchr = "-brief" | bchr = "-bf" then do; 155 verbosity = 0; 156 loud = "0"b; 157 end; 158 else if bchr = "-long" | bchr = "-lg" then do; 159 verbosity = 2; 160 loud = "1"b; 161 end; 162 else if bchr = "-priv" then privmode = "1"b; 163 else do; 164 if index(bchr,"-") = 1 then 165 ec = error_table_$badopt; 166 else 167 ec = error_table_$bad_arg; 168 call com_err_ (ec, "rebuild_dir", "^a", bchr); 169 return; 170 end; 171 end; 172 end; 173 174 fptr = null; 175 on cleanup call janitor(); 176 177 call hcs_$initiate_count (fdir, fent, "", bitc, 0, fptr, ec); 178 if fptr = null then do; 179 call com_err_ (ec, "rebuild_dir", "Accessing dir_info segment 180 (^a^[>^]^a).", fdir, fdir^=">", fent); 181 return; 182 end; 183 184 if fseg.fpath = ">" then do; 185 call com_err_ (error_table_$root, "rebuild_dir", "> 186 The root directory cannot be rebuilt."); 187 go to EXIT; 188 end; 189 190 call date_time_ (fseg.timeof, datstr); 191 call ioa_ (" 192 Rebuilding: ^a 193 from snapshot taken: ^a", fseg.fpath, datstr); 194 195 xp = addr (fseg.ffirst); 196 if dir_rec.type ^= "10"b then do; /* make sure dir is first */ 197 call com_err_ (error_table_$improper_data_format, "rebuild_dir", 198 "Type of first entry is not directory in saved dir_info segment 199 (^a^[>^]^a).", fdir, fdir^=">", fent); 200 go to EXIT; 201 end; 202 call expand_pathname_ (fseg.fpath, dn, en, ec); 203 if ec ^= 0 then do; 204 call com_err_ (ec, "rebuild_dir", "^a 205 Error in pathname of containing directory saved in dir_info segment 206 (^a^[>^]^a).", fseg.fpath, fdir, fdir^=">", fent); 207 go to EXIT; 208 end; 209 go to CASE(2); 210 211 NXTFILE: j = binary (seg_rec.brstat.type); /* Get record type */ 212 if 0 <= j & j <= 2 then; 213 else do; 214 call com_err_ (error_table_$improper_data_format, "rebuild_dir", 215 "Error at ^p in saved dir info segment 216 (^a^[>^]^a).", xp, fdir, fdir^=">", fent); 217 go to EXIT; 218 end; 219 go to CASE(j); 220 221 CASE(1): en = seg_rec.names (1).name; /* SEGMENT */ 222 call hcs_$status_long (dn, en, 0, addr (brsbuf), null, ec); 223 if ec = 0 then 224 if brsbuf.type = "01"b then do; 225 call hcs_$set_safety_sw (dn, en, seg_rec.ssw, ec); 226 if seg_rec.nacls > 0 then do; 227 do i = 1 to seg_rec.nacls; 228 segment_acl (i).access_name = seg_rec.acls (i).access_name; 229 segment_acl (i).modes = seg_rec.acls (i).modes; 230 segment_acl (i).mbz = "0"b; 231 end; 232 call hcs_$replace_acl (dn, en, addr (segment_acl), seg_rec.nacls, "0"b, ec); 233 if ec ^= 0 then 234 call com_err_ (ec, "rebuild_dir", "Cannot replace acl on ^a", en); 235 end; 236 do i = 2 to binary (seg_rec.brstat.nnames); 237 call hcs_$chname_file (dn, en, "", (seg_rec.names (i).name), ec); 238 if ec ^= 0 then 239 if ec ^= error_table_$segnamedup then 240 call com_err_ (ec, "rebuild_dir", 241 "Cannot add name ^a to seg ^a", 242 seg_rec.names (i).name, en); 243 end; 244 if seg_rec.max_lth ^= sys_info$default_max_length 245 then call hcs_$set_max_length (dn, en, seg_rec.max_lth, ec); 246 end; 247 else 248 call com_err_ (error_table_$action_not_performed, 249 "rebuild_dir", 250 "Type mismatch: entry ^a was a segment, now a ^[link^;^;directory^;BAD-TYPE^].", 251 en, binary(brsbuf.type,2,0)+1b); 252 else do; 253 call com_err_ (ec, "rebuild_dir", "missing seg ^a", en); 254 if loud then call list_dir_info_ (xp, verbosity, " "); 255 end; 256 go to SKIP; 257 258 CASE(2): en = dir_rec.names (1).name; /* DIRECTORY */ 259 call hcs_$status_long (dn, en, 0, addr (brsbuf), null, ec); 260 if ec = error_table_$noentry then do; 261 if loud then call ioa_ ("Adding directory ^a", en); 262 unspec (cbi) = "0"b; 263 cbi.version = create_branch_version_2; 264 cbi.switches.dir_sw = "1"b; 265 cbi.parent_ac_sw = "1"b; /* For Now */ 266 cbi.mode = "111"b; 267 cbi.userid = my_userid; 268 cbi.bitcnt = fixed (dir_rec.bitcnt, 24); 269 cbi.rings (1) = rings (1); 270 cbi.rings (2) = rings (2); 271 cbi.rings (3) = rings (3); 272 cbi.quota = 0; /* Set below */ 273 cbi.dir_quota = 0; 274 call hcs_$create_branch_ (dn, en, addr (cbi), ec); 275 if ec ^= 0 then do; 276 call com_err_ (ec, "rebuild_dir", "Cannot add directory ^a", en); 277 if dn ^= fseg.fpath then go to EXIT; 278 go to SKIP; 279 end; 280 end; 281 else if ec ^= 0 then do; 282 call com_err_ (ec, "rebuild_dir", "Cannot get status for ^a>^a", dn, en); 283 go to SKIP; 284 end; 285 else if brsbuf.type ^= "10"b then do; 286 call com_err_ (error_table_$action_not_performed, 287 "rebuild_dir", 288 "Type mismatch: entry ^a was a directory, now a ^[link^;segment^;^;BAD-TYPE^].", 289 en, binary(brsbuf.type,2,0)+1b); 290 go to SKIP; 291 end; 292 call hcs_$set_safety_sw (dn, en, dir_rec.ssw, ec); 293 do i = 2 to binary (dir_rec.brstat.nnames); 294 call hcs_$chname_file (dn, en, "", (dir_rec.names (i).name), ec); 295 if ec ^= 0 then 296 if ec ^= error_table_$segnamedup then 297 call com_err_ (ec, "rebuild_dir", 298 "Cannot add name ^a to dir ^a", dir_rec.names (i).name, en); 299 end; 300 if dir_rec.slvid ^= "0"b then do; 301 if privmode then do; 302 on linkage_error begin; 303 privmode = "0"b; 304 call com_err_ (error_table_$moderr, "rebuild_dir", 305 "Cannot set sons logical volume id on ^a. 306 This requires access to the hphcs_ gate.", en); 307 go to SKIP_SONS_LVID; 308 end; 309 call hphcs_$set_sons_lvid (dn, en, dir_rec.slvid, ec); 310 SKIP_SONS_LVID: 311 revert linkage_error; 312 end; 313 end; 314 ec = 0; 315 if dir_rec.quota ^= 0 then do; 316 if privmode then do; 317 dnen = pathname_ (dn, en); 318 on linkage_error begin; 319 privmode = "0"b; 320 call com_err_ (error_table_$moderr, "rebuild_dir", 321 "Cannot set quota on ^a. This requires access to the hphcs_ gate.", en); 322 go to SKIP_SET_QUOTA; 323 end; 324 call hphcs_$quota_set (dnen, dir_rec.quota, ec); 325 SKIP_SET_QUOTA: revert linkage_error; 326 end; 327 else call hcs_$quota_move (dn, en, dir_rec.quota, ec); 328 if ec ^= 0 then call com_err_ (ec, "rebuild_dir", "Unable to set quota ^d on ^a", dir_rec.quota, en); 329 end; 330 331 if dir_rec.nacls > 0 then do; /* Problem here: might remove own access on first item */ 332 do i = 1 to dir_rec.nacls; 333 dir_acl (i).access_name = dir_rec.acls (i).access_name; 334 dir_acl (i).modes = dir_rec.acls (i).modes; 335 end; 336 call hcs_$replace_dir_acl (dn, en, addr (dir_acl), dir_rec.nacls, "0"b, ec); 337 if ec ^= 0 then call com_err_ (ec, "rebuild_dir", "Cannot replace acl on ^a", en); 338 end; 339 if dir_rec.nisacls > 0 then do; 340 do i = 1 to dir_rec.nisacls; 341 segment_acl (i).access_name = dir_rec.isacls (i).access_name; 342 segment_acl (i).modes = dir_rec.isacls (i).modes; 343 segment_acl (i).mbz = "0"b; 344 end; 345 call hcs_$replace_inacl (dn, en, addr (segment_acl), dir_rec.nisacls, "0"b, 4, ec); 346 if ec ^= 0 then call com_err_ (ec, "rebuild_dir", "Cannot replace seg iacl on ^a", en); 347 end; 348 if dir_rec.nidacls > 0 then do; 349 do i = 1 to dir_rec.nidacls; 350 dir_acl (i).access_name = dir_rec.idacls (i).access_name; 351 dir_acl (i).modes = dir_rec.idacls (i).modes; 352 end; 353 call hcs_$replace_dir_inacl (dn, en, addr (dir_acl), dir_rec.nidacls, "0"b, 4, ec); 354 if ec ^= 0 then call com_err_ (ec, "rebuild_dir", "Cannot replace dir inacl on ^a", en); 355 end; 356 go to SKIP; 357 358 359 CASE(0): en = link_rec.names (1).name; /* LINK */ 360 call hcs_$status_long (dn, en, 0, addr (brsbuf), null, ec); 361 if ec = 0 then if brsbuf.type = "00"b then go to LINK_MERGE; 362 if loud then call ioa_ ("Adding link ^a", en); 363 call hcs_$append_link (dn, en, (link_rec.target), ec); 364 if ec ^= 0 then do; 365 call com_err_ (ec, "rebuild_dir", "Cannot append link ^a", en); 366 go to SKIP; 367 end; 368 LINK_MERGE: 369 do i = 2 to binary (link_rec.brstat.nnames); 370 call hcs_$chname_file (dn, en, "", (link_rec.names (i).name), ec); 371 if ec ^= 0 then 372 if ec ^= error_table_$segnamedup then 373 call com_err_ (ec, "rebuild_dir", 374 "Cannot add name ^a to link ^a", 375 link_rec.names (i).name, en); 376 end; 377 go to SKIP; 378 379 SKIP: dn = fseg.fpath; 380 if seg_rec.fnext then do; 381 xp = ptr (xp, seg_rec.fnext); 382 go to NXTFILE; 383 end; 384 385 call ioa_ ("Rebuilding complete: ^a", fseg.fpath); 386 EXIT: call janitor(); 387 return; 388 389 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 390 391 392 janitor: proc; 393 394 if fptr ^= null then 395 call hcs_$terminate_noname (fptr, ec); 396 397 end janitor; 398 399 end rebuild_dir; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 03/15/89 0800.8 rebuild_dir.pl1 >special_ldd>install>MR12.3-1025>rebuild_dir.pl1 122 1 11/19/82 1625.1 saved_dir_info.incl.pl1 >ldd>include>saved_dir_info.incl.pl1 124 2 03/15/89 0759.4 create_branch_info.incl.pl1 >special_ldd>install>MR12.3-1025>create_branch_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. access_name 40 based char(32) array level 3 in structure "dir_rec" dcl 1-52 in procedure "rebuild_dir" ref 333 access_name 000404 automatic char(32) array level 2 in structure "dir_acl" dcl 74 in procedure "rebuild_dir" set ref 333* 350* access_name based char(32) array level 3 in structure "dir_rec" dcl 1-52 in procedure "rebuild_dir" ref 341 access_name 001370 automatic char(32) array level 2 in structure "segment_acl" dcl 79 in procedure "rebuild_dir" set ref 228* 341* access_name based char(32) array level 3 in structure "dir_rec" dcl 1-52 in procedure "rebuild_dir" ref 350 access_name 37 based char(32) array level 3 in structure "seg_rec" dcl 1-14 in procedure "rebuild_dir" ref 228 acls 40 based structure array level 2 in structure "dir_rec" dcl 1-52 in procedure "rebuild_dir" acls 37 based structure array level 2 in structure "seg_rec" dcl 1-14 in procedure "rebuild_dir" addr builtin function dcl 49 ref 195 222 222 232 232 259 259 274 274 336 336 345 345 353 353 360 360 al 000102 automatic fixed bin(21,0) dcl 29 set ref 130* 139 139 141 141 152* 154 154 158 158 162 164 168 168 an 000103 automatic fixed bin(17,0) dcl 29 set ref 151* 152* ap 000100 automatic pointer dcl 29 set ref 130* 139 141 152* 154 154 158 158 162 164 168 bchr based char packed unaligned dcl 29 set ref 139* 141* 154 154 158 158 162 164 168* binary builtin function dcl 49 ref 211 236 247 286 293 368 bitc 000104 automatic fixed bin(24,0) dcl 29 set ref 177* bitcnt 16 003506 automatic fixed bin(24,0) level 2 in structure "cbi" dcl 125 in procedure "rebuild_dir" set ref 268* bitcnt 11(12) based bit(24) level 3 in structure "dir_rec" packed packed unaligned dcl 1-52 in procedure "rebuild_dir" ref 268 brsbuf 000372 automatic structure level 1 dcl 53 set ref 222 222 259 259 360 360 brstat 2 based structure level 2 in structure "seg_rec" dcl 1-14 in procedure "rebuild_dir" brstat 2 based structure level 2 in structure "dir_rec" dcl 1-52 in procedure "rebuild_dir" brstat 2 based structure level 2 in structure "link_rec" dcl 1-104 in procedure "rebuild_dir" cbi 003506 automatic structure level 1 dcl 125 set ref 262* 274 274 cleanup 000356 stack reference condition dcl 51 ref 175 com_err_ 000010 constant entry external dcl 85 ref 132 141 168 179 185 197 204 214 233 238 247 253 276 282 286 295 304 320 328 337 346 354 365 371 create_branch_info based structure level 1 dcl 2-17 create_branch_version_2 constant fixed bin(17,0) initial dcl 2-35 ref 263 cu_$arg_ptr 000012 constant entry external dcl 85 ref 130 152 cu_$level_get 000014 constant entry external dcl 85 ref 145 date_time_ 000016 constant entry external dcl 85 ref 190 datstr 000105 automatic char(24) packed unaligned dcl 29 set ref 190* 191* dir_acl 000404 automatic structure array level 1 dcl 74 set ref 336 336 353 353 dir_quota 22 003506 automatic fixed bin(18,0) level 2 dcl 125 set ref 273* dir_rec based structure level 1 dcl 1-52 dir_sw 1 003506 automatic bit(1) level 3 packed packed unaligned dcl 125 set ref 264* dn 000113 automatic char(168) packed unaligned dcl 29 set ref 202* 222* 225* 232* 237* 244* 259* 274* 277 282* 292* 294* 309* 317* 327* 336* 345* 353* 360* 363* 370* 379* dnen 000165 automatic char(168) packed unaligned dcl 29 set ref 317* 324* ec 000237 automatic fixed bin(35,0) dcl 29 set ref 130* 131 132* 139* 140 141* 150* 151 152* 153 164* 166* 168* 177* 179* 202* 203 204* 222* 223 225* 232* 233 233* 237* 238 238 238* 244* 253* 259* 260 274* 275 276* 281 282* 292* 294* 295 295 295* 309* 314* 324* 327* 328 328* 336* 337 337* 345* 346 346* 353* 354 354* 360* 361 363* 364 365* 370* 371 371 371* 394* en 000240 automatic char(32) packed unaligned dcl 29 set ref 202* 221* 222* 225* 232* 233* 237* 238* 244* 247* 253* 258* 259* 261* 274* 276* 282* 286* 292* 294* 295* 304* 309* 317* 320* 327* 328* 336* 337* 345* 346* 353* 354* 359* 360* 362* 363* 365* 370* 371* error_table_$action_not_performed 000072 external static fixed bin(35,0) dcl 112 set ref 247* 286* error_table_$bad_arg 000074 external static fixed bin(35,0) dcl 112 ref 166 error_table_$badopt 000076 external static fixed bin(35,0) dcl 112 ref 164 error_table_$improper_data_format 000100 external static fixed bin(35,0) dcl 112 set ref 197* 214* error_table_$moderr 000102 external static fixed bin(35,0) dcl 112 set ref 304* 320* error_table_$noentry 000104 external static fixed bin(35,0) dcl 112 ref 260 error_table_$root 000106 external static fixed bin(35,0) dcl 112 set ref 185* error_table_$segnamedup 000110 external static fixed bin(35,0) dcl 112 ref 238 295 371 expand_pathname_ 000020 constant entry external dcl 85 ref 202 expand_pathname_$add_suffix 000022 constant entry external dcl 85 ref 139 fdir 000250 automatic char(168) packed unaligned dcl 29 set ref 139* 177* 179* 179 197* 197 204* 204 214* 214 fent 000322 automatic char(32) packed unaligned dcl 29 set ref 139* 177* 179* 197* 204* 214* ffirst 62 based fixed bin(17,0) level 2 dcl 1-4 set ref 195 fixed builtin function dcl 49 ref 268 fnext based bit(18) level 2 dcl 1-14 ref 380 381 fpath based char(168) level 2 packed packed unaligned dcl 1-4 set ref 184 191* 202* 204* 277 379 385* fptr 003504 automatic pointer dcl 1-12 set ref 174* 177* 178 184 190 191 195 202 204 277 379 385 394 394* fseg based structure level 1 dcl 1-4 get_group_id_$tag_star 000024 constant entry external dcl 85 ref 147 hcs_$append_link 000026 constant entry external dcl 85 ref 363 hcs_$chname_file 000030 constant entry external dcl 85 ref 237 294 370 hcs_$create_branch_ 000032 constant entry external dcl 85 ref 274 hcs_$initiate_count 000034 constant entry external dcl 85 ref 177 hcs_$quota_move 000036 constant entry external dcl 85 ref 327 hcs_$replace_acl 000040 constant entry external dcl 85 ref 232 hcs_$replace_dir_acl 000042 constant entry external dcl 85 ref 336 hcs_$replace_dir_inacl 000044 constant entry external dcl 85 ref 353 hcs_$replace_inacl 000046 constant entry external dcl 85 ref 345 hcs_$set_max_length 000050 constant entry external dcl 85 ref 244 hcs_$set_safety_sw 000052 constant entry external dcl 85 ref 225 292 hcs_$status_long 000054 constant entry external dcl 85 ref 222 259 360 hcs_$terminate_noname 000056 constant entry external dcl 85 ref 394 hphcs_$quota_set 000060 constant entry external dcl 85 ref 324 hphcs_$set_sons_lvid 000062 constant entry external dcl 85 ref 309 i 000332 automatic fixed bin(17,0) dcl 29 set ref 227* 228 228 229 229 230* 236* 237 238* 293* 294 295* 332* 333 333 334 334* 340* 341 341 342 342 343* 349* 350 350 351 351* 368* 370 371* idacls based structure array level 2 dcl 1-52 index builtin function dcl 49 ref 164 ioa_ 000064 constant entry external dcl 85 ref 191 261 362 385 isacls based structure array level 2 dcl 1-52 j 000333 automatic fixed bin(17,0) dcl 29 set ref 211* 212 212 219 link_rec based structure level 1 dcl 1-104 linkage_error 000364 stack reference condition dcl 51 ref 302 310 318 325 list_dir_info_ 000066 constant entry external dcl 85 ref 254 loud 000334 automatic bit(1) packed unaligned dcl 29 set ref 148* 156* 160* 254 261 362 max_lth 34 based fixed bin(19,0) level 2 dcl 1-14 set ref 244 244* mbz 11 001370 automatic bit(36) array level 2 dcl 79 set ref 230* 343* mode 2 003506 automatic bit(3) level 2 packed packed unaligned dcl 125 set ref 266* modes 10 001370 automatic bit(36) array level 2 in structure "segment_acl" dcl 79 in procedure "rebuild_dir" set ref 229* 342* modes based bit(36) array level 3 in structure "dir_rec" dcl 1-52 in procedure "rebuild_dir" ref 342 modes based bit(36) array level 3 in structure "dir_rec" dcl 1-52 in procedure "rebuild_dir" ref 351 modes 10 000404 automatic bit(36) array level 2 in structure "dir_acl" dcl 74 in procedure "rebuild_dir" set ref 334* 351* modes 47 based bit(36) array level 3 in structure "seg_rec" dcl 1-14 in procedure "rebuild_dir" ref 229 modes 50 based bit(36) array level 3 in structure "dir_rec" dcl 1-52 in procedure "rebuild_dir" ref 334 my_userid 000335 automatic char(32) packed unaligned dcl 29 set ref 147* 267 nacls 36 based fixed bin(17,0) level 2 in structure "seg_rec" dcl 1-14 in procedure "rebuild_dir" set ref 221 226 227 232* 237 238 nacls 37 based fixed bin(17,0) level 2 in structure "dir_rec" dcl 1-52 in procedure "rebuild_dir" set ref 258 258 258 258 258 258 258 258 294 294 294 294 294 294 294 294 295 295 295 295 295 295 295 295 331 332 336* 339 340 341 342 345 348 348 349 349 350 350 351 351 353 353 name based char(32) array level 3 in structure "seg_rec" dcl 1-14 in procedure "rebuild_dir" set ref 221 237 238* name 60 based char(32) array level 3 in structure "link_rec" dcl 1-104 in procedure "rebuild_dir" set ref 359 370 371* name based char(32) array level 3 in structure "dir_rec" dcl 1-52 in procedure "rebuild_dir" set ref 258 294 295* names based structure array level 2 in structure "dir_rec" dcl 1-52 in procedure "rebuild_dir" names based structure array level 2 in structure "seg_rec" dcl 1-14 in procedure "rebuild_dir" names 60 based structure array level 2 in structure "link_rec" dcl 1-104 in procedure "rebuild_dir" ncacls based fixed bin(17,0) level 2 dcl 1-52 ref 258 294 295 nidacls based fixed bin(17,0) level 2 dcl 1-52 set ref 258 258 294 294 295 295 348 349 353* nisacls based fixed bin(17,0) level 2 dcl 1-52 set ref 258 258 258 258 294 294 294 294 295 295 295 295 339 340 345* 348 349 350 351 353 nnames 2(02) based bit(16) level 3 in structure "dir_rec" packed packed unaligned dcl 1-52 in procedure "rebuild_dir" ref 293 nnames 2(02) based bit(16) level 3 in structure "link_rec" packed packed unaligned dcl 1-104 in procedure "rebuild_dir" ref 368 nnames 2(02) based bit(16) level 3 in structure "seg_rec" packed packed unaligned dcl 1-14 in procedure "rebuild_dir" ref 236 null builtin function dcl 49 ref 174 178 222 222 259 259 360 360 394 parent_ac_sw 1(04) 003506 automatic bit(1) level 3 packed packed unaligned dcl 125 set ref 265* pathname_ 000070 constant entry external dcl 85 ref 317 privmode 000345 automatic bit(1) packed unaligned dcl 29 set ref 149* 162* 301 303* 316 319* ptr builtin function dcl 49 ref 381 quota 17 003506 automatic fixed bin(18,0) level 2 in structure "cbi" dcl 125 in procedure "rebuild_dir" set ref 272* quota 36 based fixed bin(18,0) level 2 in structure "dir_rec" dcl 1-52 in procedure "rebuild_dir" set ref 315 324* 327* 328* rings 000346 automatic fixed bin(17,0) array dcl 29 in procedure "rebuild_dir" set ref 145* 146 146* 146* 269 270 271 rings 3 003506 automatic fixed bin(3,0) array level 2 in structure "cbi" dcl 125 in procedure "rebuild_dir" set ref 269* 270* 271* seg_rec based structure level 1 dcl 1-14 segment_acl 001370 automatic structure array level 1 dcl 79 set ref 232 232 345 345 slvid 10 based bit(36) level 3 packed packed unaligned dcl 1-52 set ref 300 309* ssw 35 based bit(1) level 2 in structure "dir_rec" packed packed unaligned dcl 1-52 in procedure "rebuild_dir" set ref 292* ssw 35 based bit(1) level 2 in structure "seg_rec" packed packed unaligned dcl 1-14 in procedure "rebuild_dir" set ref 225* switches 1 003506 automatic structure level 2 packed packed unaligned dcl 125 sys_info$default_max_length 000112 external static fixed bin(19,0) dcl 120 ref 244 target 6 based char(168) level 2 dcl 1-104 ref 363 timeof 52 based fixed bin(71,0) level 2 dcl 1-4 set ref 190* type 000372 automatic bit(2) level 2 in structure "brsbuf" packed packed unaligned dcl 53 in procedure "rebuild_dir" set ref 223 247 285 286 361 type 2 based bit(2) level 3 in structure "seg_rec" packed packed unaligned dcl 1-14 in procedure "rebuild_dir" ref 211 type 2 based bit(2) level 3 in structure "dir_rec" packed packed unaligned dcl 1-52 in procedure "rebuild_dir" ref 196 unspec builtin function dcl 49 set ref 262* userid 6 003506 automatic char(32) level 2 dcl 125 set ref 267* verbosity 000354 automatic fixed bin(17,0) initial dcl 29 set ref 29* 155* 159* 254* version 003506 automatic fixed bin(17,0) level 2 dcl 125 set ref 263* xp 000352 automatic pointer dcl 29 set ref 195* 196 211 214* 221 225 226 227 228 229 232 236 237 238 244 244 254* 258 268 292 293 294 295 300 309 315 324 327 328 331 332 333 334 336 339 340 341 342 345 348 349 350 351 353 359 363 368 370 371 380 381* 381 381 NAMES DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. aclval based structure array level 1 dcl 1-120 tp automatic pointer dcl 1-124 NAMES DECLARED BY EXPLICIT CONTEXT. CASE 000000 constant label array(0:2) dcl 221 ref 209 219 EXIT 004641 constant label dcl 386 ref 187 200 207 217 277 LINK_MERGE 004455 constant label dcl 368 ref 361 NXTFILE 001527 constant label dcl 211 ref 382 SKIP 004604 constant label dcl 379 ref 256 278 283 290 356 366 377 SKIP_SET_QUOTA 003457 constant label dcl 325 ref 322 SKIP_SONS_LVID 003332 constant label dcl 310 ref 307 janitor 004647 constant entry internal dcl 392 ref 175 386 rebuild_dir 000526 constant entry external dcl 11 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 5324 5440 4673 5334 Length 5762 4673 114 305 430 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME rebuild_dir 2022 external procedure is an external procedure. on unit on line 175 64 on unit on unit on line 302 108 on unit on unit on line 318 102 on unit janitor 70 internal procedure is called by several nonquick procedures. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME rebuild_dir 000100 ap rebuild_dir 000102 al rebuild_dir 000103 an rebuild_dir 000104 bitc rebuild_dir 000105 datstr rebuild_dir 000113 dn rebuild_dir 000165 dnen rebuild_dir 000237 ec rebuild_dir 000240 en rebuild_dir 000250 fdir rebuild_dir 000322 fent rebuild_dir 000332 i rebuild_dir 000333 j rebuild_dir 000334 loud rebuild_dir 000335 my_userid rebuild_dir 000345 privmode rebuild_dir 000346 rings rebuild_dir 000352 xp rebuild_dir 000354 verbosity rebuild_dir 000372 brsbuf rebuild_dir 000404 dir_acl rebuild_dir 001370 segment_acl rebuild_dir 003504 fptr rebuild_dir 003506 cbi rebuild_dir THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. r_ne_as call_ext_out_desc call_ext_out call_int_this call_int_other return_mac tra_ext_1 enable_op ext_entry int_entry THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. com_err_ cu_$arg_ptr cu_$level_get date_time_ expand_pathname_ expand_pathname_$add_suffix get_group_id_$tag_star hcs_$append_link hcs_$chname_file hcs_$create_branch_ hcs_$initiate_count hcs_$quota_move hcs_$replace_acl hcs_$replace_dir_acl hcs_$replace_dir_inacl hcs_$replace_inacl hcs_$set_max_length hcs_$set_safety_sw hcs_$status_long hcs_$terminate_noname hphcs_$quota_set hphcs_$set_sons_lvid ioa_ list_dir_info_ pathname_ THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. error_table_$action_not_performed error_table_$bad_arg error_table_$badopt error_table_$improper_data_format error_table_$moderr error_table_$noentry error_table_$root error_table_$segnamedup sys_info$default_max_length LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 11 000525 29 000533 130 000535 131 000552 132 000554 137 000604 139 000605 140 000643 141 000645 142 000703 145 000704 146 000713 147 000716 148 000725 149 000727 150 000730 151 000731 152 000736 153 000753 154 000755 155 000767 156 000770 157 000771 158 000772 159 001002 160 001004 161 001006 162 001007 164 001016 166 001034 168 001037 169 001074 172 001075 174 001077 175 001101 177 001123 178 001165 179 001171 181 001242 184 001243 185 001250 187 001300 190 001301 191 001316 195 001342 196 001345 197 001351 200 001422 202 001423 203 001447 204 001451 207 001525 209 001526 211 001527 212 001533 214 001540 217 001615 219 001616 221 001617 222 001625 223 001666 225 001675 226 001723 227 001726 228 001735 229 001747 230 001752 231 001753 232 001755 233 002017 236 002060 237 002074 238 002141 243 002217 244 002221 246 002252 247 002253 253 002320 254 002357 256 002376 258 002377 259 002433 260 002474 261 002500 262 002521 263 002524 264 002526 265 002530 266 002532 267 002534 268 002537 269 002543 270 002545 271 002547 272 002551 273 002552 274 002553 275 002602 276 002604 277 002643 278 002650 280 002651 281 002652 282 002654 283 002713 285 002714 286 002721 290 002764 292 002765 293 003013 294 003026 295 003117 299 003221 300 003223 301 003226 302 003230 303 003244 304 003246 307 003301 309 003304 310 003332 314 003333 315 003334 316 003337 317 003341 318 003361 319 003375 320 003377 322 003432 324 003435 325 003457 326 003460 327 003461 328 003506 331 003551 332 003554 333 003563 334 003575 335 003600 336 003602 337 003644 339 003705 340 003713 341 003721 342 003741 343 003746 344 003747 345 003751 346 004024 348 004062 349 004077 350 004105 351 004134 352 004141 353 004143 354 004225 356 004263 359 004264 360 004267 361 004330 362 004335 363 004362 364 004413 365 004415 366 004454 368 004455 370 004470 371 004530 376 004601 377 004603 379 004604 380 004610 381 004612 382 004615 385 004616 386 004641 387 004645 392 004646 394 004654 397 004671 ----------------------------------------------------------- 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