VirtualBox

忽略:
時間撮記:
2019-3-1 下午02:44:31 (6 年 以前)
作者:
vboxsync
訊息:

Guest Control/Main: Fixed directory creation / mode flags for session tasks.

檔案:
修改 1 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/Main/src-client/GuestSessionImplTasks.cpp

    r77508 r77531  
    221221 * @param  strPath                  Absolute path to directory on the guest (guest style path) to create.
    222222 * @param  enmDirectoryCreateFlags  Directory creation flags.
    223  * @param  uMode                    Directory mode to use for creation.
     223 * @param  fMode                    Directory mode to use for creation.
    224224 * @param  fFollowSymlinks          Whether to follow symlinks on the guest or not.
    225225 * @param  fCanExist                Whether the directory to create is allowed to exist already.
    226226 */
    227227int GuestSessionTask::directoryCreateOnGuest(const com::Utf8Str &strPath,
    228                                              DirectoryCreateFlag_T enmDirectoryCreateFlags, uint32_t uMode,
     228                                             DirectoryCreateFlag_T enmDirectoryCreateFlags, uint32_t fMode,
    229229                                             bool fFollowSymlinks, bool fCanExist)
    230230{
    231     LogFlowFunc(("strPath=%s, enmDirectoryCreateFlags=0x%x, uMode=%RU32, fFollowSymlinks=%RTbool, fCanExist=%RTbool\n",
    232                  strPath.c_str(), enmDirectoryCreateFlags, uMode, fFollowSymlinks, fCanExist));
     231    LogFlowFunc(("strPath=%s, enmDirectoryCreateFlags=0x%x, fMode=%RU32, fFollowSymlinks=%RTbool, fCanExist=%RTbool\n",
     232                 strPath.c_str(), enmDirectoryCreateFlags, fMode, fFollowSymlinks, fCanExist));
    233233
    234234    GuestFsObjData objData; int rcGuest;
     
    253253                    case VERR_FILE_NOT_FOUND:
    254254                    case VERR_PATH_NOT_FOUND:
    255                         rc = mSession->i_directoryCreate(strPath.c_str(), uMode, enmDirectoryCreateFlags, &rcGuest);
     255                        rc = mSession->i_directoryCreate(strPath.c_str(), fMode, enmDirectoryCreateFlags, &rcGuest);
    256256                        break;
    257257                    default:
     
    287287 * @param  strPath                  Absolute path to directory on the host (host style path) to create.
    288288 * @param  fCreate                  Directory creation flags.
    289  * @param  uMode                    Directory mode to use for creation.
     289 * @param  fMode                    Directory mode to use for creation.
    290290 * @param  fCanExist                Whether the directory to create is allowed to exist already.
    291291 */
    292 int GuestSessionTask::directoryCreateOnHost(const com::Utf8Str &strPath, uint32_t fCreate, uint32_t uMode, bool fCanExist)
    293 {
    294     LogFlowFunc(("strPath=%s, fCreate=0x%x, uMode=%RU32, fCanExist=%RTbool\n", strPath.c_str(), fCreate, uMode, fCanExist));
    295 
    296     int rc = RTDirCreate(strPath.c_str(), uMode, fCreate);
     292int GuestSessionTask::directoryCreateOnHost(const com::Utf8Str &strPath, uint32_t fCreate, uint32_t fMode, bool fCanExist)
     293{
     294    LogFlowFunc(("strPath=%s, fCreate=0x%x, fMode=%RU32, fCanExist=%RTbool\n", strPath.c_str(), fCreate, fMode, fCanExist));
     295
     296    int rc = RTDirCreate(strPath.c_str(), fMode, fCreate);
    297297    if (RT_FAILURE(rc))
    298298    {
     
    15551555        const bool     fFollowSymlinks   = true; /** @todo */
    15561556        const uint32_t fDirMode          = 0700; /** @todo Play safe by default; implement ACLs. */
    1557               uint32_t fDirCreate = 0;
     1557              uint32_t fDirCreate        = 0;
    15581558
    15591559        if (!fFollowSymlinks)
     
    15661566            && pList->mSourceSpec.fDryRun == false)
    15671567        {
    1568             rc = directoryCreateOnHost(pList->mDstRootAbs, fDirMode, fDirCreate, fCopyIntoExisting);
     1568            rc = directoryCreateOnHost(pList->mDstRootAbs, fDirCreate, fDirMode, fCopyIntoExisting);
    15691569            if (RT_FAILURE(rc))
    15701570                break;
     
    15951595                    LogFlowFunc(("Directory '%s': %s -> %s\n", pEntry->strPath.c_str(), strSrcAbs.c_str(), strDstAbs.c_str()));
    15961596                    if (!pList->mSourceSpec.fDryRun)
    1597                         rc = directoryCreateOnHost(strDstAbs, fDirMode, fDirCreate, fCopyIntoExisting);
     1597                        rc = directoryCreateOnHost(strDstAbs, fDirCreate, fDirMode, fCopyIntoExisting);
    15981598                    break;
    15991599
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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