VirtualBox

Ignore:
Timestamp:
Dec 15, 2011 2:01:33 PM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
75423
Message:

symlinks: small fixes

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

Legend:

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

    r39627 r39628  
    244244            else
    245245            {
    246                 pszFolderName = (char*)RTStrAlloc(cbFolderName);
     246                pszFolderName = (char*)RTStrAlloc(cbFolderName + 1);
    247247                AssertReturn(pszFolderName, VERR_NO_MEMORY);
    248248
    249                 rc = SSMR3GetStrZ(pSSM, mapping.pszFolderName, cbFolderName);
     249                rc = SSMR3GetStrZ(pSSM, pszFolderName, cbFolderName + 1);
    250250                AssertRCReturn(rc, rc);
    251251                mapping.pszFolderName = pszFolderName;
  • trunk/src/VBox/HostServices/SharedFolders/vbsf.cpp

    r39627 r39628  
    4242#endif
    4343
    44 // never follow symbolic links */
    45 //#define SHFL_RT_LINK(pClient) ((pClient)->fu32Flags & SHFL_CF_SYMLINKS ? RTPATH_F_ON_LINK : RTPATH_F_FOLLOW_LINK)
    46 #define SHFL_RT_LINK(pClient) (RTPATH_F_ON_LINK)
    4744
    4845/**
     
    139136    strcat(pDirEntry->szName, szWildCard);
    140137
    141     rc = RTDirOpenFiltered(&hSearch, pDirEntry->szName, RTDIRFILTER_WINNT, RTDIROPENFILTERED_FLAGS_NO_SYMLINKS);
     138    rc = RTDirOpenFiltered(&hSearch, pDirEntry->szName, RTDIRFILTER_WINNT, RTDIROPEN_FLAGS_NO_SYMLINKS);
    142139    *(pszStartComponent-1) = RTPATH_DELIMITER;
    143140    if (RT_FAILURE(rc))
     
    148145        size_t cbDirEntrySize = cbDirEntry;
    149146
    150         rc = RTDirReadEx(hSearch, pDirEntry, &cbDirEntrySize, RTFSOBJATTRADD_NOTHING, SHFL_RT_LINK(pClient));
     147        rc = RTDirReadEx(hSearch, pDirEntry, &cbDirEntrySize, RTFSOBJATTRADD_NOTHING, RTPATH_F_ON_LINK);
    151148        if (rc == VERR_NO_MORE_FILES)
    152149            break;
     
    426423    if (RT_SUCCESS(rc))
    427424    {
    428         /* When the host file system is case sensitive and the guest expects a case insensitive fs, then problems can occur */
     425        /* When the host file system is case sensitive and the guest expects
     426         * a case insensitive fs, then problems can occur */
    429427        if (     vbsfIsHostMappingCaseSensitive(root)
    430428            &&  !vbsfIsGuestMappingCaseSensitive(root))
     
    435433            if (fWildCard || fPreserveLastComponent)
    436434            {
    437                 /* strip off the last path component, that has to be preserved: contains the wildcard(s) or a 'rename' target. */
     435                /* strip off the last path component, that has to be preserved:
     436                 * contains the wildcard(s) or a 'rename' target. */
    438437                size_t cb = strlen(pszFullPath);
    439438                char *pszSrc = pszFullPath + cb - 1;
     
    470469
    471470            /** @todo don't check when creating files or directories; waste of time */
    472             rc = RTPathQueryInfoEx(pszFullPath, &info, RTFSOBJATTRADD_NOTHING, SHFL_RT_LINK(pClient));
     471            rc = RTPathQueryInfoEx(pszFullPath, &info, RTFSOBJATTRADD_NOTHING, RTPATH_F_ON_LINK);
    473472            if (rc == VERR_FILE_NOT_FOUND || rc == VERR_PATH_NOT_FOUND)
    474473            {
     
    484483                    {
    485484                        *pszSrc = 0;
    486                         rc = RTPathQueryInfoEx(pszFullPath, &info, RTFSOBJATTRADD_NOTHING, SHFL_RT_LINK(pClient));
     485                        rc = RTPathQueryInfoEx(pszFullPath, &info, RTFSOBJATTRADD_NOTHING, RTPATH_F_ON_LINK);
    487486                        *pszSrc = RTPATH_DELIMITER;
    488487                        if (rc == VINF_SUCCESS)
     
    520519                            fEndOfString = false;
    521520                            *pszEnd = 0;
    522                             rc = RTPathQueryInfoEx(pszSrc, &info, RTFSOBJATTRADD_NOTHING, SHFL_RT_LINK(pClient));
     521                            rc = RTPathQueryInfoEx(pszSrc, &info, RTFSOBJATTRADD_NOTHING, RTPATH_F_ON_LINK);
    523522                            Assert(rc == VINF_SUCCESS || rc == VERR_FILE_NOT_FOUND || rc == VERR_PATH_NOT_FOUND);
    524523                        }
     
    860859
    861860            /** @todo Possible race left here. */
    862             if (RT_SUCCESS(RTPathQueryInfoEx(pszPath, &info, RTFSOBJATTRADD_NOTHING, SHFL_RT_LINK(pClient))))
     861            if (RT_SUCCESS(RTPathQueryInfoEx(pszPath, &info, RTFSOBJATTRADD_NOTHING, RTPATH_F_ON_LINK)))
    863862            {
    864863#ifdef RT_OS_WINDOWS
     
    10321031            /* Open the directory now */
    10331032            rc = RTDirOpenFiltered(&pHandle->dir.Handle, pszPath,
    1034                                    RTDIRFILTER_NONE, RTDIROPENFILTERED_FLAGS_NO_SYMLINKS);
     1033                                   RTDIRFILTER_NONE, RTDIROPEN_FLAGS_NO_SYMLINKS);
    10351034            if (RT_SUCCESS(rc))
    10361035            {
     
    11351134    int rc;
    11361135
    1137     rc = RTPathQueryInfoEx(pszPath, &info, RTFSOBJATTRADD_NOTHING, SHFL_RT_LINK(pClient));
     1136    rc = RTPathQueryInfoEx(pszPath, &info, RTFSOBJATTRADD_NOTHING, RTPATH_F_ON_LINK);
    11381137    LogFlow(("SHFL_CF_LOOKUP\n"));
    11391138    /* Client just wants to know if the object exists. */
     
    12411240            RTFSOBJINFO info;
    12421241
    1243             rc = RTPathQueryInfoEx(pszFullPath, &info, RTFSOBJATTRADD_NOTHING, SHFL_RT_LINK(pClient));
     1242            rc = RTPathQueryInfoEx(pszFullPath, &info, RTFSOBJATTRADD_NOTHING, RTPATH_F_ON_LINK);
    12441243            LogFlow(("RTPathQueryInfoEx returned %Rrc\n", rc));
    12451244
     
    15471546            {
    15481547                rc = RTDirOpenFiltered(&pHandle->dir.SearchHandle, pszFullPath,
    1549                                        RTDIRFILTER_WINNT, RTDIROPENFILTERED_FLAGS_NO_SYMLINKS);
     1548                                       RTDIRFILTER_WINNT, RTDIROPEN_FLAGS_NO_SYMLINKS);
    15501549
    15511550                /* free the path string */
     
    15761575            pDirEntry = pDirEntryOrg;
    15771576
    1578             rc = RTDirReadEx(DirHandle, pDirEntry, &cbDirEntrySize, RTFSOBJATTRADD_NOTHING, SHFL_RT_LINK(pClient));
     1577            rc = RTDirReadEx(DirHandle, pDirEntry, &cbDirEntrySize, RTFSOBJATTRADD_NOTHING, RTPATH_F_ON_LINK);
    15791578            if (rc == VERR_NO_MORE_FILES)
    15801579            {
     
    22952294    {
    22962295        RTFSOBJINFO info;
    2297         rc = RTPathQueryInfoEx(pszFullNewPath, &info, RTFSOBJATTRADD_NOTHING, SHFL_RT_LINK(pClient));
     2296        rc = RTPathQueryInfoEx(pszFullNewPath, &info, RTFSOBJATTRADD_NOTHING, RTPATH_F_ON_LINK);
    22982297        if (RT_SUCCESS(rc))
    22992298            vbfsCopyFsObjInfoFromIprt(pInfo, &info);
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