VirtualBox

Changeset 99424 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Apr 17, 2023 3:20:42 PM (2 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
156878
Message:

Main/NvramStore: Don't return VINF_SUCCESS for too large files. Get more error info from RTEfiVarStoreOpenAsVfs. bugref:10098

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-all/NvramStoreImpl.cpp

    r99417 r99424  
    745745                        {
    746746                            /* Try to parse it as an EFI variable store. */
     747                            RTERRINFOSTATIC ErrInfo;
    747748                            RTVFS hVfsEfiVarStore;
    748                             vrc = RTEfiVarStoreOpenAsVfs(hVfsFileNvram, RTVFSMNT_F_READ_ONLY, 0 /*fVarStoreFlags*/, &hVfsEfiVarStore,
    749                                                          NULL /*pErrInfo*/);
     749                            vrc = RTEfiVarStoreOpenAsVfs(hVfsFileNvram, RTVFSMNT_F_READ_ONLY, 0 /*fVarStoreFlags*/,
     750                                                         &hVfsEfiVarStore, RTErrInfoInitStatic(&ErrInfo));
    750751                            if (RT_SUCCESS(vrc))
    751752                            {
     
    779780                            }
    780781                            else
    781                                 LogRel(("Opening the UEFI variable store '%s' failed with %Rrc\n", pszPath, vrc));
     782                                LogRel(("Opening the UEFI variable store '%s' failed with %Rrc%RTeim\n", pszPath, vrc, &ErrInfo.Core));
    782783
    783784                            RTVfsFileRelease(hVfsFileNvram);
     
    799800        }
    800801        else
     802        {
    801803            LogRelMax(10, ("NVRAM store '%s' exceeds limit of %u bytes, actual size is %u\n",
    802804                           pszPath, _1M, cbStore));
     805            vrc = VERR_OUT_OF_RANGE;
     806        }
    803807    }
    804808    else if (vrc == VERR_FILE_NOT_FOUND) /* Valid for the first run where no NVRAM file is there. */
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette