Changeset 1866


Ignore:
Timestamp:
3/1/2010 6:45:19 AM (4 years ago)
Author:
lowjoel
Message:

When deleting files which do not belong to the current user an ArgumentException? is raised. Handle this situation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/eraser6/Eraser.DefaultPlugins/FileSystems/Windows.cs

    r1863 r1866  
    7676                return; 
    7777 
    78             //Set the date of the file to be invalid to prevent forensic 
    79             //detection 
    80             info.Attributes = FileAttributes.NotContentIndexed; 
     78            //Reset the file attributes to non-content indexed so indexing 
     79            //services will not lock the file. 
     80            try 
     81            { 
     82                info.Attributes = FileAttributes.NotContentIndexed; 
     83            } 
     84            catch (ArgumentException e) 
     85            { 
     86                //This is an undocumented exception: when the path we are setting 
     87                //cannot be accessed (ERROR_ACCESS_DENIED is returned) an 
     88                //ArgumentException is raised (no idea why!) 
     89                throw new UnauthorizedAccessException(e.Message, e); 
     90            } 
    8191 
    8292            //Rename the file a few times to erase the entry from the file system 
Note: See TracChangeset for help on using the changeset viewer.