Changeset 2143


Ignore:
Timestamp:
5/16/2010 10:29:14 AM (5 years ago)
Author:
lowjoel
Message:

Instead of skipping reparse points when searching for files to erase, we will remove the reparse point securely, but leave the file contents intact.

Location:
trunk/eraser/Eraser.DefaultPlugins/ErasureTargets
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/eraser/Eraser.DefaultPlugins/ErasureTargets/FileSystemObjectErasureTarget.cs

    r2114 r2143  
    279279                } 
    280280 
    281                 fsManager.EraseFileSystemObject(info, method, 
    282                     delegate(long lastWritten, long totalData, int currentPass) 
    283                     { 
    284                         if (Task.Canceled) 
    285                             throw new OperationCanceledException(S._("The task was cancelled.")); 
    286  
    287                         progress.Total = totalData; 
    288                         progress.Completed += lastWritten; 
    289                         OnProgressChanged(this, new ProgressChangedEventArgs(progress, 
    290                             new TaskProgressChangedEventArgs(info.FullName, currentPass, method.Passes))); 
    291                     }); 
     281                //Do not erase reparse points, as they will cause other references to the file 
     282                //to be to garbage. 
     283                if ((info.Attributes & FileAttributes.ReparsePoint) == 0) 
     284                    fsManager.EraseFileSystemObject(info, method, 
     285                        delegate(long lastWritten, long totalData, int currentPass) 
     286                        { 
     287                            if (Task.Canceled) 
     288                                throw new OperationCanceledException(S._("The task was cancelled.")); 
     289 
     290                            progress.Total = totalData; 
     291                            progress.Completed += lastWritten; 
     292                            OnProgressChanged(this, new ProgressChangedEventArgs(progress, 
     293                                new TaskProgressChangedEventArgs(info.FullName, currentPass, method.Passes))); 
     294                        }); 
     295                else 
     296                    Logger.Log(S._("The file {0} is a reparse point and the contents of the file " + 
     297                        "was left intact, but the file reference was erased.", LogLevel.Notice)); 
    292298 
    293299                //Remove the file. 
  • trunk/eraser/Eraser.DefaultPlugins/ErasureTargets/FolderErasureTarget.cs

    r2115 r2143  
    109109            foreach (FileInfo file in files) 
    110110            { 
    111                 //Check that the file exists and is not a reparse point. 
    112                 if (!file.Exists || (file.Attributes & FileAttributes.ReparsePoint) != 0) 
    113                     continue; 
    114  
    115111                //Check that the file is included 
    116112                if (includePattern != null && !includePattern.Match(file.FullName).Success) 
Note: See TracChangeset for help on using the changeset viewer.