File PLOOR$DIA1:[003001.WRK]JASMON.MAR;1 50 ; 51 ;- 52 53 .link "sys$system:sys.stb"/SELECTIVE_SEARCH ****** File PLOOR$DIA1:[003001.WRK]JASMON_MOUSETRAP.MAR;2 50 ; 9/11/1991 Glenn C. Everhart 51 ; Modified the $setprv trap so that when enabled it ALWAYS 52 ; returns a quadword of FFFFFFFF FFFFFFFF (all privs) previously 53 ; set. Where a program plans to do something nefarious, this may 54 ; trigger such behavior, as the program now has the idea that 55 ; it is running with all privs enabled. (VMS will of course 56 ; disagree, and this can protect against actual problems being 57 ; induced...so long as the context is not REALLY priv'd. Only 58 ; the previous priv mask is altered...the rest of the operation 59 ; is unchanged EXCEPT again that a 1 is always returned to 60 ; indicate success. The new code is conditioned as ifdef MOUSETRAP. 61 ; 62 ;- 63 64 mousetrap = 1 65 .link "sys$system:sys.stb"/SELECTIVE_SEARCH ************ ************ File PLOOR$DIA1:[003001.WRK]JASMON.MAR;1 1065 JMP W^jgeneric 1066 ****** File PLOOR$DIA1:[003001.WRK]JASMON_MOUSETRAP.MAR;2 1077 .if ndf,MOUSETRAP 1078 JMP W^jgeneric 1079 .iff 1080 MOVAB jcommon,R0 1081 JSB (R0) 1082 1083 ; Call original system service 1084 MOVAB jdata_orig,R0 ; get base of original code 1085 ADDL3 (R0),4(SP),R0 ; add offset 1086 CALLG 0(AP),(R0) 1087 MOVL R0,(SP) ; save the return code 1088 1089 ; Fix-up the status code 1090 MOVL 4(SP),R0 ; Arglist count 1091 MOVL (SP),4(SP)[R0] ; put status in last arg slot 1092 1093 ; Put a message 1094 MOVAB joutput,R0 1095 CALLG 4(SP),(R0) 1096 1097 ; Completion 1098 POPL R0 ; restore $TRNLNM status code 1099 ;fill in addr at 16(ap) with masks 1100 ; use r0 as scratch since we will return a (possibly bogus) 1101 ; normal success return in it at all times 1102 movl 16(ap),r0 ;addr of old priv mask (passed by reference) 1103 movl #-1,(r0)+ ;fill in all 1 bits 1104 movl #-1,(r0) ;to 64 bits 1105 movl #1,r0 ;always return success 1106 RET ; return to caller 1107 .endc 1108 ************