]> git.proxmox.com Git - mirror_edk2.git/blobdiff - SecurityPkg/VariableAuthenticated/RuntimeDxe/Variable.c
If setting variable in Runtime and there has been a same GUID and name variable exist...
[mirror_edk2.git] / SecurityPkg / VariableAuthenticated / RuntimeDxe / Variable.c
index 22ded16819077a34b5b1a7927fc751ca9c349a48..4c88eb6ff69a2007ecd9b67fa7e8ecea33256d3d 100644 (file)
@@ -720,7 +720,8 @@ Reclaim (
 \r
   @param[in]       VariableName        Name of the variable to be found\r
   @param[in]       VendorGuid          Vendor GUID to be found.\r
-  @param[in]       IgnoreRtAttribute   Ignore RUNTIME_ACCESS attribute when searching variable.\r
+  @param[in]       IgnoreRtCheck       Ignore EFI_VARIABLE_RUNTIME_ACCESS attribute\r
+                                       check at runtime when searching variable.\r
   @param[in, out]  PtrTrack            Variable Track Pointer structure that contains Variable Information.\r
 \r
   @retval          EFI_SUCCESS         Variable found successfully\r
@@ -730,7 +731,7 @@ EFI_STATUS
 FindVariableEx (\r
   IN     CHAR16                  *VariableName,\r
   IN     EFI_GUID                *VendorGuid,\r
-  IN     BOOLEAN                 IgnoreRtAttribute,\r
+  IN     BOOLEAN                 IgnoreRtCheck,\r
   IN OUT VARIABLE_POINTER_TRACK  *PtrTrack\r
   )\r
 {\r
@@ -749,7 +750,7 @@ FindVariableEx (
     if (PtrTrack->CurrPtr->State == VAR_ADDED ||\r
         PtrTrack->CurrPtr->State == (VAR_IN_DELETED_TRANSITION & VAR_ADDED)\r
        ) {\r
-      if (IgnoreRtAttribute || !AtRuntime () || ((PtrTrack->CurrPtr->Attributes & EFI_VARIABLE_RUNTIME_ACCESS) != 0)) {\r
+      if (IgnoreRtCheck || !AtRuntime () || ((PtrTrack->CurrPtr->Attributes & EFI_VARIABLE_RUNTIME_ACCESS) != 0)) {\r
         if (VariableName[0] == 0) {\r
           if (PtrTrack->CurrPtr->State == (VAR_IN_DELETED_TRANSITION & VAR_ADDED)) {\r
             InDeletedVariable   = PtrTrack->CurrPtr;\r
@@ -785,9 +786,9 @@ FindVariableEx (
   This code finds variable in storage blocks of volatile and non-volatile storage areas.\r
   If VariableName is an empty string, then we just return the first\r
   qualified variable without comparing VariableName and VendorGuid.\r
-  If IgnoreRtAttribute is TRUE, then we ignore the EFI_VARIABLE_RUNTIME_ACCESS Attribute\r
-  when searching existing variable, only VariableName and VendorGuid are compared.\r
-  Otherwise, variables with EFI_VARIABLE_RUNTIME_ACCESS are not visible at runtime.\r
+  If IgnoreRtCheck is TRUE, then we ignore the EFI_VARIABLE_RUNTIME_ACCESS attribute check\r
+  at runtime when searching existing variable, only VariableName and VendorGuid are compared.\r
+  Otherwise, variables without EFI_VARIABLE_RUNTIME_ACCESS are not visible at runtime.\r
 \r
   @param[in]   VariableName           Name of the variable to be found.\r
   @param[in]   VendorGuid             Vendor GUID to be found.\r
@@ -796,7 +797,8 @@ FindVariableEx (
   @param[in]   Global                 Pointer to VARIABLE_GLOBAL structure, including\r
                                       base of volatile variable storage area, base of\r
                                       NV variable storage area, and a lock.\r
-  @param[in]   IgnoreRtAttribute      Ignore RUNTIME_ACCESS attribute when searching variable.\r
+  @param[in]   IgnoreRtCheck          Ignore EFI_VARIABLE_RUNTIME_ACCESS attribute\r
+                                      check at runtime when searching variable.\r
 \r
   @retval EFI_INVALID_PARAMETER       If VariableName is not an empty string, while\r
                                       VendorGuid is NULL.\r
@@ -810,7 +812,7 @@ FindVariable (
   IN  EFI_GUID                *VendorGuid,\r
   OUT VARIABLE_POINTER_TRACK  *PtrTrack,\r
   IN  VARIABLE_GLOBAL         *Global,\r
-  IN  BOOLEAN                 IgnoreRtAttribute\r
+  IN  BOOLEAN                 IgnoreRtCheck\r
   )\r
 {\r
   EFI_STATUS              Status;\r
@@ -842,7 +844,7 @@ FindVariable (
     PtrTrack->EndPtr   = GetEndPointer   (VariableStoreHeader[Type]);\r
     PtrTrack->Volatile = (BOOLEAN) (Type == VariableStoreTypeVolatile);\r
 \r
-    Status = FindVariableEx (VariableName, VendorGuid, IgnoreRtAttribute, PtrTrack);\r
+    Status = FindVariableEx (VariableName, VendorGuid, IgnoreRtCheck, PtrTrack);\r
     if (!EFI_ERROR (Status)) {\r
       return Status;\r
     }\r