From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=68.232.153.90; helo=esa1.dell-outbound.iphmx.com; envelope-from=jim.dailey@dell.com; receiver=edk2-devel@lists.01.org Received: from esa1.dell-outbound.iphmx.com (esa1.dell-outbound.iphmx.com [68.232.153.90]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 6107C2194D3B8 for ; Thu, 4 Oct 2018 09:47:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=dell.com; i=@dell.com; q=dns/txt; s=smtpout; t=1538671664; x=1570207664; h=from:to:cc:subject:date:message-id: content-transfer-encoding:mime-version; bh=MNJO/Lqby5eRJxlZ/jWxsbR3cxuSzgaG23Osgbxxgu4=; b=nVBsQ9lR4393F7w00CzZRpZoqhi0RN3qg06jp/j3uFa4v3TTawrHXyMW QgaJ8RKDwRGzeTL7TEouVfDWNpfkAm1a5ijyWeFfvJc+6bhDYC2YccDVG zEbQIjfW9XbajhHahOYi0e5Qp9KbgzrHuqGG9IgA6RDR0NMcGUPJpn3NY Y=; X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2EaAAAUQ7ZbhyeV50NbHAEBAQQBAQc?= =?us-ascii?q?EAQGBUQcBAQsBg2ooCot/X4tBmGoUgWYLAQGEbIQoITQNDQEDAQECAQECAQE?= =?us-ascii?q?CEAEBARUJCCkvgjYigmUWKD8SAT5oAQQOBQgagn+CAplpiVcBAQGCG4oUig+?= =?us-ascii?q?BHYIXgRKCZIRxgQiFCwKIOBqFV48uBwKOHYIbH49rkn+COQIEAgQFAhSBQje?= =?us-ascii?q?BV3CDPIIzjiFvjCqBHwEB?= X-IPAS-Result: =?us-ascii?q?A2EaAAAUQ7ZbhyeV50NbHAEBAQQBAQcEAQGBUQcBAQsBg?= =?us-ascii?q?2ooCot/X4tBmGoUgWYLAQGEbIQoITQNDQEDAQECAQECAQECEAEBARUJCCkvg?= =?us-ascii?q?jYigmUWKD8SAT5oAQQOBQgagn+CAplpiVcBAQGCG4oUig+BHYIXgRKCZIRxg?= =?us-ascii?q?QiFCwKIOBqFV48uBwKOHYIbH49rkn+COQIEAgQFAhSBQjeBV3CDPIIzjiFvj?= =?us-ascii?q?CqBHwEB?= Received: from mx0a-00154901.pphosted.com ([67.231.149.39]) by esa1.dell-outbound.iphmx.com with ESMTP/TLS/AES256-SHA256; 04 Oct 2018 11:47:43 -0500 Received: from pps.filterd (m0142693.ppops.net [127.0.0.1]) by mx0a-00154901.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w94GhpTb167419 for ; Thu, 4 Oct 2018 12:47:58 -0400 Received: from esa1.dell-outbound2.iphmx.com (esa1.dell-outbound2.iphmx.com [68.232.153.201]) by mx0a-00154901.pphosted.com with ESMTP id 2mwd7uu99y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 04 Oct 2018 12:47:58 -0400 From: Received: from ausxippc110.us.dell.com ([143.166.85.200]) by esa1.dell-outbound2.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA256; 04 Oct 2018 22:47:24 +0600 X-LoopCount0: from 10.166.136.213 X-IronPort-AV: E=Sophos;i="5.54,340,1534827600"; d="scan'208";a="711080069" To: CC: , Thread-Topic: [edk2] [PATCH] ShellPkg-Cd: Ensure all valid cd targets are handled properly Thread-Index: AdRcAZkM3S8vkLe6QbG68xObBxlwuA== Date: Thu, 4 Oct 2018 16:46:39 +0000 Message-ID: <7c3028cd2495469badb355a79423080e@ausx13mps335.AMER.DELL.COM> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_17cb76b2-10b8-4fe1-93d4-2202842406cd_Enabled=True; MSIP_Label_17cb76b2-10b8-4fe1-93d4-2202842406cd_SiteId=945c199a-83a2-4e80-9f8c-5a91be5752dd; MSIP_Label_17cb76b2-10b8-4fe1-93d4-2202842406cd_Owner=Jim_Dailey@Dell.com; MSIP_Label_17cb76b2-10b8-4fe1-93d4-2202842406cd_SetDate=2018-10-04T16:43:01.4354680Z; MSIP_Label_17cb76b2-10b8-4fe1-93d4-2202842406cd_Name=External Public; MSIP_Label_17cb76b2-10b8-4fe1-93d4-2202842406cd_Application=Microsoft Azure Information Protection; MSIP_Label_17cb76b2-10b8-4fe1-93d4-2202842406cd_Extended_MSFT_Method=Manual; Sensitivity=External Public x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.143.242.75] MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-10-04_06:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=709 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1810040155 Subject: [PATCH] ShellPkg-Cd: Ensure all valid cd targets are handled properly X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Oct 2018 16:47:59 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable ShellPkg-Cd: Ensure all valid cd targets are handled properly Make sure that PathCleanUpDirectories() is called on all valid targets of the cd command. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jim Dailey --- ShellPkg/Library/UefiShellLevel2CommandsLib/Cd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Cd.c b/ShellPkg/Li= brary/UefiShellLevel2CommandsLib/Cd.c index 79dd2096f4..1eb7056aee 100644 --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Cd.c +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Cd.c @@ -4,6 +4,7 @@ (C) Copyright 2016 Hewlett Packard Enterprise Development LP
(C) Copyright 2015 Hewlett-Packard Development Company, L.P.
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
+ Copyright (c) 2018, Dell Technologies. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License which accompanies this distribution. The full text of the license may b= e found at @@ -261,9 +262,6 @@ ShellCommandRunCd ( =20 if (Param1Copy !=3D NULL && IsCurrentFileSystem (Param1Copy, Cwd))= { Status =3D ReplaceDriveWithCwd (&Param1Copy,Cwd); - if (!EFI_ERROR (Status)) { - Param1Copy =3D PathCleanUpDirectories (Param1Copy); - } } else { // // Can't use cd command to change filesystem. @@ -302,13 +300,15 @@ ShellCommandRunCd ( StrCatS (TempBuffer, TotalSize / sizeof (CHAR16), Param1Co= py); =20 FreePool (Param1Copy); - Param1Copy =3D PathCleanUpDirectories (TempBuffer); + Param1Copy =3D TempBuffer; + TempBuffer =3D NULL; } } } } =20 if (!EFI_ERROR(Status)) { + Param1Copy =3D PathCleanUpDirectories (Param1Copy); Status =3D ExtractDriveAndPath (Param1Copy, &Drive, &Path); } =20 --=20 2.17.0.windows.1