summaryrefslogtreecommitdiff
path: root/FatPkg/EnhancedFatDxe
diff options
context:
space:
mode:
authorQing Huang <qing.huang@intel.com>2009-03-24 13:56:38 +0000
committerJordan Justen <jordan.l.justen@intel.com>2016-04-06 23:22:43 -0700
commit5ff2f40e73da66f7ccdaa68a51c876eca8ba24db (patch)
tree0c3d52453e255c40357b6b50aa364e87066e9317 /FatPkg/EnhancedFatDxe
parenta12324d4fda270d75b9913590f4f60fcb54a3727 (diff)
downloadedk2-platforms-5ff2f40e73da66f7ccdaa68a51c876eca8ba24db.tar.xz
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>
Diffstat (limited to 'FatPkg/EnhancedFatDxe')
-rw-r--r--FatPkg/EnhancedFatDxe/Open.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/FatPkg/EnhancedFatDxe/Open.c b/FatPkg/EnhancedFatDxe/Open.c
index b6369cf0b3..ae2aae530d 100644
--- a/FatPkg/EnhancedFatDxe/Open.c
+++ b/FatPkg/EnhancedFatDxe/Open.c
@@ -243,19 +243,14 @@ Returns:
default:
return EFI_INVALID_PARAMETER;
}
+
//
- // Check for valid attributes
+ // Check for valid Attributes for file creation case.
//
- if (Attributes & (~EFI_FILE_VALID_ATTR)) {
- 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;
+ if (((OpenMode & EFI_FILE_MODE_CREATE) != 0) && (Attributes & (EFI_FILE_READ_ONLY | (~EFI_FILE_VALID_ATTR))) != 0) {
+ return EFI_INVALID_PARAMETER;
}
-
+
IFile = IFILE_FROM_FHAND (FHand);
OFile = IFile->OFile;