$ ! MINPWDLEN.FIX $ ! $ ! Patch to implement minimum password length for SET PASSWORD $ ! $ ! SET $ ! $ ! ECO120 LJKilgallen 25-Oct-1982 $ ! MODULE: SETPWD $ ! Implement minimum password length for SET PASSWORD in VMS 3.0. $ ! $ ! If System logical name SET_PASSWORD_MINIMUM_LENGTH is defined to be a $ ! decimal number, the new password must have at least that many characters. $ ! $ ! Note that this patch sets a minimum only for the SET PASSWORD command. $ ! The AUTHORIZE utility can still be used for setting shorter passwords $ ! (by those with suitable privilege). $ ! $ ! If a VMS system is to be networked with a RSTS system, it may be bad $ ! to set a minimum length greater than 6 characters. Version 1.1 of $ ! DECnet/E will not support passwords longer than 6 characters. $ ! $ ON WARNING THEN EXIT $STATUS $ $ SET RMS/BUFFER=1/DISK/BLOCK=4 $ DEFINE/USER SYS$OUTPUT NL: $ PATCH [SYSEXE]SET /OUTPUT=[SYSEXE]SET /JOURNAL=[SYSEXE]SET ! ! Only proceed if this ECO has not already been set ! SET ECO 120 ! ! Patch to SET module SETPASSWORD, psect $CODE$. ! ! This patch is for the code on VMS 3.0 microfiche frame 0027 H 14. ! REPLACE/INSTRUCTION 47A4+0028+40 ' MOVW R0,W^0FB6A(R5)' ! This instruction is where the patch goes EXIT ' MOVW R0,W^0FB6A(R5)' ! Replicate the initial instruction ! ! Branch around subroutine ! ' BRW SETPWD_60$' ! ! ! Space reserved for ASCII name SET_PASSWORD_MINIMUM_LENGTH ! 'SETPWD_10$: HALT' ! 1 ' HALT' ! 2 ' HALT' ! 3 ' HALT' ! 4 ' HALT' ! 5 ' HALT' ! 6 ' HALT' ! 7 ' HALT' ! 8 ' HALT' ! 9 ' HALT' ! 10 ' HALT' ! 11 ' HALT' ! 12 ' HALT' ! 13 ' HALT' ! 14 ' HALT' ! 15 ' HALT' ! 16 ' HALT' ! 17 ' HALT' ! 18 ' HALT' ! 19 ' HALT' ! 20 ' HALT' ! 21 ' HALT' ! 22 ' HALT' ! 23 ' HALT' ! 24 ' HALT' ! 25 ' HALT' ! 26 ' HALT' ! 27 ! ! Subroutine to compare new password length to System logical name ! 'SETPWD_20$: HALT' ! Entry ' HALT' ! Mask ' PUSHAB SETPWD_10$' ! Address ' PUSHL #1B' ! Length (27) ' CLRQ -(SP)' ! Descriptor for result string ' MOVAB B^0C0(SP),SP' ! Space for buffer ' MOVAB (SP),B^0F4(FP)' ! Address ' MOVL #40,B^0F0(FP)' ! Length ' PUSHL #6' ! DSBMSK ' PUSHL #0' ! ACMODE ' PUSHL #0' ! TABLE ' PUSHAQ B^0F0(FP)' ! RSLBUF ' PUSHAQ B^0F0(FP)' ! RSLLEN ' PUSHAQ B^0F8(FP)' ! LOGNAM ' CALLS #6,@#80000258' ! SYS$TRNLOG ' BLBC R0,SETPWD_40$' ! Error if failure ' CMPL R0,#629' ! If SS$_NOTRAN ' BEQL SETPWD_50$' ! Escape ! ' MOVQ B^0F0(FP),R0' ! Descriptor of result ' CLRL R2' ! Total so far 'SETPWD_30$:CMPB (R1),#30' ! Compared to ASCII 0 ' BLSSU SETPWD_40$' ! less is a failure ' CMPB (R1),#39' ! Compared to ASCII 9 ' BGTRU SETPWD_40$' ! greater is a failure ' MULL2 #0A,R2' ! Previous total * 10 ' MOVZBL (R1),-(SP)' ! This character ' SUBL2 #30,(SP)' ! this value ' ADDL2 (SP)+,R2' ! new total ' INCL R1' ! next character ' SOBGTR R0,SETPWD_30$' ! if any ! ' CMPL B^14(FP),R2' ! If sufficiently long ' BGEQU SETPWD_50$' ! let it pass, but otherwise 'SETPWD_40$:CLRL B^14(FP)' ! Password too short ' RET' ! 'SETPWD_50$:MOVL #1,B^14(FP)' ! Password sufficiently long ' RET' ! ! ! Continuation of inline patch after subroutine ! 'SETPWD_60$: PUSHR #3' ! Preserve R0,R1 ' CALLS #0,W^SETPWD_20$'! Invoke the subroutine ' BLBC R0,4832' ! CLI$_PWDSYNTAX if too short ' POPR #3' ! Restore R0,R1 EXIT ! ! True entry mask ! REPLACE/WORD SETPWD_20$ 0 EXIT 0FF EXIT ! ! True logical name ! REPLACE/BYTE SETPWD_10$=0 20 EXIT REPLACE/WORD SETPWD_10$+1=0 2020 EXIT REPLACE SETPWD_10$+3 0 0 0 0 0 0 EXIT 20202020 20202020 20202020 20202020 20202020 20202020 EXIT SET MODE BYTE REPLACE/ASCII SETPWD_10$=' ' 'S' EXIT SET MODE WORD REPLACE/ASCII SETPWD_10$+1=' ' 'ET' EXIT SET MODE LONG REPLACE/ASCII SETPWD_10$+3 ' ' ' ' ' ' ' ' ' ' ' ' EXIT '_PAS' 'SWOR' 'D_MI' 'NIMU' 'M_LE' 'NGTH' EXIT ! ! Write the new EXE file ! UPDATE EXIT ! Conclusion of PATCH to SET $ IF "''UPD$PURGE'" .EQS. "" THEN EXIT $ IF UPD$PURGE THEN PURGE [SYSEXE]SET.EXE