]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ShellPkg: Fix rm CWD protection to be better at catching similarly named directories.
authorjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 20 Jan 2012 18:10:45 +0000 (18:10 +0000)
committerjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 20 Jan 2012 18:10:45 +0000 (18:10 +0000)
signed-off-by: jcarsey
reviewed-by: geekboy15a

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12950 6f19259b-4bc3-4df7-8a09-765794883524

ShellPkg/Library/UefiShellLevel2CommandsLib/Rm.c

index 32b7580103ff4641a1462b4040396fd5fd370372..d167b36fb4507eb1d5362832a17c04939cc41d1c 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Main file for attrib shell level 2 function.\r
 \r
-  Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -202,7 +202,10 @@ IsValidDeleteTarget(
   Size          = 0;\r
   Pattern       = StrnCatGrow(&Pattern     , NULL, TempLocation  , 0);\r
   SearchString  = StrnCatGrow(&SearchString, &Size, Node->FullName, 0);\r
-  SearchString  = StrnCatGrow(&SearchString, &Size, L"*", 0);\r
+  if (!EFI_ERROR(ShellIsDirectory(SearchString))) {\r
+    SearchString  = StrnCatGrow(&SearchString, &Size, L"\\", 0);\r
+    SearchString  = StrnCatGrow(&SearchString, &Size, L"*", 0);\r
+  }\r
 \r
   if (Pattern == NULL || SearchString == NULL) {\r
     RetVal = FALSE;\r