From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id BDCA881D9C for ; Fri, 28 Oct 2016 08:20:06 -0700 (PDT) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga102.fm.intel.com with ESMTP; 28 Oct 2016 08:20:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,410,1473145200"; d="scan'208";a="24856064" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga005.fm.intel.com with ESMTP; 28 Oct 2016 08:20:05 -0700 Received: from fmsmsx114.amr.corp.intel.com (10.18.116.8) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.248.2; Fri, 28 Oct 2016 08:20:04 -0700 Received: from fmsmsx103.amr.corp.intel.com ([169.254.2.170]) by FMSMSX114.amr.corp.intel.com ([10.18.116.8]) with mapi id 14.03.0248.002; Fri, 28 Oct 2016 08:20:04 -0700 From: "Carsey, Jaben" To: Tim Lewis , "edk2-devel@lists.01.org" CC: "Carsey, Jaben" Thread-Topic: [shell] AliasLower never used in InternalSetAlias Thread-Index: AdIwlmPP8ooonpLXRf2RvwArhReYzQAAmqFgACVsmeA= Date: Fri, 28 Oct 2016 15:20:03 +0000 Message-ID: References: <7236196A5DF6C040855A6D96F556A53F3FD11D@msmail.insydesw.com.tw> <7236196A5DF6C040855A6D96F556A53F3FD173@msmail.insydesw.com.tw> In-Reply-To: <7236196A5DF6C040855A6D96F556A53F3FD173@msmail.insydesw.com.tw> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYTk1OWY5NmUtY2QxZC00NzVjLThiMzYtMmMwNWM3YmNhZjU0IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IjVQS0Z0ZTNheFwvWkhxSEdhTmhOQXFtT1NIWEJiSFB1cE1MUGhZQWg3ZDRNPSJ9 x-ctpclassification: CTP_IC x-originating-ip: [10.1.200.107] MIME-Version: 1.0 Subject: Re: [shell] AliasLower never used in InternalSetAlias X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Oct 2016 15:20:06 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Tim, Given that all commands are case insensitive, I couldn't imagine why we wou= ld want case-sensitive alias. Do we really want "Dir" to fail, while "dir" works fine? Remember that the= real command is case insensitive "ls" in either case. -Jaben > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > Tim Lewis > Sent: Thursday, October 27, 2016 2:29 PM > To: Tim Lewis ; edk2-devel@lists.01.org > Subject: Re: [edk2] [shell] AliasLower never used in InternalSetAlias > Importance: High >=20 > I would also note that GetAlias() has similar logic, but does, in fact us= e the > AliasLower. As far as I can tell, the specification does not say anything= about > case-insensitive, so I believe this to be in error. >=20 > Tim >=20 > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > Tim Lewis > Sent: Thursday, October 27, 2016 2:11 PM > To: edk2-devel@lists.01.org > Subject: [edk2] [shell] AliasLower never used in InternalSetAlias >=20 > In the function InternalSetAlias, it appears that AliasLower is duplicate= d > (fromAlias), converted to lower case and freed ,but never actually used. = Am I > missing something? >=20 > // Convert to lowercase to make aliases case-insensitive > if (Alias !=3D NULL) { > AliasLower =3D AllocateCopyPool (StrSize (Alias), Alias); > if (AliasLower =3D=3D NULL) { > return EFI_OUT_OF_RESOURCES; > } > ToLower (AliasLower); > } else { > AliasLower =3D NULL; > } >=20 > // > // We must be trying to remove one if Alias is NULL > // > if (Alias =3D=3D NULL) { > // > // remove an alias (but passed in COMMAND parameter) > // > Status =3D (gRT->SetVariable((CHAR16*)Command, &gShellAliasGuid, 0, 0= , > NULL)); > } else { > // > // Add and replace are the same > // >=20 > // We dont check the error return on purpose since the variable may n= ot > exist. > gRT->SetVariable((CHAR16*)Command, &gShellAliasGuid, 0, 0, NULL); >=20 > Status =3D (gRT->SetVariable((CHAR16*)Alias, &gShellAliasGuid, > EFI_VARIABLE_BOOTSERVICE_ACCESS|(Volatile?0:EFI_VARIABLE_NON_VOL > ATILE), StrSize(Command), (VOID*)Command)); > } >=20 > if (Alias !=3D NULL) { > FreePool (AliasLower); > } > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel