VirtualBox

Changeset 83534 in vbox for trunk/src


Ignore:
Timestamp:
Apr 3, 2020 3:41:58 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
136853
Message:

Guest Control/VBoxService: Strip truncation bit in vgsvcGstCtrlSessionHandleFileOpen() when opening in read-only mode. bugref:9320

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControlSession.cpp

    r83508 r83534  
    322322                {
    323323                    fFlags |= (uCreationMode << RTFILE_O_CREATE_MODE_SHIFT) & RTFILE_O_CREATE_MODE_MASK;
     324                    /* If we're opening a file in read-only mode, strip truncation mode.
     325                     * rtFileRecalcAndValidateFlags() will validate it anyway, but avoid asserting in debug builds. */
     326                    if (fFlags & RTFILE_O_READ)
     327                        fFlags &= ~RTFILE_O_TRUNCATE;
    324328                    rc = RTFileOpen(&pFile->hFile, pFile->szName, fFlags);
    325329                    if (RT_SUCCESS(rc))
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