VirtualBox

Ignore:
Timestamp:
Jun 4, 2009 3:18:47 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
48179
Message:

Corrected write-protected check for opening a file on shared folders (xTracker #3940)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/SharedFolders/vbsf.cpp

    r20279 r20292  
    12541254            rc = VINF_SUCCESS;
    12551255
    1256             /* write access requested? */
    1257             if (pParms->CreateFlags & (  SHFL_CF_ACT_REPLACE_IF_EXISTS
    1258                                        | SHFL_CF_ACT_OVERWRITE_IF_EXISTS
    1259                                        | SHFL_CF_ACT_CREATE_IF_NEW
    1260                                        | SHFL_CF_ACCESS_WRITE))
     1256            /* Note: do not check the SHFL_CF_ACCESS_WRITE here, only check if the open operation
     1257             * will cause changes.
     1258             *
     1259             * Actual operations (write, set attr, etc), which can write to a shared folder, have
     1260             * the check and will return VERR_WRITE_PROTECT if the folder is not writable.
     1261             */
     1262            if (   (pParms->CreateFlags & SHFL_CF_ACT_MASK_IF_EXISTS) == SHFL_CF_ACT_REPLACE_IF_EXISTS
     1263                || (pParms->CreateFlags & SHFL_CF_ACT_MASK_IF_EXISTS) == SHFL_CF_ACT_OVERWRITE_IF_EXISTS
     1264                || (pParms->CreateFlags & SHFL_CF_ACT_MASK_IF_NEW) == SHFL_CF_ACT_CREATE_IF_NEW
     1265               )
    12611266            {
    12621267                /* is the guest allowed to write to this share? */
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