VirtualBox

Changeset 6413 in vbox for trunk/src/VBox/HostServices


Ignore:
Timestamp:
Jan 21, 2008 2:59:19 PM (17 years ago)
Author:
vboxsync
Message:

more places to check if writing to a shared folder is allowed

File:
1 edited

Legend:

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

    r6402 r6413  
    11321132    Log(("vbsfWrite %RX64 offset %RX64 bytes %x\n", Handle, offset, *pcbBuffer));
    11331133
     1134    /* is the guest allowed to write to this share? */
     1135    bool fWritable;
     1136    rc = vbsfMappingsQueryWritable (pClient, root, &fWritable);
     1137    if (RT_FAILURE(rc) || !fWritable)
     1138        return VERR_WRITE_PROTECT;
     1139
    11341140    if (*pcbBuffer == 0)
    11351141        return VINF_SUCCESS; /** @todo correct? */
     
    14741480    }
    14751481
     1482    /* is the guest allowed to write to this share? */
     1483    bool fWritable;
     1484    rc = vbsfMappingsQueryWritable (pClient, root, &fWritable);
     1485    if (RT_FAILURE(rc) || !fWritable)
     1486        return VERR_WRITE_PROTECT;
     1487
     1488    rc = VINF_SUCCESS;
     1489
    14761490    *pcbBuffer  = 0;
    14771491    pSFDEntry   = (RTFSOBJINFO *)pBuffer;
     
    15781592        return VERR_INVALID_PARAMETER;
    15791593    }
     1594
     1595    /* is the guest allowed to write to this share? */
     1596    bool fWritable;
     1597    int rc = vbsfMappingsQueryWritable (pClient, root, &fWritable);
     1598    if (RT_FAILURE(rc) || !fWritable)
     1599        return VERR_WRITE_PROTECT;
     1600
    15801601    if (flags & SHFL_INFO_FILE)
    15811602        return vbsfSetFileInfo(pClient, root, Handle, flags, pcbBuffer, pBuffer);
Note: See TracChangeset for help on using the changeset viewer.

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