From: SMTP%"vandenheuvel@eps.enet.dec.com" 5-APR-1997 00:01:17.37 To: jsb@early.com Subj: Re: Reading another user's mail? In article <5hsgfv$9f@blimpy.early.com>, you write... >Hein RMS van den Heuvel (vandenheuvel@eps.enet.dec.com) wrote: > >: At that time I just patched the image to make it do what I needed... > >Hmmm. Would this work for the present application? > >To recap answers I've received so far: : >4) Patch the relevant VMS image to allow READONLY access >(Or weren't you suggesting this Hein?) Sure. There are really only a few bits too many in the image. No big deal! :^) Note... The weak of stomach best move on now. And to be perfectly clear, this is me speaking with my hackers hat on, NOT my Digital hat. That said: If you search through your VMS listings (order now on CDrom!) you'll eventually stumble into the 'FILESUBS' module which goes into MAILSHR. Here the FAB for the mail file is inited with ; P 0884 2 $FAB_INIT(FAB=rd_fab, : ; P 0890 2 FAC=(DEL,GET,PUT,UPD,TRN), Which corresponds with the code fragment: 0050 8F 00 6E 00 2C 000A8 MOVC5 #0, (SP), #0, #80, (R6) 66 000AF ; 66 5003 8F B0 000B0 MOVW #20483, (R6) 16 A6 0F1F 8F B0 000B5 MOVW #3871, 22(R6) Now take yourself a fresh copy of SYS$LIBRARY:MAILSHR.EXE and DUMP it into a text file to search for the above patterns. You'll find something like: !Dump of file USER9$:[VANDENHEUVEL]MAILSHR.EXE;1 on 4-APR-1997 22:43:50.82 !File ID (16034,13,0) End of file block 139 / Allocated 141 ! !Virtual block number 47 (0000002F), 512 (0200) bytes ! ! D01FA602 9018A600 7E81F28F D016A60F 1F8FB066 50038FB0 6600508F 006E002C ! ~~~~~ ~~~~ ~~~~ So now if we want to replace the write-acces, all one needs to do, is to change that "1F" for (DEL,GET,PUT,UPD,TRN) to "02" for "GET". Using $PATCH/ABSOLUTIVELY/NONEW MAILSHR.EXE that would look something like: PATCH Version 5-05 20-June-1991 IMAGE FILE BEING PATCHED: "USER9$:[VANDENHEUVEL]MAILSHR.EXE;1" DATE/TIME OF PATCH: 4-APR-1997 23:07:06.05 PATCH>def x = 2e * 200 ! VBN number minus 1 symbol "X" defined as 00005C00 PATCH>ex/inst x+8 ! Offset of instruction in VBN 00005C08: MOVW #5003,(R6) PATCH>ex/inst 00005C0D: MOVW #0F1F,B^16(R6) PATCH>repl/inst . OLD> 'movw #0f1f,b^16(r6)' OLD> exit NEW> 'movw #0202,b^16(r6)' ! I tried FAC=GET, SHR=GET NEW> exit old: 00005C0D: MOVW #0F1F,B^16(R6) new: 00005C0D: MOVW #0202,B^16(R6) PATCH>update %PATCH-I-OVERLAY, USER9$:[VANDENHEUVEL]MAILSHR.EXE;1 being overwritten To test, I roughly used: MAIL>SELECT/BEFORE=xxx MAIL>COPY/ALL TEST some_device:TEST $DISM/NOUNL some_device $MOUN/NOWRITE some_device some_label read_only MAIL> SET FILE read_only:TEST $DEFINE MAILSHR MAILSHR MAIL> SET FILE read_only:TEST With the normal MAILSHR, the last command failed. With the improved image, it worked nicely. Ofcourse any modification command will fail, but relativly gracefully. For example a DELETE command results in 'RMS$_FAC, Operation not allowed' So as long as you can find the place to patch in any and all VMS version you expect to use from now on, and if you can get MAILSHR redirected to this 'improved' image for the web server process, and if you do not mind living on the edge, then this might just work! Hope this helps, +--------------------------------------+ Hein van den Heuvel, Digital. | All opinions expressed are mine, and | "Makers of VMS and other | may not reflect those of my employer | fine Operating Systems." +--------------------------------------+