VirtualBox

Ticket #9276: vboxsf.patch

File vboxsf.patch, 1.3 KB (added by muf, 8 years ago)

shared folder: do not claim that the file was created if it existed already

  • src/VBox/HostServices/SharedFolders/vbsf.cpp

     
    481481            pParms->Result = SHFL_FILE_REPLACED;
    482482        }
    483483        if (   (   SHFL_CF_ACT_FAIL_IF_EXISTS
    484                 == BIT_FLAG(pParms->CreateFlags, SHFL_CF_ACT_MASK_IF_EXISTS))
    485             || (   SHFL_CF_ACT_CREATE_IF_NEW
    486                 == BIT_FLAG(pParms->CreateFlags, SHFL_CF_ACT_MASK_IF_NEW)))
     484                == BIT_FLAG(pParms->CreateFlags, SHFL_CF_ACT_MASK_IF_EXISTS)))
    487485        {
    488486            pParms->Result = SHFL_FILE_CREATED;
    489487        }
     
    515513            info.Attr.fMode |= 0111;
    516514#endif
    517515            vbfsCopyFsObjInfoFromIprt(&pParms->Info, &info);
     516
     517            /* If file is empty and create flag is set, assume we just created it */
     518            if (   (0 == info.cbObject)
     519                && (   SHFL_CF_ACT_CREATE_IF_NEW
     520                    == BIT_FLAG(pParms->CreateFlags, SHFL_CF_ACT_MASK_IF_NEW)))
     521            {
     522                pParms->Result = SHFL_FILE_CREATED;
     523            }
    518524        }
    519525    }
    520526    /* Free resources if any part of the function has failed. */

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy