Changeset 2282
- Timestamp:
- 1/4/2011 2:42:32 AM (2 years ago)
- Location:
- trunk/eraser
- Files:
-
- 7 edited
-
Eraser.DefaultPlugins/ErasureTargets/SecureMoveErasureTarget.cs (modified) (1 diff)
-
Eraser.DefaultPlugins/Strings.en.resx (modified) (1 diff)
-
Eraser.DefaultPlugins/Strings.it.resx (modified) (1 diff)
-
Eraser.DefaultPlugins/Strings.nl.resx (modified) (1 diff)
-
Eraser.DefaultPlugins/Strings.pl.resx (modified) (1 diff)
-
Eraser.DefaultPlugins/Strings.resx (modified) (1 diff)
-
Eraser.Util/Shell.cs (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/eraser/Eraser.DefaultPlugins/ErasureTargets/SecureMoveErasureTarget.cs
r2211 r2282 149 149 private void CopyDirectory(DirectoryInfo info) 150 150 { 151 //Check the the destination is not a subfolder of the source. 152 if (Shell.IsRootedAt(info, Destination)) 153 { 154 Logger.Log(S._("The destination directory cannot be within the source directory."), 155 LogLevel.Error); 156 return; 157 } 158 151 159 //We need to get the files from the list of streams 152 160 List<StreamInfo> streams = GetPaths(); -
trunk/eraser/Eraser.DefaultPlugins/Strings.en.resx
r2271 r2282 295 295 <value>Securely move {0}</value> 296 296 </data> 297 <data name="The destination directory cannot be within the source directory." xml:space="preserve"> 298 <value>The destination directory cannot be within the source directory.</value> 299 </data> 297 300 <data name="Securely moving files and folders..." xml:space="preserve"> 298 301 <value>Securely moving files and folders...</value> -
trunk/eraser/Eraser.DefaultPlugins/Strings.it.resx
r2271 r2282 295 295 <value>Spostamento sicuro di {0}</value> 296 296 </data> 297 <data name="The destination directory cannot be within the source directory." xml:space="preserve"> 298 <value>(Untranslated)</value> 299 </data> 297 300 <data name="Securely moving files and folders..." xml:space="preserve"> 298 301 <value>(Untranslated)</value> -
trunk/eraser/Eraser.DefaultPlugins/Strings.nl.resx
r2271 r2282 295 295 <value>(Untranslated)</value> 296 296 </data> 297 <data name="The destination directory cannot be within the source directory." xml:space="preserve"> 298 <value>(Untranslated)</value> 299 </data> 297 300 <data name="Securely moving files and folders..." xml:space="preserve"> 298 301 <value>(Untranslated)</value> -
trunk/eraser/Eraser.DefaultPlugins/Strings.pl.resx
r2271 r2282 295 295 <value>(Untranslated)</value> 296 296 </data> 297 <data name="The destination directory cannot be within the source directory." xml:space="preserve"> 298 <value>(Untranslated)</value> 299 </data> 297 300 <data name="Securely moving files and folders..." xml:space="preserve"> 298 301 <value>(Untranslated)</value> -
trunk/eraser/Eraser.DefaultPlugins/Strings.resx
r2271 r2282 295 295 <value>Securely move {0}</value> 296 296 </data> 297 <data name="The destination directory cannot be within the source directory." xml:space="preserve"> 298 <value>The destination directory cannot be within the source directory.</value> 299 </data> 297 300 <data name="Securely moving files and folders..." xml:space="preserve"> 298 301 <value>Securely moving files and folders...</value> -
trunk/eraser/Eraser.Util/Shell.cs
r2112 r2282 142 142 143 143 /// <summary> 144 /// Verifies if the path given is rooted at the given absolute path. 145 /// </summary> 146 /// <param name="absolutePath">The root path.</param> 147 /// <param name="path">The path to verify.</param> 148 /// <returns>True if the path provided is a subfolder/sub-file of the provided root path.</returns> 149 public static bool IsRootedAt(FileSystemInfo absolutePath, string path) 150 { 151 //Convert the path in question to an absolute path 152 if (!Path.IsPathRooted(path)) 153 path = Path.GetFullPath(path); 154 155 //Split the directory path to its component folders 156 string[] absoluteDirectories = absolutePath.FullName.Split( 157 Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 158 string[] relativeDirectories = path.Split( 159 Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 160 161 //Compare element by element; if the absolute path compares till the end, the 162 //provided path is a subdirectory 163 for (int i = 0; i < absoluteDirectories.Length; ++i) 164 if (absoluteDirectories[i] != relativeDirectories[i]) 165 return false; 166 167 return true; 168 } 169 170 /// <summary> 144 171 /// A List of known folder IDs in the shell namespace. 145 172 /// </summary>
Note: See TracChangeset
for help on using the changeset viewer.
