.title reset_pw_hist - reset password history .ident /v01.000/ .default displacement,word .nocross ;save paper $rmsdef ;rms junk $ssdef ;system service junk .cross ;unsave paper .psect data noexe,rd,wrt,pic,noshr,page hist_fab: $fab - ;password history file fab fnm=,- ;file name fac=,- ;read/write/update access shr=,- ;allow much sharing xab=hist_xabfhc ;xab chain address hist_rab: $rab - ;password history file rab fab=hist_fab,- ;fab address kbf=in_buff,- ;key buffer address ksz=32,- ;key size krf=0,- ;key number rac= ;keyed access hist_xabfhc: $xabfhc ;file header characteristics xab in_desc: .long 128 ;input buffer .address in_buff ; descriptor in_buff: .byte ^a" "[128] ;input buffer prompt: .ascid "Username: " ;prompt string .psect code exe,rd,nowrt,pic,shr,page .entry start,0 ;entry here $open fab=hist_fab ;open the file blbc r0,20$ ;we lose moval hist_rab,r11 ;a handy address $connect rab=(r11) ;get a record stream blbc r0,20$ ;not supposed to lose movzwl hist_xabfhc+xab$w_mrz,r2 ;get the size of the longest record subl r2,sp ;allocate a record buffer movl sp,r1 ;fetch the address of same $rab_store rab=(r11),- ;store it several palces ubf=(r1),rbf=(r1),- ;and store the size, too. usz=r2,rsz=r2 ;ta dum. 10$: movzbl #128,in_desc ;reset the descriptor pushaq in_desc ;return the length here pushaq prompt ;prompt string address pushaq in_desc ;input descriptor address calls #3,g^lib$get_foreign ;get a command line blbc r0,20$ ;presume eof. $get rab=(r11) ;read and lock the record blbc r0,20$ ;nope. $rab_store rab=(r11),- ;truncate same. rsz=#32 ; ... $update rab=(r11) ;truncate the record 20$: pushl r0 ;save the status $close fab=hist_fab ;close the file popl r0 ;restore the status cmpl #rms$_eof,r0 ;end of file? bneq 30$ ;nope, real error movl #ss$_normal,r0 ;shh. 30$: ret ;done .end start