VirtualBox

Changeset 83250 in vbox for trunk/src


Ignore:
Timestamp:
Mar 10, 2020 4:59:51 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
136397
Message:

Guest Control/Update Additions: Check if the .ISO file can be opened as (valid) ISO 9660 volume, and if not, bail out gracefully.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/GuestSessionImplTasks.cpp

    r83248 r83250  
    22542254        RTVFSFILE hVfsFileIso;
    22552255        rc = RTVfsFileOpenNormal(mSource.c_str(), RTFILE_O_OPEN | RTFILE_O_READ | RTFILE_O_DENY_WRITE, &hVfsFileIso);
    2256         if (RT_SUCCESS(rc))
     2256        if (RT_FAILURE(rc))
     2257        {
     2258            hr = setProgressErrorMsg(VBOX_E_IPRT_ERROR,
     2259                                         Utf8StrFmt(GuestSession::tr("Unable to open Guest Additions .ISO file \"%s\": %Rrc"),
     2260                                         mSource.c_str(), rc));
     2261        }
     2262        else
    22572263        {
    22582264            RTVFS hVfsIso;
     
    22612267            {
    22622268                hr = setProgressErrorMsg(VBOX_E_IPRT_ERROR,
    2263                                          Utf8StrFmt(GuestSession::tr("Unable to open Guest Additions .ISO file \"%s\": %Rrc"),
    2264                                          mSource.c_str(), rc));
     2269                                         Utf8StrFmt(GuestSession::tr("Unable to open file as ISO 9660 file system volume: %Rrc"), rc));
    22652270            }
    22662271            else
     
    25562561            if (!mProgress.isNull()) /* Progress object is optional. */
    25572562            {
     2563#ifdef VBOX_STRICT
     2564                /* If we forgot to set the progress object accordingly, let us know. */
     2565                HRESULT rcProgress;
     2566                AssertMsg(   SUCCEEDED(mProgress->COMGETTER(ResultCode(&rcProgress)))
     2567                          && FAILED(rcProgress), ("Task indicated an error (%Rrc), but progress did not indicate this (%Rhrc)\n",
     2568                                                  rc, rcProgress));
     2569#endif
    25582570                com::ProgressErrorInfo errorInfo(mProgress);
    25592571                if (   errorInfo.isFullAvailable()
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