Ignore:
Timestamp:
7/10/2010 8:36:36 AM (23 months ago)
Author:
lowjoel
Message:

Define proper behaviour when a directory reparse point (symbolic link/junction) is encountered. We should not touch the target of the reparse point, instead, just securely remove the reparse point. This also fixes a crash when a reparse point to the current directory is encountered (i.e. a folder referring to its immediate parent)

File:
1 edited

Legend:

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

    r2153 r2222  
    9191        /// </summary> 
    9292        /// <param name="info">The directory to look files in.</param> 
    93         /// <returns>A list of files found in the directory matching the IncludeMask 
    94         /// property.</returns> 
     93        /// <returns>A list of files found in the directory.</returns> 
     94        /// <remarks>This function does not recurse into directories which are 
     95        /// reparse points.</remarks> 
    9596        protected static FileInfo[] GetFiles(DirectoryInfo info) 
    9697        { 
    9798            List<FileInfo> result = new List<FileInfo>(); 
    98             if (info.Exists) 
     99            if (info.Exists && (info.Attributes & FileAttributes.ReparsePoint) == 0) 
    99100            { 
    100101                try 
Note: See TracChangeset for help on using the changeset viewer.