VirtualBox

忽略:
時間撮記:
2011-1-11 下午12:53:42 (14 年 以前)
作者:
vboxsync
訊息:

HostServices/Shared Folders: fixed parameter parsing for symlinks, fixes 32/64-bit issue (thanks Brian Campbell!)

位置:
trunk/src/VBox/HostServices/SharedFolders
檔案:
修改 3 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/HostServices/SharedFolders/service.cpp

    r35346 r35482  
    11691169                rc = VERR_INVALID_PARAMETER;
    11701170            }
    1171             else
    1172             if (   paParms[0].type != VBOX_HGCM_SVC_PARM_32BIT   /* root */
    1173                 || paParms[1].type != VBOX_HGCM_SVC_PARM_PTR     /* newPath */
    1174                 || paParms[2].type != VBOX_HGCM_SVC_PARM_PTR     /* oldPath */
    1175                 || paParms[3].type != VBOX_HGCM_SVC_PARM_PTR     /* info */
     1171            else if (   paParms[0].type != VBOX_HGCM_SVC_PARM_32BIT   /* root */
     1172                     || paParms[1].type != VBOX_HGCM_SVC_PARM_PTR     /* newPath */
     1173                     || paParms[2].type != VBOX_HGCM_SVC_PARM_PTR     /* oldPath */
     1174                     || paParms[3].type != VBOX_HGCM_SVC_PARM_PTR     /* info */
    11761175                    )
    11771176            {
     
    11841183                SHFLSTRING  *pNewPath = (SHFLSTRING *)paParms[1].u.pointer.addr;
    11851184                SHFLSTRING  *pOldPath = (SHFLSTRING *)paParms[2].u.pointer.addr;
    1186                 RTFSOBJINFO *pInfo    = (RTFSOBJINFO *)paParms[3].u.pointer.addr;
     1185                SHFLFSOBJINFO *pInfo  = (SHFLFSOBJINFO *)paParms[3].u.pointer.addr;
    11871186                uint32_t     cbInfo   = paParms[3].u.pointer.size;
    11881187
     
    11901189                if (    !ShflStringIsValid(pNewPath, paParms[1].u.pointer.size)
    11911190                    ||  !ShflStringIsValid(pOldPath, paParms[2].u.pointer.size)
    1192                     ||  (cbInfo != sizeof(RTFSOBJINFO))
     1191                    ||  (cbInfo != sizeof(SHFLFSOBJINFO))
    11931192                   )
    11941193                {
  • trunk/src/VBox/HostServices/SharedFolders/vbsf.cpp

    r34078 r35482  
    550550                            Assert(rc == VINF_SUCCESS || rc == VERR_FILE_NOT_FOUND || rc == VERR_PATH_NOT_FOUND);
    551551                        }
    552                         else
    553                         if (end == src)
     552                        else if (end == src)
    554553                            rc = VINF_SUCCESS;  /* trailing delimiter */
    555554                        else
     
    21472146}
    21482147
    2149 int vbsfSymlink(SHFLCLIENTDATA *pClient, SHFLROOT root, SHFLSTRING *pNewPath, SHFLSTRING *pOldPath, RTFSOBJINFO *pInfo)
     2148int vbsfSymlink(SHFLCLIENTDATA *pClient, SHFLROOT root, SHFLSTRING *pNewPath, SHFLSTRING *pOldPath, SHFLFSOBJINFO *pInfo)
    21502149{
    21512150    int rc = VINF_SUCCESS;
     
    21642163    rc = RTSymlinkCreate(pszFullNewPath, (const char *)pOldPath->String.utf8, RTSYMLINKTYPE_UNKNOWN);
    21652164    if (RT_SUCCESS (rc))
    2166         rc = RTPathQueryInfoEx(pszFullNewPath, pInfo, RTFSOBJATTRADD_NOTHING, SHFL_RT_LINK(pClient));
     2165    {
     2166        RTFSOBJINFO info;
     2167        rc = RTPathQueryInfoEx(pszFullNewPath, &info, RTFSOBJATTRADD_NOTHING, SHFL_RT_LINK(pClient));
     2168        if (RT_SUCCESS(rc))
     2169            vbfsCopyFsObjInfoFromIprt(pInfo, &info);
     2170    }
    21672171
    21682172    vbsfFreeFullPath(pszFullNewPath);
  • trunk/src/VBox/HostServices/SharedFolders/vbsf.h

    r33409 r35482  
    3939int vbsfQueryFileInfo(SHFLCLIENTDATA *pClient, SHFLROOT root, SHFLHANDLE Handle, uint32_t flags, uint32_t *pcbBuffer, uint8_t *pBuffer);
    4040int vbsfReadLink(SHFLCLIENTDATA *pClient, SHFLROOT root, SHFLSTRING *pPath, uint32_t cbPath, uint8_t *pBuffer, uint32_t cbBuffer);
    41 int vbsfSymlink(SHFLCLIENTDATA *pClient, SHFLROOT root, SHFLSTRING *pNewPath, SHFLSTRING *pOldPath, RTFSOBJINFO *pInfo);
     41int vbsfSymlink(SHFLCLIENTDATA *pClient, SHFLROOT root, SHFLSTRING *pNewPath, SHFLSTRING *pOldPath, SHFLFSOBJINFO *pInfo);
    4242
    4343#endif /* __VBSF__H */
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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