VirtualBox

Ignore:
Timestamp:
Nov 4, 2022 1:35:06 PM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
154399
Message:

Guest Control/Main: Rewrite of the path building and directory walking code for the copyFrom / copyTo guest session tasks, to (hopefully) have a cleaner structure. The new path building now also takes into account whether a destination has a trailing delimiter and then act accordingly (see rules in GuestPath::BuildDestinationPath()). Adjusted VBoxManage and FE/Qt to also reflect that; should now work as common tools like cp. Added new test cases and also re-enabled old ones which were disabled since quite a while (should pass now) [translation fixes, logging adjustments]. ​bugref:10286

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/GuestSessionImplTasks.cpp

    r97395 r97399  
    17021702            {
    17031703                setProgressErrorMsg(VBOX_E_IPRT_ERROR,
    1704                                     Utf8StrFmt(tr("Translating host destination root path '%s' failed: %Rrc"),
     1704                                    Utf8StrFmt(tr("Translating host destination root path \"%s\" failed: %Rrc"),
    17051705                                               strDstRootAbs.c_str(), vrc));
    17061706                break;
     
    17391739                {
    17401740                    setProgressErrorMsg(VBOX_E_IPRT_ERROR,
    1741                                         Utf8StrFmt(tr("Translating guest source path '%s' from %s to %s failed: %Rrc"),
    1742                                                    strSrcAbs.c_str(),
    1743                                                    GuestBase::pathStyleToStr(pList->mSourceSpec.enmPathStyle),
    1744                                                    GuestBase::pathStyleToStr(pList->mSourceSpec.enmPathStyle), vrc));
     1741                                        Utf8StrFmt(tr("Translating guest source path \"%s\" failed: %Rrc"),
     1742                                                   strSrcAbs.c_str(), vrc));
    17451743                    break;
    17461744                }
    17471745
    17481746                /* Translate the final host destination path. */
    1749                 vrc = GuestPath::Translate(strDstAbs, pList->mSourceSpec.enmPathStyle, PATH_STYLE_NATIVE /* Source */, true /* fForce */);
     1747                vrc = GuestPath::Translate(strDstAbs, PATH_STYLE_NATIVE /* Source */, PATH_STYLE_NATIVE /* Dest */, true /* fForce */);
    17501748                if (RT_FAILURE(vrc))
    17511749                {
    17521750                    setProgressErrorMsg(VBOX_E_IPRT_ERROR,
    1753                                         Utf8StrFmt(tr("Translating host destination path '%s' from %s to %s failed: %Rrc"),
    1754                                                    strDstAbs.c_str(),
    1755                                                    GuestBase::pathStyleToStr(pList->mSourceSpec.enmPathStyle),
    1756                                                    GuestBase::pathStyleToStr(PATH_STYLE_NATIVE), vrc));
     1751                                        Utf8StrFmt(tr("Translating host destination path \"%s\" failed: %Rrc"),
     1752                                                   strDstAbs.c_str(), vrc));
    17571753                    break;
    17581754                }
     
    20662062        {
    20672063            setProgressErrorMsg(VBOX_E_IPRT_ERROR,
    2068                                 Utf8StrFmt(tr("Translating guest destination path '%s' from %s to %s failed: %Rrc"),
    2069                                            strDstRootAbs.c_str(),
    2070                                            GuestBase::pathStyleToStr(PATH_STYLE_NATIVE),
    2071                                            GuestBase::pathStyleToStr(mSession->i_getGuestPathStyle()), vrc));
     2064                                Utf8StrFmt(tr("Translating guest destination path \"%s\" failed: %Rrc"),
     2065                                           strDstRootAbs.c_str(), vrc));
    20722066            break;
    20732067        }
     
    21782172            {
    21792173                setProgressErrorMsg(VBOX_E_IPRT_ERROR,
    2180                                     Utf8StrFmt(tr("Translating guest destination root path '%s' failed: %Rrc"),
     2174                                    Utf8StrFmt(tr("Translating guest destination root path \"%s\" failed: %Rrc"),
    21812175                                               strDstRootAbs.c_str(), vrc));
    21822176                break;
     
    22162210                {
    22172211                    setProgressErrorMsg(VBOX_E_IPRT_ERROR,
    2218                                         Utf8StrFmt(tr("Translating host source path '%s' from %s to %s failed: %Rrc"),
    2219                                                    strSrcAbs.c_str(),
    2220                                                    GuestBase::pathStyleToStr(PATH_STYLE_NATIVE),
    2221                                                    GuestBase::pathStyleToStr(PATH_STYLE_NATIVE), vrc));
     2212                                        Utf8StrFmt(tr("Translating host source path\"%s\" failed: %Rrc"),
     2213                                                   strSrcAbs.c_str(), vrc));
    22222214                    break;
    22232215                }
     
    22302222                {
    22312223                    setProgressErrorMsg(VBOX_E_IPRT_ERROR,
    2232                                         Utf8StrFmt(tr("Translating guest destination path '%s' from %s to %s failed: %Rrc"),
    2233                                                    strDstAbs.c_str(),
    2234                                                    GuestBase::pathStyleToStr(PATH_STYLE_NATIVE),
    2235                                                    GuestBase::pathStyleToStr(mSession->i_getGuestPathStyle()), vrc));
     2224                                        Utf8StrFmt(tr("Translating guest destination path \"%s\" failed: %Rrc"),
     2225                                                   strDstAbs.c_str(), vrc));
    22362226                    break;
    22372227                }
     
    23232313            {
    23242314                setProgressErrorMsg(VBOX_E_IPRT_ERROR,
    2325                                     Utf8StrFmt(tr("Translating guest destination path '%s' from %s to %s failed: %Rrc"),
     2315                                    Utf8StrFmt(tr("Translating guest destination path \"%s\" failed: %Rrc"),
    23262316                                               strDstRootAbs.c_str(), vrc));
    23272317                break;
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