Table of Contents From the Editor . . . . . . . . . . . . . . . RST-1 Letter(s) to the Editor . . . . . . . . . . . RST-1 DCL Trick of the Month. . . . . . . . . . . . RST-4 Software Performance Report (SPR) Log . . . . RST-7 Questionnaire . . . . . . . . . . . . . . . . RST-7 CUSP of the Month - LOGIN . . . . . . . . . . RST-8 Next month's theme - DECNET/E (hopefully!) =============================================================== From the Editor Terry Kennedy Last month I promised that this month's topic would be DECNET/E. Unfortunately, due to the press of work here I was unable to complete the featured programs for that topic. I hope to have them ready for next month. If not, I'll stop promising them until I get them done - but I have high hopes for next month. As I am writing this, my primary RSTS system is down with sick disk drives, so some of the example listings shown may be slightly incorrect. I will have been able to verify them long before you get to read this, however. Therefore, any corrections will be posted on the SIG Newsletter system. Also, you may download any of the included listings from the system rather than typing them in yourself. The newsletter system phone number is (201) 435-2546. Access is at either 300 or 1200 baud. Press RETURN until you get the LOGIN banner. There you will see further instructions. Anyway, instead of DECNET/E, this month I am presenting that old standby, '101 (almost) Interesting Patches to LOGIN'. I hope you find it useful. =============================================================== Letter(s) to the Editor Jeff Killeen writes: The following program can be used to connect to a dialout modem. You just run the program and give the KB number you want to dialout on. To disconnect the line type a accent mark (`) followed by the KB number you connected to. We use it to "hop" over several RSTS systems when running DIALUP and KERMIT software. [From the editor: This program is available on the SIG newsletter system as file DU0:[49,1]CONECT.BAS] (listing begins on next page) 610 DIM OUTPUT.TERMINAL%(127%) & 1000 ! & ! PROGRAM INIT & 1010 ON ERROR GO TO 10000 & 1300 ! & ! GET INPUT TERMINAL & 1310 PRINT & 1320 INPUT "Connect to terminal (0-127)";CONNECT.TERMINAL% \ & PRINT \ & GO TO 1320 IF CONNECT.TERMINAL%<0% OR CONNECT.TERMINAL%>127% & 1330 DISCONNECT.STRING$="`"+NUM1$(CONNECT.TERMINAL%) & 1350 S$=SYS(CHR$(6%)+CHR$(10%)+STRING$(20%,0%)+"KB"+ & CHR$(CONNECT.TERMINAL%)+CHR$(-1%)) & 1360 HOME.TERMINAL%=ASCII(MID(SYS(CHR$(6%)+CHR$(9%)),2%,1%))/2% \ & OUTPUT.TERMINAL%(CONNECT.TERMINAL%)=HOME.TERMINAL% \ & OUTPUT.TERMINAL%(HOME.TERMINAL%)=CONNECT.TERMINAL% & 1370 S$=SYS(CHR$(6%)+CHR$(-9%)+CHR$(CONNECT.TERMINAL%)+CHR$(-1%)) & 1390 PRINT "KB";NUM1$(HOME.TERMINAL%);": is cross connected to KB"; & NUM1$(CONNECT.TERMINAL%);":" \ & PRINT & 1400 ! & ! OPEN FILES & 1410 OPEN "KB:" AS FILE 1%, MODE 1% \ & FIELD#1%, 1% AS INPUT.TERMINAL$, 127% AS INPUT.BUFFER$ & 2000 ! & ! MAIN ROUTINE & 2010 GET#1%, RECORD 32767%+1%+16384%+4096% \ & INPUT.TERMINAL%=ASCII(INPUT.TERMINAL$) \ & INPUT.COUNT%=RECOUNT & 2020 GO TO 2090 IF INPUT.TERMINAL%<>HOME.TERMINAL% & 2030 Z%=INSTR(0%,INPUT.BUFFER$,"`") \ & GO TO 2090 UNLESS Z% 2040 IF Z%>1% & THEN & PUT#1%, RECORD 32767%+1%+16384%+4096%+ & OUTPUT.TERMINAL%(INPUT.TERMINAL%), & COUNT Z%-1%, USING 1% & 2050 Z$=MID(INPUT.BUFFER$,Z%,INPUT.COUNT%-Z%) & 2060 IF INSTR(0%,DISCONNECT.STRING$,Z$)=0% & THEN & LSET INPUT.BUFFER$=Z$+"" \ & PUT#1%, RECORD 32767%+1%+16384%+4096%+ & OUTPUT.TERMINAL%(INPUT.TERMINAL%), & COUNT LEN(Z$), USING 1% \ & GO TO 2010 & 2070 GET#1%, RECORD 32767%+1%+16384%+4096%+HOME.TERMINAL% \ & INPUT.TERMINAL%=ASCII(INPUT.TERMINAL$) \ & INPUT.COUNT%=RECOUNT \ & Z$=Z$+LEFT(INPUT.BUFFER$,INPUT.COUNT%-1%) \ & GO TO 5000 IF Z$=DISCONNECT.STRING$ \ & GO TO 2060 & 2090 PUT#1%, RECORD 32767%+1%+16384%+4096%+ & OUTPUT.TERMINAL%(INPUT.TERMINAL%), & COUNT INPUT.COUNT%-1%, USING 1% \ & GO TO 2010 & 5000 ! & ! EXIT & 5030 PRINT \ & PRINT \ & PRINT "KB";NUM1$(CONNECT.TERMINAL%);": is disconnected" \ & PRINT & 5050 S$=SYS(CHR$(6%)+CHR$(-9%)+CHR$(CONNECT.TERMINAL%)+CHR$(0%)) & 5090 S$=SYS(CHR$(6%)+CHR$(11%)+STRING$(20%,0%)+"KB"+ & CHR$(CONNECT.TERMINAL%)+CHR$(-1%)) & 9999 GO TO 32767 & 10000 ! & ! ERROR TRAPS & 10010 IF ERR=27% & THEN & PRINT \ & PRINT \ & PRINT "?Disconnect from remote system" \ & PRINT \ & RESUME 5000 & 10990 ON ERROR GO TO 0 & 32767 END & =============================================================== DCL Trick of the Month Every SIG seems to be publishing DCL 'goodies' lately. I'll try to have some of the more interesting ones here. As usual, this is not restricted to RSTS DCL, any DCL trick will be included. However, preference is given to RSTS-unique ones. This month I will show you how to perform simple modifications to the RSTS DCL command tables. Unlike VMS, RSTS does not have a utility to do this. NOTE: THE FOLLOWING PROCEDURE IS DANGEROUS. IF YOU ARE NOT FAMILIAR WITH RSTS, DO NOT ATTEMPT THIS. ALL MODIFICATIONS MADE ARE AT YOUR OWN RISK. DON'T BLAME ME! The sample shown below will modify the DCL command SHOW NETWORK to display information on ALL nodes, regardless of their status. As distributed, DECNET/E will only show information on nodes it 'knows about'. In this context, non- routing Ethernet nodes only 'know' about the nearest router. First, we will use SET VERIFY/WATCH (from last month) to see exactly what command DCL issues for SHOW NETWORK: $ SET VERIFY/WATCH $ SHOW NETWORK (NCP SHO ACT NOD) That's the problem - we're doing a show active instead of a show known command. What we wanted was NCP SHO KNO NOD. This brings out an important point - strings we replace must be the SAME LENGTH as the originals. Now, we'll copy the existing DCL.RTS to a temp file for our changes: $ COPY [0,1]DCL.RTS [0,1]NDCL.RTS Next, we'll invoke the SCAN program (listing at end of article or on the newsletter systems as DU0:[49,1]SCAN.BAS) to locate the text string. Note that SCAN won't find matches across disk blocks, so you may have to use a different search string: $ RUN SCAN Binary file search 1.10 - 14-Jul-87 TMK File? [0,1]ndcl.rts Search string? ACT NOD Found in block 97 (000140), offset 205 (000314). Done... $ We can compute the address used by ODT as follows: Disk block (in octal): 000140 + Offset (in octal): 000314 --------- 000140314 (or 140314 for short) Now that we know the ODT address, we will need to know the octal values for the replacement text (ACT versus KNO). We can get this by doing HELP ADVANCED ASCII. From the chart that is displayed, we see that K is 113 octal, N is 116, and O is 117. Now we will run the ODT program to actually modify the text in our copy of the DCL run-time system. The text in BOLD ITALICS is what you type. $ run auxlib$:odt ODT V9.4-01 RSTS V9.4-05 Newsletter Sys. File? [0,1]ndcl.rts [display the text to make sure we are at the right spot] *140314/ 041501 " AC 140316/ 020124 " T 140320/ 047516 " NO 140322/ 000104 " D [look at the previous 4 bytes to make sure] *140310/ 044123 " SH 140312/ 020117 " O [now we will modify the ACT to KNO using the octal codes] *140314\ 101 113 140315\ 103 116 140316\ 124 117 [now let's make sure the changes were correct] *140314/ 047113 " KN 140316/ 020117 " O [all done, let's exit] *^Z Now, make SURE that you have only changed the bytes that you wanted to change. ANY extraneous changes will cause SEVERE problems sooner or later. In the worst case, you might not even be able to reboot your system! If you are ABSOLUTELY SURE, issue the following command to replace the old DCL run- time system: $ copy [0,1]ndcl.rts [0,1]dcl.rts OK to replace existing file DU0:[0,1]DCL .RTS ? y [File [0,1]NDCL .RTS copied to [0,1]DCL .RTS] Now, reboot your system in order for the change to take effect. You can verify this after rebooting by re-issuing the original set of commands, as follows: $ SET VERIFY/WATCH $ SHOW NETWORK (NCP SHO KNO NOD) If you have made an error, restore DCL.RTS by re-booting your RSTS installation tape (you DO know where it is, right?) and specifying an UPDATE (as opposed to an installation). Specify your system disk name and let it proceed. Answer 'NO' to 'Start timesharing?'. At the 'Option?' prompt, say INSTALL monitorname, where monitorname is the name of your system monitor (usually RSTS). Now you may re-start your system as usual. Please note that neither DEC nor I can be responsible for any problems or incompatibilities that this type of patching may introduce. I would add, however, that I am running at least a dozen patches like this, and have been over the last 3 releases of RSTS, and have not had any problems as long as the patches are carefully applied. This is the listing for SCAN.BAS: 1000 EXTEND 1010 ON ERROR GOTO 32000 & \ PRINT "Binary file search 1.10 - 14-Jul-87 TMK" & \ GOSUB 10000 & \ PRINT 1020 PRINT "File"; 1030 INPUT LINE F1$ & \ F1$=MID(F1$,1%,LEN(F1$)-2%) 1040 INPUT "Search string";S$ 1050 OPEN F1$ FOR INPUT AS FILE #1%, RECORDSIZE 512% 1060 FIELD #1, 512% AS I1$ & \ I%=1% 1070 GET #1% & \ BYT%=INSTR(1%,I1$,S$) & \ GOTO 1080 IF BYT%=0% & \ PRINT "Found in block ";NUM1$(I%);" ("; & \ I$=CVT%$(I%-1%) & \ GOSUB 11000 & \ PRINT "), offset ";NUM1$(BYT%);" ("; & \ I$=CVT%$(BYT%-1%) & \ GOSUB 11000 & \ PRINT ")." 1080 I%=I%+1% & \ GOTO 1070 & 10000 REM DEFINE XLATE STRINGS 10010 E1$=E1$+STRING$(64%,I%) FOR I%=48% TO 51% & ! XLATE FOR 1ST OCTAL DIGIT 10020 E2$=E2$+STRING$(8%,I%) FOR I%=48% TO 55% & \ E2$=E2$+E2$+E2$+E2$ & ! XLATE FOR 2ND OCTAL 10030 E3$=E3$+'01234567' FOR I%=1% TO 32% & ! XLATE FOR 3RD OCTAL DIGIT 10040 RETURN & 11000 REM SUBROUTINE TO PRINT IN OCTAL 11010 R1$,R2$,R3$='' & \ FOR J%=1% TO LEN(I$) STEP 2% & \ J1%=CVT$%(MID(I$,J%,2%)) & \ R4$='0' & \ R4$='1' IF J1%<0% & \ J1%=J1% AND 32767% & \ R6$=NUM1$(J1% AND 7%) & \ R5$=NUM1$((J1%/512%) AND 7%) & \ R8$=NUM1$((J1%/8%) AND 7%) & \ R7$=NUM1$((J1%/4096%) AND 7%) & \ R9$=NUM1$((J1%/64%) AND 7%) & \ NEXT J% & \ PRINT R4$;R7$;R5$;R9$;R8$;R6$; & \ RETURN & 32000 IF ERL=1050 THEN PRINT "?That file does not exist "; & "- try again..." & \ RESUME 1020 32010 IF ERL=1070 THEN PRINT "Done..." & \RESUME 32767 32020 IF ERL=1020 THEN RESUME 32767 32030 IF ERL=1030 THEN RESUME 32767 32040 IF ERL=1040 THEN RESUME 32767 32050 PRINT "Received error ";NUM1$(ERR);" at line "; & NUM1$(ERL);"." & \ RESUME 32767 & 32767 END =============================================================== Software Problem Report (SPR) Log Please send the newsletter editor copies of any SPR's (and Digital's answer) on RSTS/E, DECNET/E, or RSTS layered products. We will print any that are of general interest. The reason for this is that many SPR's are answered with a patch or a notice of restriction, but due to space considerations, they are not published in the Software Dispatch. Since we're desperate for material, this should be useful information and we will print it. =============================================================== Questionnaire In the back of this newsletter, you will find a questionnaire. Please fill it out and return it to the editor. This will help us serve you better by defining the areas you're interested in. There is a section for your comments, as well. =============================================================== CUSP of the Month Every month, we'll pick a CUSP (Commonly Used System Program) and show you new things to do with it. This may be either in the form of patches, or simply a new way to use it. When we provide modifications to the source, we will only show the lines which need to be changed. If you decide you want the patch, edit a COPY of the program (NOT the original). Please remember that Digital can't be responsible for modified programs. This month's victim is LOGIN.BAS. These patches modify the functionality of the program in certain areas. Some of them may have a impact on security provisions that DEC provides in LOGIN. These will me marked with the comment SECURITY: and a discussion of what the impact is. This section is structured as a set of 'mini-articles', each detailing a particular modification to LOGIN. They may be applied in any combination, except where noted. 101 (almost) Interesting Patches to LOGIN - #1 Did you ever wish that you could supply a real username instead of a cryptic PPN to login? (This is known as 'VMS envy'). Well, now you can - if you have DECMAIL-11 for RSTS. This patch to LOGIN.BAS lets you supply your MAIL username as a valid response to LOGIN's User: prompt. RSTS/E version 9.3 or later and DECMAIL-11 version V3.0-00.04 were used for this modification. You may have to edit the supplied patch for other releases of either product. Re-compile LOGIN as documented at the end of this article. Basic installation is now complete. You may now enter any valid MAIL username when logged-out, and then provide the password in the usual manner. If you want this new feature to work when logged-in also, read the next paragraph, otherwise don't bother. DCL will try to outsmart you by not allowing non-numeric user information in the DCL LOGIN command. You can cure this by inserting the following two lines in their respective files: In [0,1]START.COM: $ define/command/system LOG-IN $LOGIN.* /privilege In [0,1]LOGIN.COM: $ LOG-IN == "CCL LOGIN" Note that this will 'break' the DCL command login/terminal. To work around this, simply put an underscore in front of that command wherever it is used, as so: _login/terminal=kb1: [1,2]. This problem only happens when you add the two lines for logged-in name translation. Name translation will not work in DECNET requests for access information, as they are not handled by LOGIN. Oh well. Change the line number of line 13001 to 13008. Insert the following code immediately before that line: 13001 OPEN "MAIL$:NAMES.SYS" FOR INPUT AS FILE #2%, & RECORDSIZE 512%, MODE 8192% & \ FIELD #2%, 512% AS MAIWRK$ & \ LOGIN1$=CVT$$(LOGIN$,34%) & \ GOTO 13004 IF LOGIN1$="" & \ GET #2%, BLOCK 1% & \ MAIREC%=CVT$%(MID(MAIWRK$,5%,2%)) & ! OPEN THE MAIL NAMES FILE & ! CONVERT TYPED USERNAME TO UPCASE, NO SPACES OR TABS & ! GET THE FIRST RECORD OF MAIL USERNAMES & 13002 GET #2%, BLOCK MAIREC% & \ FOR MAITMP%=33% TO 512% STEP 16% & \ MAINAM$=CVT$$(MID(MAIWRK$,MAITMP%,12%),160%) & \ GOTO 13003 IF MAINAM$=LOGIN1$ & \ NEXT MAITMP% & \ MAIREC%=CVT$%(LEFT(MAIWRK$,2%)) & \ GOTO 13002 UNLESS MAIREC%=0% & \ GOTO 13004 & ! READ THE FIRST USERNAME BLOCK & ! LOOK AT ALL THE POSSIBLE NAMES IN IT & ! IF WE HAVE A MATCH, EXIT & ! ELSE LOOK AT REST & ! IF NOT FOUND, DETERMINE NEXT RECORD AND LOOP IF NOT & ! AT END & ! ELSE RETURN A NON-MATCH & 13003 LOGIN$="["+NUM1$(ASCII(MID(MAIWRK$,MAITMP%+12%,1%))) & +","+NUM1$(ASCII(MID(MAIWRK$,MAITMP%+13%,1%)))+"]" & ! CONSTRUCT PPN FROM MAIL USERNAME ENTRY & 13004 CLOSE #2% & ! CLOSE THE MAIL NAMES FILE & Change the start of line 13900 as follows: 13900 RESUME 13008 IF ERL=13001 & \ resume 13008 if ERL=13002 & \ RESUME 19999 IF KB.SPAWNED% OR (NOT (LOGGED.IN%)) & OR A%=0% & \ PRINT "?Invalid entry - try again" IF A% & 101 (almost) Interesting Patches to LOGIN - #2 The next patch will disable the ever-increasing delay after an invalid login attempt. This is a particularly obnoxious problem when you are attempting to dial in over a noisy phone line. SECURITY: DEC feels that the delay helps prevent system breakins. Find the following lines in LOGIN.BAS: \ WHILE HOLD% AND (DELAY%>0%) & \ SLEEP 1% & \ DELTA%=J%-(PEEK(516%) AND 255%) & \ HOLD%=((DELTA%>=0% AND DELTA%0% [and here] \ CUR.DAT%=PEEK(512%) & In LOGOUT.BAS, insert the line: \ SEND.OPSER%=0% & before the line: \ MAXCNT%=M%(4%) & 101 (almost) Interesting Patches to LOGIN - #5 The following patch will cause LOGIN to type a welcoming message before printing the User: prompt message. The welcome message is kept in the file $LOGIN.TXT, allowing it to be easily changed as conditions require. Replace line 32000 of LOGIN.BAS with the following lines: 32000 ! ENTRY POINT IF LINE TYPED AND NOT LOGGED IN & ! & ON ERROR GOTO 32400 & \ PRINT CHR$(7%); & \ GOSUB 22500 & \ I$=SYS(CHR$(0%))+SYS(CHR$(2%)) & \ LOGGED.IN%=0% & \ OPEN "_KB:LOGIN.CMD" FOR INPUT AS FILE #1% & 32002 I$=SYS(PRIV.ON$) & \ OPEN "$LOGIN.TXT" FOR INPUT AS FILE 2%, MODE 8192% & \ I$=SYS(PRIV.OFF$) & \ PRINT FNC$; & 32004 INPUT LINE #2%,I$ & \ PRINT I$; & \ GOTO 32004 & 32006 CLOSE #2% & ! Print welcoming message & Replace line 32420 with the following lines: 32420 RESUME 7035 IF ERL=7030% & \ RESUME 9900 IF ERL= 9005% & \ RESUME 32670 IF ERL=32010% AND ERR=15% & \ RESUME 32320 IF ERL=32310% AND ERR=11% & \ RESUME 32600 IF ERL=32300% OR ERL=32310% & \ RESUME 32006 IF ERL=32004% AND ERR=11% & \ RESUME 32010 IF ERL=32002% OR ERL=32004% & \ RESUME 32670 IF ERL=32650% & \ RESUME 32767 IF ERL>=32670% & \ RESUME 32650 IF A% & \ RESUME 32600 & \ & Common instructions for all LOGIN patches Enter the patch(es) into a COPY of your LOGIN.BAS. Don't modify the original! Then compile it with Basic-Plus 2 if you have it, as documented in the Maintenance Notebook. NOTE: Basic-Plus 2 V2.4 has a bug which prevents it from compiling LOGIN, with or without these modifications. Therefore, you must use V2.3 or earlier. If you don't have BP2, you can use Basic- Plus. CSPCOM will not work, so don't use it! Now, log onto your system from at least two terminals (so you can recover if something goes wrong). Rename $LOGIN.TSK to $LOGIN.OLD, and copy the new LOGIN program (either LOGIN.TSK for BP2 or LOGIN.BAC for B+) to $. Ensure it has a protection code of <232>.