              <<< VAXAXP::NOTES$:[NOTES$LIBRARY]VMSNOTES.NOTE;1 >>>
               -< VAX and Alpha VMS - Digital Internal Use Only >-
================================================================================
Note 777.2                   Remove password history                      2 of 2
EPS::VANDENHEUVEL "Hein"                             55 lines  23-JUN-1997 10:00
             -< $READ/DELE or call SYS$DELETE to hack that puppy. >-
--------------------------------------------------------------------------------
    
    Steve's right. The password history is just an indexed file keyed
    by username. There is only one gotcha to the file, in that it has
    a silly bucket size of 63. This more often than not prevents DCL
    from opening it. It should be possible, but not supported I guess,
    to use:
    	$OPEN/READ/WRITE/SHARE=WRITE X SYS$COMMON:[SYSEXE]VMS$PASSWORD_HISTORY.DATA0
    	$READ/DELE/KEY=unique_start_of_username X record
    	$CLOSE X
    
    Alternatively you can you a program like the one included.
    Note: You must pass key in quote to stop DCL/C-RTL from changing case.
    hth,
    	Hein.
    
    
/* delete_record.c   Hein van den Heuvel, 1-April-1997		*/
/* Usage: $delete_record <file_name> "<partial_key_value>"	*/
/* Note: 'generic' match is used, be carefull with short keys!	*/
    
#include <rms>
main (int argc, char *argv[])
{
struct FAB  fab;
struct RAB  rab;
int    status;

if (argc < 3) return 16;

fab = cc$rms_fab;
fab.fab$l_fna = argv[1];
fab.fab$b_fns = STRLEN( argv[1] );
fab.fab$b_shr = FAB$M_SHRPUT;
fab.fab$b_fac = FAB$M_DEL;

rab = cc$rms_rab;		
rab.rab$l_fab = &fab;		
rab.rab$l_kbf = argv[2];	
rab.rab$b_ksz = STRLEN( argv[2] );
rab.rab$b_rac = RAB$C_KEY;

status = sys$open(&fab);
if (status&1) {
  if (fab.fab$b_org!=FAB$C_IDX) return RMS$_ORG;
  status = sys$connect(&rab);
  if (status&1) {
    status = sys$find(&rab);
    if (status&1) {
      status = sys$delete(&rab);
      }
    }
  }
return status;
}
    
