mirror of https://github.com/acidanthera/audk.git
Fix a spec conformance issue that "Attributes" should only be checked when OpenMode is Create.
(based on FatPkg commit 4a3fecc5dc09ff6da448ffcf57e6a24fbca442f9) [jordan.l.justen@intel.com: Use script to relicense to 2-clause BSD] Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Acked-by: Mark Doran <mark.doran@intel.com> Acked-by: Laszlo Ersek <lersek@redhat.com>
This commit is contained in:
parent
a12324d4fd
commit
5ff2f40e73
FatPkg/EnhancedFatDxe
|
@ -243,17 +243,12 @@ Returns:
|
||||||
default:
|
default:
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Check for valid attributes
|
// Check for valid Attributes for file creation case.
|
||||||
//
|
//
|
||||||
if (Attributes & (~EFI_FILE_VALID_ATTR)) {
|
if (((OpenMode & EFI_FILE_MODE_CREATE) != 0) && (Attributes & (EFI_FILE_READ_ONLY | (~EFI_FILE_VALID_ATTR))) != 0) {
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
}
|
|
||||||
//
|
|
||||||
// Can't open for create and apply the read only attribute
|
|
||||||
//
|
|
||||||
if ((OpenMode & EFI_FILE_MODE_CREATE) && (Attributes & EFI_FILE_READ_ONLY)) {
|
|
||||||
return EFI_INVALID_PARAMETER;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
IFile = IFILE_FROM_FHAND (FHand);
|
IFile = IFILE_FROM_FHAND (FHand);
|
||||||
|
|
Loading…
Reference in New Issue