From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.115; helo=mga14.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (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 4713F2116371C for ; Mon, 8 Oct 2018 07:53:48 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Oct 2018 07:53:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,357,1534834800"; d="scan'208";a="95643760" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga004.fm.intel.com with ESMTP; 08 Oct 2018 07:53:48 -0700 Received: from FMSMSX109.amr.corp.intel.com (10.18.116.9) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 8 Oct 2018 07:53:47 -0700 Received: from fmsmsx103.amr.corp.intel.com ([169.254.2.16]) by FMSMSX109.amr.corp.intel.com ([169.254.15.83]) with mapi id 14.03.0319.002; Mon, 8 Oct 2018 07:53:47 -0700 From: "Carsey, Jaben" To: "Jim.Dailey@dell.com" , "edk2-devel@lists.01.org" CC: "Ni, Ruiyu" Thread-Topic: [edk2] [PATCH] ShellPkg-Cd: Ensure all valid cd targets are handled properly Thread-Index: AdRcAZkM3S8vkLe6QbG68xObBxlwuADFRGNg Date: Mon, 8 Oct 2018 14:53:46 +0000 Message-ID: References: <7c3028cd2495469badb355a79423080e@ausx13mps335.AMER.DELL.COM> In-Reply-To: <7c3028cd2495469badb355a79423080e@ausx13mps335.AMER.DELL.COM> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNDAyMzg5YjktZDAyNy00MzZhLWI0YzItYzI0ZTkwZTQ5MWFiIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiUTAxblJaa0VPM3FMcXdUV2lWT2NpOHYrUTIwT1dpYU1Kc3JTTXRqXC9VaGhBU0YrSnp4MmdlV3dFMmZMRys4em8ifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.1.200.107] MIME-Version: 1.0 Subject: Re: [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: Mon, 08 Oct 2018 14:53:48 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Seems good to me. Any thoughts Ray? Reviewed-by: Jaben Carsey > -----Original Message----- > From: Jim.Dailey@dell.com [mailto:Jim.Dailey@dell.com] > Sent: Thursday, October 04, 2018 9:47 AM > To: edk2-devel@lists.01.org > Cc: Carsey, Jaben ; Ni, Ruiyu > Subject: [edk2] [PATCH] ShellPkg-Cd: Ensure all valid cd targets are hand= led > properly > Importance: High >=20 > ShellPkg-Cd: Ensure all valid cd targets are handled properly >=20 > Make sure that PathCleanUpDirectories() is called on all valid targets > of the cd command. >=20 > 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(-) >=20 > diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Cd.c > b/ShellPkg/Library/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 = BSD > License > which accompanies this distribution. The full text of the license may= be > 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), Param1= Copy); >=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 > -- > 2.17.0.windows.1