public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Gao, Liming" <liming.gao@intel.com>
To: "Bi, Dandan" <dandan.bi@intel.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Dong, Eric" <eric.dong@intel.com>
Subject: Re: [patch] MdeModulePkg/HiiDB: Handle the "&READONLY" tag in <KeywordResp> correctly
Date: Mon, 12 Sep 2016 02:29:28 +0000	[thread overview]
Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14B3E6C8D@shsmsx102.ccr.corp.intel.com> (raw)
In-Reply-To: <1473325798-24284-1-git-send-email-dandan.bi@intel.com>

Reviewed-by: Liming Gao <liming.gao@intel.com>

> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
> Dandan Bi
> Sent: Thursday, September 08, 2016 5:10 PM
> To: edk2-devel@lists.01.org
> Cc: Dong, Eric <eric.dong@intel.com>; Gao, Liming <liming.gao@intel.com>
> Subject: [edk2] [patch] MdeModulePkg/HiiDB: Handle the "&READONLY" tag
> in <KeywordResp> correctly
> 
> This patch is to fix the incorrect logic when handling the "&READONLY" tag
> in <KeywordResp>.
> 1. In UEFI spec, the "&READONLY" tag is in upper case, but using the lower
> case in current codes by mistake.
> 2. The logic in checking the ReadOnly flag is not correct. Whether having
> "&READONLY" tag must be consistent with the result of
> "ExtractReadOnlyFromOpCode" function.
> 
> Cc: Liming Gao <liming.gao@intel.com>
> Cc: Eric Dong <eric.dong@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Dandan Bi <dandan.bi@intel.com>
> ---
>  .../Universal/HiiDatabaseDxe/ConfigKeywordHandler.c     | 17
> +++++++++++++----
>  1 file changed, 13 insertions(+), 4 deletions(-)
> 
> diff --git
> a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c
> b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c
> index 6682319..10a901f 100644
> --- a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c
> +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c
> @@ -2905,15 +2905,15 @@ EfiConfigKeywordHandlerSetData (
>        goto Done;
>      }
>      StringPtr = NextStringPtr;
> 
>      //
> -    // 5. Find ReadOnly filter.
> +    // 5. Find READONLY tag.
>      //
> -    if ((StringPtr != NULL) && StrnCmp (StringPtr, L"&ReadOnly", StrLen
> (L"&ReadOnly")) == 0) {
> +    if ((StringPtr != NULL) && StrnCmp (StringPtr, L"&READONLY", StrLen
> (L"&READONLY")) == 0) {
>        ReadOnly = TRUE;
> -      StringPtr += StrLen (L"&ReadOnly");
> +      StringPtr += StrLen (L"&READONLY");
>      } else {
>        ReadOnly = FALSE;
>      }
> 
>      //
> @@ -2935,13 +2935,22 @@ EfiConfigKeywordHandlerSetData (
> 
>      //
>      // 8. Check the readonly flag.
>      //
>      if (ExtractReadOnlyFromOpCode (OpCode) != ReadOnly) {
> +      //
> +      // Extracting readonly flag form opcode and extracting "READONLY" tag
> form KeywordString should have the same results.
> +      // If not, the input KeywordString must be incorrect, return the error
> status to caller.
> +      //
> +      *ProgressErr = KEYWORD_HANDLER_INCOMPATIBLE_VALUE_DETECTED;
> +      Status = EFI_INVALID_PARAMETER;
> +      goto Done;
> +    }
> +    if (ReadOnly) {
>        *ProgressErr = KEYWORD_HANDLER_ACCESS_NOT_PERMITTED;
>        Status = EFI_ACCESS_DENIED;
> -      goto Done;
> +      goto Done;
>      }
> 
>      //
>      // 9. Merge to the MultiKeywordResp string.
>      //
> --
> 1.9.5.msysgit.1
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel


      parent reply	other threads:[~2016-09-12  2:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-08  9:09 [patch] MdeModulePkg/HiiDB: Handle the "&READONLY" tag in <KeywordResp> correctly Dandan Bi
2016-09-08  9:09 ` [patch] MdeModulePkg/UiApp: Fix incorrect question id Dandan Bi
2016-09-09  2:17   ` Dong, Eric
2016-09-12  2:35   ` Gao, Liming
2016-09-09  2:16 ` [patch] MdeModulePkg/HiiDB: Handle the "&READONLY" tag in <KeywordResp> correctly Dong, Eric
2016-09-12  2:29 ` Gao, Liming [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A89E2EF3DFEDB4C8BFDE51014F606A14B3E6C8D@shsmsx102.ccr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox