VirtualBox

Changeset 100463 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jul 10, 2023 2:36:27 PM (17 months ago)
Author:
vboxsync
Message:

Shared Clipboard: Bugfixes for shClTransferResolvePathAbs(). bugref:9437

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/SharedClipboard/clipboard-transfers-provider-local.cpp

    r100427 r100463  
    130130 * @param   pTransfer           Clipboard transfer to resolve path for.
    131131 * @param   pszPath             Relative path to resolve.
     132 *                              Paths have to end with a (back-)slash, otherwise this is considered to be a file.
    132133 * @param   fFlags              Resolve flags. Currently not used and must be 0.
    133134 * @param   ppszResolved        Where to store the allocated resolved path. Must be free'd by the called using RTStrFree().
     
    136137                                      char **ppszResolved)
    137138{
    138     AssertPtrReturn(pTransfer,   VERR_INVALID_POINTER);
    139     AssertPtrReturn(pszPath,     VERR_INVALID_POINTER);
    140     AssertReturn   (fFlags == 0, VERR_INVALID_PARAMETER);
    141 
    142     LogFlowFunc(("pszPathRootAbs=%s, pszPath=%s\n", pTransfer->pszPathRootAbs, pszPath));
     139    AssertPtrReturn(pTransfer,    VERR_INVALID_POINTER);
     140    AssertPtrReturn(pszPath,      VERR_INVALID_POINTER);
     141    AssertReturn   (fFlags == 0,  VERR_INVALID_PARAMETER);
     142    AssertPtrReturn(ppszResolved, VERR_INVALID_POINTER);
     143
     144    LogFlowFunc(("pszPath=%s, fFlags=%#x (pszPathRootAbs=%s, cRootListEntries=%RU64)\n",
     145                 pszPath, fFlags, pTransfer->pszPathRootAbs, pTransfer->lstRoots.Hdr.cEntries));
    143146
    144147    int rc = ShClTransferValidatePath(pszPath, false /* fMustExist */);
     
    147150        rc = VERR_PATH_NOT_FOUND; /* Play safe by default. */
    148151
    149         /* Make sure the given path is part of the set of root entries. */
    150152        PSHCLLISTENTRY pEntry;
    151153        RTListForEach(&pTransfer->lstRoots.lstEntries, pEntry, SHCLLISTENTRY, Node)
     
    153155            LogFlowFunc(("\tpEntry->pszName=%s\n", pEntry->pszName));
    154156
    155             if (!RTStrCmp(pszPath, pEntry->pszName)) /* Case-sensitive! */
     157            if (RTStrStartsWith(pszPath, pEntry->pszName)) /* Case-sensitive! */
    156158            {
    157159                rc = VINF_SUCCESS;
     
    174176                if (RT_SUCCESS(rc))
    175177                {
    176                     LogFlowFunc(("pszResolved=%s\n", szResolved));
    177 
    178                     if (RT_SUCCESS(rc))
    179                         *ppszResolved = RTStrDup(szResolved);
     178                    LogRel2(("Shared Clipboard: Resolved: '%s' -> '%s'\n", pszPath, szResolved));
     179
     180                    *ppszResolved = RTStrDup(szResolved);
    180181                }
    181182            }
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