}\r
\r
//\r
- // Not support authenticated variable write yet.\r
+ // Not support authenticated or append variable write yet.\r
//\r
- if ((Attributes & EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS) != 0) {\r
+ if ((Attributes & (EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS | EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS | EFI_VARIABLE_APPEND_WRITE)) != 0) {\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
Status = EFI_WRITE_PROTECTED;\r
goto Done;\r
}\r
+ if (Attributes != 0 && Attributes != Variable.CurrPtr->Attributes) {\r
+ //\r
+ // If a preexisting variable is rewritten with different attributes, SetVariable() shall not\r
+ // modify the variable and shall return EFI_INVALID_PARAMETER. Two exceptions to this rule:\r
+ // 1. No access attributes specified\r
+ // 2. The only attribute differing is EFI_VARIABLE_APPEND_WRITE\r
+ //\r
+ Status = EFI_INVALID_PARAMETER;\r
+ goto Done;\r
+ }\r
}\r
\r
//\r
Status = EFI_WRITE_PROTECTED;\r
goto Done;\r
}\r
+ if (Attributes != 0 && (Attributes & (~EFI_VARIABLE_APPEND_WRITE)) != Variable.CurrPtr->Attributes) {\r
+ //\r
+ // If a preexisting variable is rewritten with different attributes, SetVariable() shall not\r
+ // modify the variable and shall return EFI_INVALID_PARAMETER. Two exceptions to this rule:\r
+ // 1. No access attributes specified\r
+ // 2. The only attribute differing is EFI_VARIABLE_APPEND_WRITE\r
+ //\r
+ Status = EFI_INVALID_PARAMETER;\r
+ goto Done;\r
+ }\r
}\r
\r
//\r