VirtualBox

Ignore:
Timestamp:
Sep 16, 2015 12:15:31 PM (9 years ago)
Author:
vboxsync
Message:

SharedFolders: options for guest to host path conversion.

Location:
trunk/src/VBox/HostServices/SharedFolders
Files:
3 edited

Legend:

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

    r57457 r57782  
    115115    char *pszHostPath = NULL;
    116116    uint32_t fu32PathFlags = 0;
     117    uint32_t fu32Options =   VBSF_O_PATH_CHECK_ROOT_ESCAPE
     118                           | (fWildCard? VBSF_O_PATH_WILDCARD: 0)
     119                           | (fPreserveLastComponent? VBSF_O_PATH_PRESERVE_LAST_COMPONENT: 0);
     120
    117121    int rc = vbsfPathGuestToHost(pClient, root, pPath, cbPath,
    118                                  &pszHostPath, pcbFullPathRoot, fWildCard, fPreserveLastComponent, &fu32PathFlags);
     122                                 &pszHostPath, pcbFullPathRoot, fu32Options, &fu32PathFlags);
    119123    if (BIT_FLAG(pClient->fu32Flags, SHFL_CF_UTF8))
    120124    {
     
    18741878
    18751879    /* Verify that the link target can be a valid host path, i.e. does not contain invalid characters. */
    1876     rc = vbsfBuildFullPath(pClient, root, pOldPath, pOldPath->u16Size + SHFLSTRING_HEADER_SIZE, &pszFullOldPath, NULL);
     1880    uint32_t fu32PathFlags = 0;
     1881    uint32_t fu32Options = 0;
     1882    rc = vbsfPathGuestToHost(pClient, root, pOldPath, pOldPath->u16Size + SHFLSTRING_HEADER_SIZE,
     1883                             &pszFullOldPath, NULL, fu32Options, &fu32PathFlags);
    18771884    if (RT_FAILURE(rc))
    18781885    {
  • trunk/src/VBox/HostServices/SharedFolders/vbsfpath.cpp

    r56964 r57782  
    499499                        PSHFLSTRING pGuestString, uint32_t cbGuestString,
    500500                        char **ppszHostPath, uint32_t *pcbHostPathRoot,
    501                         bool fWildCard, bool fPreserveLastComponent,
     501                        uint32_t fu32Options,
    502502                        uint32_t *pfu32PathFlags)
    503503{
     
    688688
    689689                /* Check the appended path for root escapes. */
    690                 rc = vbsfPathCheckRootEscape(&pszFullPath[cbRootLen]);
     690                if (fu32Options & VBSF_O_PATH_CHECK_ROOT_ESCAPE)
     691                {
     692                    rc = vbsfPathCheckRootEscape(&pszFullPath[cbRootLen]);
     693                }
    691694                if (RT_SUCCESS(rc))
    692695                {
     
    698701                        && !vbsfIsGuestMappingCaseSensitive(hRoot))
    699702                    {
     703                        bool fWildCard = RT_BOOL(fu32Options & VBSF_O_PATH_WILDCARD);
     704                        bool fPreserveLastComponent = RT_BOOL(fu32Options & VBSF_O_PATH_PRESERVE_LAST_COMPONENT);
    700705                        rc = vbsfCorrectPathCasing(pClient, pszFullPath, cbFullPathLength, fWildCard, fPreserveLastComponent);
    701706                    }
  • trunk/src/VBox/HostServices/SharedFolders/vbsfpath.h

    r57358 r57782  
    2222#include <VBox/shflsvc.h>
    2323
     24#define VBSF_O_PATH_WILDCARD                UINT32_C(0x00000001)
     25#define VBSF_O_PATH_PRESERVE_LAST_COMPONENT UINT32_C(0x00000002)
     26#define VBSF_O_PATH_CHECK_ROOT_ESCAPE       UINT32_C(0x00000004)
     27
    2428#define VBSF_F_PATH_HAS_WILDCARD_IN_PREFIX UINT32_C(0x00000001) /* A component before the last one contains a wildcard. */
    2529#define VBSF_F_PATH_HAS_WILDCARD_IN_LAST   UINT32_C(0x00000002) /* The last component contains a wildcard. */
     
    4347                        PSHFLSTRING pGuestString, uint32_t cbGuestString,
    4448                        char **ppszHostPath, uint32_t *pcbHostPathRoot,
    45                         bool fWildCard, bool fPreserveLastComponent,
     49                        uint32_t fu32Options,
    4650                        uint32_t *pfu32PathFlags);
    4751
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