COMPILATION LISTING OF SEGMENT create_homedir_ 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 0830.1 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 /* format: style4 */ 12 create_homedir_: proc (P_person, P_alias, P_minimum_auth, P_project, P_homedir, P_projdir, P_code); 13 14 /* This program is used to create home directories. 15* If the "P_person" argument is "anonymous" no directory will be created. 16* Some checks are made to ensure that a home directory will be below the project dir. 17* THVV */ 18 /* Modified May 1981, E. N. Kittlitz. Don't create through link. as_log creation notice 19* severity changed to 0. Miscellaneous changes */ 20 /* Modified September 1982, E. N. Kittlitz. Set dir rbs to 7,7. Fix anonymous. */ 21 /* Modified 1984-08-27 BIM. No more automatic project dir creations. 22* Handle upgraded users. */ 23 /* Modified 1984-12-27, Keith Loepere. Set dir_quota at append. */ 24 25 dcl P_alias char (*); 26 dcl P_code fixed bin (35); 27 dcl P_homedir char (*); 28 dcl P_person char (*); 29 dcl P_projdir char (*); 30 dcl P_project char (*); 31 dcl P_minimum_auth bit (72) aligned; 32 33 dcl bitcount fixed bin (24); 34 dcl code fixed bin (35); 35 dcl hd char (32); 36 dcl i fixed bin; 37 dcl ignore_code fixed bin (35); 38 dcl type fixed bin (2); 39 dcl uid char (32); 40 dcl (hdd, hdd_dir) char (168); 41 dcl hdd_entryname char (32); 42 dcl pd_acc bit (72) aligned; 43 dcl 1 cbi aligned like create_branch_info; 44 45 dcl error_table_$badpath fixed bin (35) external; 46 dcl error_table_$noentry fixed bin (35) external; 47 dcl error_table_$notadir fixed bin (35) external; 48 49 dcl aim_check_$greater entry (bit (72) aligned, bit (72) aligned) returns (bit (1) aligned); 50 dcl display_access_class_ entry (bit (72) aligned) returns(character (32) aligned); 51 dcl expand_pathname_ entry (char (*), char (*), char (*), fixed bin (35)); 52 dcl get_group_id_ entry () returns (char (32)); 53 dcl hcs_$add_dir_acl_entries entry (char (*), char (*), ptr, fixed bin, fixed bin (35)); 54 dcl hcs_$chname_file entry (char (*), char (*), char (*), char (*), fixed bin (35)); 55 dcl hcs_$get_access_class entry (char (*), char (*), bit (72) aligned, fixed bin (35)); 56 dcl hcs_$create_branch_ entry (char (*), char (*), ptr, fixed bin (35)); 57 dcl hcs_$status_minf entry (char (*), char (*), fixed bin (1), fixed bin (2), fixed bin (24), fixed bin (35)); 58 dcl ioa_$rsnnl entry options (variable); 59 dcl pathname_ entry (char (*), char (*)) returns (char (168)); 60 dcl sys_log_ entry options (variable); 61 dcl sys_log_$error_log entry options (variable); 62 63 64 dcl 1 acla (4) aligned, /* structure for setting ACL of new dir */ 65 2 userid char (32), 66 2 mode bit (36), 67 2 rcode fixed bin (35); 68 69 dcl (addr, substr, unspec) builtin; 70 71 /* -------------------------------------------------------- */ 72 73 P_code = 0; 74 code = 0; 75 76 call ioa_$rsnnl ("^a.^a.*", uid, i, P_person, P_project); 77 78 if substr (P_homedir, 1, 5) = "[pd]>" then return;/* act_proc will create home dir below process dir */ 79 call expand_pathname_ (P_homedir, hdd, hd, code); 80 if code ^= 0 then go to no_homedir; /* invalid pathname */ 81 call hcs_$status_minf (hdd, hd, 0, type, bitcount, code); /* see if there's an entry */ 82 if code = 0 then if type = 2 then return; 83 else do; /* Type not 2: non-directory branch found. */ 84 if type = 0 then do; /* it's a link, do some more looking */ 85 call hcs_$status_minf (hdd, hd, 1, type, bitcount, code); 86 if code = 0 & type = 2 then return;/* link is to directory, nothing more to do */ 87 end; 88 code = error_table_$notadir; /* Fuss fuss */ 89 go to no_homedir; 90 end; 91 if code ^= error_table_$noentry then go to no_homedir; 92 93 /* We have a regular user with an nonexistent home directory */ 94 95 if hdd ^= P_projdir then /* Only certain places we will create it */ 96 if hdd ^= pathname_ (">user_dir_dir", P_project) then do; /* try to fabricate with project name */ 97 if hdd ^= pathname_ (">udd", P_project) then do; /* ditto */ 98 code = error_table_$badpath; 99 go to no_homedir; 100 end; 101 end; 102 103 104 call hcs_$get_access_class (">udd", P_project, pd_acc, code); 105 if code ^= 0 then pd_acc = ""b; 106 107 unspec (cbi) = ""b; 108 cbi.version = create_branch_version_2; 109 cbi.dir_sw = "1"b; 110 cbi.chase_sw = "0"b; /* make it plain - no chasing! */ 111 cbi.parent_ac_sw = ^aim_check_$greater (P_minimum_auth, pd_acc); 112 cbi.access_class = P_minimum_auth; 113 cbi.mode = SMA_ACCESS; 114 cbi.userid = uid; 115 cbi.rings (*) = 7; /* no restrictions here */ 116 call hcs_$create_branch_ (hdd, hd, addr (cbi), code); 117 if code ^= 0 then go to no_homedir; /* Don't try to delete - might bite branch with same name */ 118 119 if P_alias ^= "" then call hcs_$chname_file (hdd, hd, "", P_alias, code); 120 121 call sys_log_ (0, "create_homedir_: creating ""^a"" for ""^a"" ^a", P_homedir, uid, display_access_class_ (P_minimum_auth)); 122 return; /* all OK, proceed */ 123 124 no_homedir: 125 126 if code = 0 then P_code = error_table_$noentry; 127 else P_code = code; 128 call sys_log_$error_log (0, P_code, "create_homedir_", """^a"" ""^a"" ^a", P_homedir, uid, display_access_class_ (P_minimum_auth)); 129 130 131 1 1 /* BEGIN INCLUDE FILE ... access_mode_values.incl.pl1 1 2* 1 3* Values for the "access mode" argument so often used in hardcore 1 4* James R. Davis 26 Jan 81 MCR 4844 1 5* Added constants for SM access 4/28/82 Jay Pattin 1 6* Added text strings 03/19/85 Chris Jones 1 7**/ 1 8 1 9 1 10 /* format: style4,delnl,insnl,indattr,ifthen,dclind10 */ 1 11 dcl ( 1 12 N_ACCESS init ("000"b), 1 13 R_ACCESS init ("100"b), 1 14 E_ACCESS init ("010"b), 1 15 W_ACCESS init ("001"b), 1 16 RE_ACCESS init ("110"b), 1 17 REW_ACCESS init ("111"b), 1 18 RW_ACCESS init ("101"b), 1 19 S_ACCESS init ("100"b), 1 20 M_ACCESS init ("010"b), 1 21 A_ACCESS init ("001"b), 1 22 SA_ACCESS init ("101"b), 1 23 SM_ACCESS init ("110"b), 1 24 SMA_ACCESS init ("111"b) 1 25 ) bit (3) internal static options (constant); 1 26 1 27 /* The following arrays are meant to be accessed by doing either 1) bin (bit_value) or 1 28* 2) divide (bin_value, 2) to come up with an index into the array. */ 1 29 1 30 dcl SEG_ACCESS_MODE_NAMES (0:7) init ("null", "W", "E", "EW", "R", "RW", "RE", "REW") char (4) internal 1 31 static options (constant); 1 32 1 33 dcl DIR_ACCESS_MODE_NAMES (0:7) init ("null", "A", "M", "MA", "S", "SA", "SM", "SMA") char (4) internal 1 34 static options (constant); 1 35 1 36 dcl ( 1 37 N_ACCESS_BIN init (00000b), 1 38 R_ACCESS_BIN init (01000b), 1 39 E_ACCESS_BIN init (00100b), 1 40 W_ACCESS_BIN init (00010b), 1 41 RW_ACCESS_BIN init (01010b), 1 42 RE_ACCESS_BIN init (01100b), 1 43 REW_ACCESS_BIN init (01110b), 1 44 S_ACCESS_BIN init (01000b), 1 45 M_ACCESS_BIN init (00010b), 1 46 A_ACCESS_BIN init (00001b), 1 47 SA_ACCESS_BIN init (01001b), 1 48 SM_ACCESS_BIN init (01010b), 1 49 SMA_ACCESS_BIN init (01011b) 1 50 ) fixed bin (5) internal static options (constant); 1 51 1 52 /* END INCLUDE FILE ... access_mode_values.incl.pl1 */ 132 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 133 134 135 136 /* BEGIN MESSAGE DOCUMENTATION 137* 138* Message: 139* create_homedir_: creating "DIRNAME" for "USERID" 140* 141* S: as (severity0). 142* 143* T: $run 144* 145* M: The user USERID did not have a home directory. It was 146* created for him during login, or when his project's PDT was installed. 147* This is reasonable if this is the first time he has logged in. 148* However, his directory may have been destroyed by the Salvager, in 149* which case you have to retrieve his files. 150* 151* A: A retrieval of the user's directory may be necessary. 152* 153* 154* Message: 155* create_homedir_: Bad syntax in pathname. DIRNAME NAME.PROJ 156* 157* S: as (severity0). 158* 159* T: $run 160* 161* M: Typically caused by a homedir specification starting with other than 162* >user_dir_dir or >udd. It may also occur while attempting to create the 163* home directory for the user with name NAME and project PROJ. 164* 165* A: $note_sa 166* 167* 168* Message: 169* create_homedir_: ERROR_MESSAGE. DIRNAME NAME.PROJ 170* 171* S: as (severity0). 172* 173* T: $run 174* 175* M: An error occurred while attempting to create the home 176* directory for the user with name NAME and project PROJ. 177* 178* A: $note_sa 179* 180* END MESSAGE DOCUMENTATION */ 181 182 end create_homedir_; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 03/15/89 0800.7 create_homedir_.pl1 >special_ldd>install>MR12.3-1025>create_homedir_.pl1 132 1 04/11/85 1452.6 access_mode_values.incl.pl1 >ldd>include>access_mode_values.incl.pl1 133 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. P_alias parameter char packed unaligned dcl 25 set ref 12 119 119* P_code parameter fixed bin(35,0) dcl 26 set ref 12 73* 124* 127* 128* P_homedir parameter char packed unaligned dcl 27 set ref 12 78 79* 121* 128* P_minimum_auth parameter bit(72) dcl 31 set ref 12 111* 112 121* 121* 128* 128* P_person parameter char packed unaligned dcl 28 set ref 12 76* P_projdir parameter char packed unaligned dcl 29 ref 12 95 P_project parameter char packed unaligned dcl 30 set ref 12 76* 95* 97* 104* SMA_ACCESS constant bit(3) initial packed unaligned dcl 1-11 ref 113 access_class 20 000200 automatic bit(72) level 2 dcl 43 set ref 112* addr builtin function dcl 69 ref 116 116 aim_check_$greater 000016 constant entry external dcl 49 ref 111 bitcount 000100 automatic fixed bin(24,0) dcl 33 set ref 81* 85* cbi 000200 automatic structure level 1 dcl 43 set ref 107* 116 116 chase_sw 1(02) 000200 automatic bit(1) level 3 packed packed unaligned dcl 43 set ref 110* code 000101 automatic fixed bin(35,0) dcl 34 set ref 74* 79* 80 81* 82 85* 86 88* 91 98* 104* 105 116* 117 119* 124 127 create_branch_info based structure level 1 dcl 2-17 create_branch_version_2 constant fixed bin(17,0) initial dcl 2-35 ref 108 dir_sw 1 000200 automatic bit(1) level 3 packed packed unaligned dcl 43 set ref 109* display_access_class_ 000020 constant entry external dcl 50 ref 121 121 128 128 error_table_$badpath 000010 external static fixed bin(35,0) dcl 45 ref 98 error_table_$noentry 000012 external static fixed bin(35,0) dcl 46 ref 91 124 error_table_$notadir 000014 external static fixed bin(35,0) dcl 47 ref 88 expand_pathname_ 000022 constant entry external dcl 51 ref 79 hcs_$chname_file 000024 constant entry external dcl 54 ref 119 hcs_$create_branch_ 000030 constant entry external dcl 56 ref 116 hcs_$get_access_class 000026 constant entry external dcl 55 ref 104 hcs_$status_minf 000032 constant entry external dcl 57 ref 81 85 hd 000102 automatic char(32) packed unaligned dcl 35 set ref 79* 81* 85* 116* 119* hdd 000124 automatic char(168) packed unaligned dcl 40 set ref 79* 81* 85* 95 95 97 116* 119* i 000112 automatic fixed bin(17,0) dcl 36 set ref 76* ioa_$rsnnl 000034 constant entry external dcl 58 ref 76 mode 2 000200 automatic bit(3) level 2 packed packed unaligned dcl 43 set ref 113* parent_ac_sw 1(04) 000200 automatic bit(1) level 3 packed packed unaligned dcl 43 set ref 111* pathname_ 000036 constant entry external dcl 59 ref 95 97 pd_acc 000176 automatic bit(72) dcl 42 set ref 104* 105* 111* rings 3 000200 automatic fixed bin(3,0) array level 2 dcl 43 set ref 115* substr builtin function dcl 69 ref 78 switches 1 000200 automatic structure level 2 packed packed unaligned dcl 43 sys_log_ 000040 constant entry external dcl 60 ref 121 sys_log_$error_log 000042 constant entry external dcl 61 ref 128 type 000113 automatic fixed bin(2,0) dcl 38 set ref 81* 82 84 85* 86 uid 000114 automatic char(32) packed unaligned dcl 39 set ref 76* 114 121* 128* unspec builtin function dcl 69 set ref 107* userid 6 000200 automatic char(32) level 2 dcl 43 set ref 114* version 000200 automatic fixed bin(17,0) level 2 dcl 43 set ref 108* NAMES DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. A_ACCESS internal static bit(3) initial packed unaligned dcl 1-11 A_ACCESS_BIN internal static fixed bin(5,0) initial dcl 1-36 DIR_ACCESS_MODE_NAMES internal static char(4) initial array packed unaligned dcl 1-33 E_ACCESS internal static bit(3) initial packed unaligned dcl 1-11 E_ACCESS_BIN internal static fixed bin(5,0) initial dcl 1-36 M_ACCESS internal static bit(3) initial packed unaligned dcl 1-11 M_ACCESS_BIN internal static fixed bin(5,0) initial dcl 1-36 N_ACCESS internal static bit(3) initial packed unaligned dcl 1-11 N_ACCESS_BIN internal static fixed bin(5,0) initial dcl 1-36 REW_ACCESS internal static bit(3) initial packed unaligned dcl 1-11 REW_ACCESS_BIN internal static fixed bin(5,0) initial dcl 1-36 RE_ACCESS internal static bit(3) initial packed unaligned dcl 1-11 RE_ACCESS_BIN internal static fixed bin(5,0) initial dcl 1-36 RW_ACCESS internal static bit(3) initial packed unaligned dcl 1-11 RW_ACCESS_BIN internal static fixed bin(5,0) initial dcl 1-36 R_ACCESS internal static bit(3) initial packed unaligned dcl 1-11 R_ACCESS_BIN internal static fixed bin(5,0) initial dcl 1-36 SA_ACCESS internal static bit(3) initial packed unaligned dcl 1-11 SA_ACCESS_BIN internal static fixed bin(5,0) initial dcl 1-36 SEG_ACCESS_MODE_NAMES internal static char(4) initial array packed unaligned dcl 1-30 SMA_ACCESS_BIN internal static fixed bin(5,0) initial dcl 1-36 SM_ACCESS internal static bit(3) initial packed unaligned dcl 1-11 SM_ACCESS_BIN internal static fixed bin(5,0) initial dcl 1-36 S_ACCESS internal static bit(3) initial packed unaligned dcl 1-11 S_ACCESS_BIN internal static fixed bin(5,0) initial dcl 1-36 W_ACCESS internal static bit(3) initial packed unaligned dcl 1-11 W_ACCESS_BIN internal static fixed bin(5,0) initial dcl 1-36 acla automatic structure array level 1 dcl 64 get_group_id_ 000000 constant entry external dcl 52 hcs_$add_dir_acl_entries 000000 constant entry external dcl 53 hdd_dir automatic char(168) packed unaligned dcl 40 hdd_entryname automatic char(32) packed unaligned dcl 41 ignore_code automatic fixed bin(35,0) dcl 37 NAMES DECLARED BY EXPLICIT CONTEXT. create_homedir_ 000070 constant entry external dcl 12 no_homedir 000721 constant label dcl 124 ref 80 89 91 99 117 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 1212 1256 1023 1222 Length 1516 1023 44 223 167 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME create_homedir_ 282 external procedure is an external procedure. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME create_homedir_ 000100 bitcount create_homedir_ 000101 code create_homedir_ 000102 hd create_homedir_ 000112 i create_homedir_ 000113 type create_homedir_ 000114 uid create_homedir_ 000124 hdd create_homedir_ 000176 pd_acc create_homedir_ 000200 cbi create_homedir_ THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. call_ext_out_desc call_ext_out return_mac ext_entry_desc THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. aim_check_$greater display_access_class_ expand_pathname_ hcs_$chname_file hcs_$create_branch_ hcs_$get_access_class hcs_$status_minf ioa_$rsnnl pathname_ sys_log_ sys_log_$error_log THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. error_table_$badpath error_table_$noentry error_table_$notadir LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 12 000062 73 000127 74 000131 76 000132 78 000164 79 000172 80 000220 81 000222 82 000260 84 000265 85 000267 86 000326 88 000333 89 000336 91 000337 95 000342 97 000404 98 000435 99 000440 104 000441 105 000472 107 000476 108 000501 109 000503 110 000505 111 000507 112 000532 113 000537 114 000541 115 000544 116 000555 117 000604 119 000606 121 000647 122 000720 124 000721 127 000730 128 000732 182 001021 ----------------------------------------------------------- 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