regfio: Allow ignoring of checksum
[bbaumbach/samba-autobuild/.git] / source3 / registry / regfio.c
index 4c6271cda7aa603949f59987086511127199ec67..930ac834d1a2921bab673c6ade1904560a048068 100644 (file)
@@ -482,7 +482,7 @@ static bool read_regf_block( REGF_FILE *file )
        
        prs_mem_free( &ps );
        
-       if ( file->checksum !=  checksum ) {
+       if ( file->checksum != checksum && !file->ignore_checksums) {
                DEBUG(0,("read_regf_block: invalid checksum\n" ));
                return False;
        }
@@ -1242,6 +1242,7 @@ out:
        }
        ZERO_STRUCTP( rb );
        rb->fd = -1;
+       rb->ignore_checksums = false;
        
        if ( !(rb->mem_ctx = talloc_init( "regfio_open" )) ) {
                regfio_close( rb );