COMPILATION LISTING OF SEGMENT apl_read_password_ Compiled by: Multics PL/I Compiler, Release 28d, of October 4, 1983 Compiled at: Honeywell LCPD Phoenix, System M Compiled on: 11/29/83 1615.4 mst Tue Options: optimize map 1 /* ****************************************************** 2* * * 3* * * 4* * Copyright (c) 1972 by Massachusetts Institute of * 5* * Technology and Honeywell Information Systems, Inc. * 6* * * 7* * * 8* ****************************************************** */ 9 10 /* Program to read a password off of a console. The code is stolen from the 11* system routine "get_password_", except that a "read_back_input" order call is used 12* to the APL DIM, and upper case letters are not used (since they cause underlines 13* and backspaces when printed). 14* 15* Written by some anonymous person, summer 1973. 16* Modified by PG on 740211 to use correct order call. 17* Modified 781208 by PG to switch to clock builtin 18**/ 19 20 apl_read_password_: 21 read_password_: 22 procedure (word); 23 24 declare word char (8) parameter, 25 the_password char (nelemt-i) based (addr (buffer.char (i))); 26 27 declare user_info_$tty_data entry (char (*), fixed bin, char (*)), 28 ios_$write_ptr entry (pointer, fixed bin, fixed bin), 29 ios_$read entry (char (*), pointer, fixed bin, fixed bin, fixed bin, bit (72) aligned), 30 ios_$order entry (char (*), char (*), pointer, bit (72) aligned), 31 nelemt fixed bin, 32 (printer_on_char init ("000000110"b), 33 printer_off_char init ("000010101"b), 34 carriage_return_char init ("000001101"b), 35 newline_char init ("000001010"b), 36 red_shift_char init ("000001110"b), 37 black_shift_char init ("000001111"b)) bit (9) static, 38 39 1 buffer aligned, 40 2 char char (1) unaligned dimension (150), 41 42 time fixed bin (71), 43 ubits bit (72) aligned, 44 RANDOM char (32) static aligned init ("etaiosqwertyuioplkjkgfdsazxcvbnm"), 45 i fixed bin, 46 old_read_back_state char (32), 47 additional_garbage char (12); 48 49 dcl buffer_1_to_12 char (12) unaligned based (addr (buffer.char (1))), 50 buffer_3_to_15 char (13) unaligned based (addr (buffer.char (3))), 51 buffer_14_to_25 char (12) unaligned based (addr (buffer.char (14))), 52 buffer_27_to_38 char (12) unaligned based (addr (buffer.char (27))), 53 buffer_40_to_51 char (12) unaligned based (addr (buffer.char (40))), 54 buffer_53_to_64 char (12) unaligned based (addr (buffer.char (53))); 55 56 declare idcode char (4), 57 type fixed bin, 58 channel char (8); 59 60 declare (addr, bit, clock, fixed, null, substr, unspec) builtin; 61 62 /* program */ 63 64 call user_info_$tty_data (idcode, type, channel); 65 66 unspec (buffer.char (1)) = printer_on_char; 67 unspec (buffer.char (2)) = red_shift_char; 68 buffer_3_to_15 = "apl password:"; 69 unspec (buffer.char (16)) = newline_char; 70 unspec (buffer.char (17)) = black_shift_char; 71 unspec (buffer.char (18)) = printer_off_char; 72 73 call ios_$write_ptr (addr (buffer), 0, 18); 74 if type < 0 then go to mask_it; 75 if type > 7 then go to mask_it; 76 go to device (type); 77 78 device (2): if substr (idcode, 1, 1) < "A" then go to no_mask; 79 device (0): device (6): device (7): mask_it: 80 time = clock (); 81 substr (ubits, 1, 36) = bit (fixed (time, 36), 36); 82 substr (ubits, 37, 36) = bit (fixed (fixed (time, 35) * 99991, 36), 36); 83 do i = 2 to 13; 84 substr (additional_garbage, i-1, 1) = substr (RANDOM, fixed (substr (ubits, 1+5*i, 5), 17)+1, 1); 85 end; 86 87 /* assemble password mask */ 88 buffer_1_to_12 = "TypePassword"; 89 buffer_14_to_25 = "xwxwxwxwxwxw"; 90 buffer_27_to_38 = "986986986986"; 91 buffer_40_to_51 = "wgxwgxwgxwgx"; 92 unspec (buffer.char (13)) = carriage_return_char; 93 unspec (buffer.char (26)) = carriage_return_char; 94 unspec (buffer.char (39)) = carriage_return_char; 95 unspec (buffer.char (52)) = carriage_return_char; 96 buffer_53_to_64 = additional_garbage; 97 unspec (buffer.char (65)) = carriage_return_char; 98 99 call ios_$write_ptr (addr (buffer), 0, 65); 100 101 device (1): device (3): device (4): device (5): no_mask: 102 call ios_$order ("user_i/o", "read_back_input", addr (old_read_back_state), ""b); 103 call ios_$read ("apl_input_", addr (buffer), 0, 150, nelemt, ""b); 104 if nelemt <= 1 then go to blank; 105 106 /* remove extraneous chars */ 107 108 do i = 1 by 1 while (buffer.char (i) = " "); 109 end; 110 if i = nelemt then go to blank; 111 word = the_password; 112 go to return; 113 blank: word = "*"; 114 115 return: unspec (buffer.char (1)) = printer_on_char; 116 call ios_$write_ptr (addr (buffer), 0, 1); /* click click */ 117 call ios_$order ("user_i/o", old_read_back_state, null, ""b); 118 return; 119 end; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 11/29/83 1347.0 apl_read_password_.pl1 >special_ldd>on>apl.1129>apl_read_password_.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. RANDOM 000010 constant char(32) initial dcl 27 ref 84 additional_garbage 000165 automatic char(12) unaligned dcl 27 set ref 84* 96 addr builtin function dcl 60 ref 68 73 73 88 89 90 91 96 99 99 101 101 103 103 111 116 116 bit builtin function dcl 60 ref 81 82 black_shift_char constant bit(9) initial unaligned dcl 27 ref 70 buffer 000101 automatic structure level 1 dcl 27 set ref 73 73 99 99 103 103 116 116 buffer_14_to_25 based char(12) unaligned dcl 49 set ref 89* buffer_1_to_12 based char(12) unaligned dcl 49 set ref 88* buffer_27_to_38 based char(12) unaligned dcl 49 set ref 90* buffer_3_to_15 based char(13) unaligned dcl 49 set ref 68* buffer_40_to_51 based char(12) unaligned dcl 49 set ref 91* buffer_53_to_64 based char(12) unaligned dcl 49 set ref 96* carriage_return_char constant bit(9) initial unaligned dcl 27 ref 92 93 94 95 97 channel 000172 automatic char(8) unaligned dcl 56 set ref 64* char 000101 automatic char(1) array level 2 packed unaligned dcl 27 set ref 66* 67* 68 69* 70* 71* 88 89 90 91 92* 93* 94* 95* 96 97* 108 111 115* clock builtin function dcl 60 ref 79 fixed builtin function dcl 60 ref 81 82 82 84 i 000154 automatic fixed bin(17,0) dcl 27 set ref 83* 84 84* 108* 108* 110 111 111 idcode 000170 automatic char(4) unaligned dcl 56 set ref 64* 78 ios_$order 000016 constant entry external dcl 27 ref 101 117 ios_$read 000014 constant entry external dcl 27 ref 103 ios_$write_ptr 000012 constant entry external dcl 27 ref 73 99 116 nelemt 000100 automatic fixed bin(17,0) dcl 27 set ref 103* 104 110 111 newline_char constant bit(9) initial unaligned dcl 27 ref 69 null builtin function dcl 60 ref 117 117 old_read_back_state 000155 automatic char(32) unaligned dcl 27 set ref 101 101 117* printer_off_char constant bit(9) initial unaligned dcl 27 ref 71 printer_on_char constant bit(9) initial unaligned dcl 27 ref 66 115 red_shift_char constant bit(9) initial unaligned dcl 27 ref 67 substr builtin function dcl 60 set ref 78 81* 82* 84* 84 84 the_password based char unaligned dcl 24 ref 111 time 000150 automatic fixed bin(71,0) dcl 27 set ref 79* 81 82 type 000171 automatic fixed bin(17,0) dcl 56 set ref 64* 74 75 76 ubits 000152 automatic bit(72) dcl 27 set ref 81* 82* 84 unspec builtin function dcl 60 set ref 66* 67* 69* 70* 71* 92* 93* 94* 95* 97* 115* user_info_$tty_data 000010 constant entry external dcl 27 ref 64 word parameter char(8) unaligned dcl 24 set ref 20 20 111* 113* NAMES DECLARED BY EXPLICIT CONTEXT. apl_read_password_ 000104 constant entry external dcl 20 blank 000450 constant label dcl 113 ref 104 110 device 000000 constant label array(0:7) dcl 78 ref 76 mask_it 000177 constant label dcl 79 ref 74 75 no_mask 000312 constant label dcl 101 ref 78 read_password_ 000074 constant entry external dcl 20 return 000455 constant label dcl 115 ref 112 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 624 644 534 634 Length 1022 534 20 142 70 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME read_password_ 190 external procedure is an external procedure. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME read_password_ 000100 nelemt read_password_ 000101 buffer read_password_ 000150 time read_password_ 000152 ubits read_password_ 000154 i read_password_ 000155 old_read_back_state read_password_ 000165 additional_garbage read_password_ 000170 idcode read_password_ 000171 type read_password_ 000172 channel read_password_ THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. call_ext_out_desc call_ext_out return ext_entry clock THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. ios_$order ios_$read ios_$write_ptr user_info_$tty_data NO EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 20 000071 64 000111 66 000131 67 000133 68 000135 69 000140 70 000142 71 000144 73 000146 74 000166 75 000170 76 000172 78 000173 79 000177 81 000201 82 000206 83 000214 84 000221 85 000233 88 000235 89 000242 90 000245 91 000250 92 000253 93 000255 94 000257 95 000261 96 000263 97 000270 99 000272 101 000312 103 000353 104 000421 108 000424 109 000433 110 000435 111 000440 112 000447 113 000450 115 000455 116 000457 117 000477 118 000532 ----------------------------------------------------------- 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