VirtualBox

Changeset 105018 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Jun 25, 2024 11:06:29 AM (9 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
163636
Message:

doc/manual,include/VBox,Frontends/VBoxManage,HostServices/SharedFolders,
Main/{include,SharedFolder,Console,Machine,VirtualBox.xidl}: Backout
changeset r163634 since it introduces a build dependency on
VirtualBox_XPCOM.h which needs to be built from the VirtualBox.xidl
changes before it can be referenced by the src/VBox/HostServices code.
Need to putback the changes in two parts. bugref:10619

Location:
trunk/src/VBox/Main
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r105016 r105018  
    657657      <desc>Settings version "1.20", written by VirtualBox 7.1.x.</desc>
    658658      <!--
    659         - Machine changes:
    660           + Adds VM platform support: Non-platform-specific
    661             settings were moved to the new Platform element, which now contains
    662             the platform architecture for this VM. x86-specific
    663             settings were moved from Machine to a new, dedicated Platform/x86 element.
    664             BIOSSettings were renamed to FirmwareSettings. ARM-specific settings
    665             were added to a new, dedicated Platform/ARM element. This settings
    666             version only will be written if the ARM platform architecture is being
    667             selected. Only affects the machine settings (not main configuration
    668             settings).
    669           + Adds support for Shared Folder symbolic link configuration. (Machine
    670             settings only).
     659          Adds VM platform support: Non-platform-specific
     660          settings were moved to the new Platform element, which now contains
     661          the platform architecture for this VM. x86-specific
     662          settings were moved from Machine to a new, dedicated Platform/x86 element.
     663          BIOSSettings were renamed to FirmwareSettings. ARM-specific settings
     664          were added to a new, dedicated Platform/ARM element. This settings
     665          version only will be written if the ARM platform architecture is being
     666          selected. Only affects the machine settings (not main configuration
     667          settings).
    671668      -->
    672669    </const>
     
    2443224429  <interface
    2443324430    name="ISharedFolder" extends="$unknown"
    24434     uuid="0b108b8c-62e0-4e06-9dfa-2f1a2ad70774"
     24431    uuid="9622225a-5409-414b-bd16-77df7ba3451e"
    2443524432    wsmap="managed"
    2443624433    rest="managed"
     
    2454324540        failure and should normally describe a reason of the failure (for
    2454424541        example, a file read error).
    24545       </desc>
    24546     </attribute>
    24547 
    24548     <attribute name="symlinkPolicy" type="SymlinkPolicy">
    24549       <desc>
    24550         The security policy for allowing guest VMs to create symbolic links
    24551         within a Shared Folder.
    2455224542      </desc>
    2455324543    </attribute>
     
    3021530205</enum>
    3021630206
    30217   <enum
    30218     name="SymlinkPolicy"
    30219     uuid="a818472e-215d-4279-8af8-eac4c0517bcc"
    30220     >
    30221     <desc>Shared Folder Symbolic Link Security Policies</desc>
    30222     <const name="None"                       value="0">
    30223       <desc>No symlink policy set (never used by the API).</desc>
    30224     </const>
    30225     <const name="Forbidden"                  value="1">
    30226       <desc>Users in the guest VM are not able to create symbolic links inside the Shared Folder.</desc>
    30227     </const>
    30228     <const name="AllowedInShareSubtree"      value="2">
    30229       <desc>Users in the guest VM are allowed to create symbolic links within the Shared Folder so long
    30230           as the target remains in the Shared Folder or within the subtree of the Shared Folder.
    30231       </desc>
    30232     </const>
    30233     <const name="AllowedToRelativeTargets"   value="3">
    30234       <desc>Users in the guest VM are allowed to create symbolic links within the Shared Folder to
    30235           targets within the Shared Folder and its subtree as well as to relative targets (../) outside of
    30236           the Shared Folder.
    30237       </desc>
    30238     </const>
    30239     <const name="AllowedToAnyTarget"         value="4">
    30240       <desc>Users in the guest VM are allowed to create symbolic links within the Shared Folder and
    30241           its subtree as well as to other targets via either relative pathnames or absolute pathnames.
    30242       </desc>
    30243     </const>
    30244 </enum>
    3024530207
    3024630208  <interface name="ICloudNetworkGatewayInfo" extends="$unknown"
  • trunk/src/VBox/Main/include/ConsoleSharedFolderImpl.h

    r105016 r105018  
    8989    const Utf8Str &i_getAutoMountPoint() const;
    9090
    91     /**
    92      * Public internal method for getting the symlink policy.
    93      */
    94     const SymlinkPolicy_T i_getSymlinkPolicy() const;
    95 
    9691protected:
    9792
     
    105100private:
    106101
    107     // wrapped ISharedFolder properties.
     102    // wrapped ISharedFolder properies.
    108103    HRESULT getName(com::Utf8Str &aName);
    109104    HRESULT getHostPath(com::Utf8Str &aHostPath);
     
    116111    HRESULT setAutoMountPoint(com::Utf8Str const &aAutoMountPoint);
    117112    HRESULT getLastAccessError(com::Utf8Str &aLastAccessError);
    118     HRESULT getSymlinkPolicy(SymlinkPolicy_T *aSymlinkPolicy);
    119     HRESULT setSymlinkPolicy(SymlinkPolicy_T aSymlinkPolicy);
    120113
    121114    VirtualBoxBase * const mParent;
  • trunk/src/VBox/Main/include/MachineImpl.h

    r105016 r105018  
    911911    friend class RecordingScreenSettings;
    912912    friend class SessionMachine;
    913     friend class SharedFolder;
    914913    friend class SnapshotMachine;
    915914    friend class VirtualBox;
  • trunk/src/VBox/Main/include/SharedFolderImpl.h

    r105016 r105018  
    4949    // public initializer/uninitializer for internal purposes only
    5050    HRESULT init(Machine *aMachine, const com::Utf8Str &aName, const com::Utf8Str &aHostPath,
    51                  bool aWritable, bool aAutoMount, const com::Utf8Str &aAutoMountPoint, bool fFailOnError,
    52                  SymlinkPolicy_T enmSymlinkPolicy);
     51                 bool aWritable, bool aAutoMount, const com::Utf8Str &aAutoMountPoint, bool fFailOnError);
    5352    HRESULT initCopy(Machine *aMachine, SharedFolder *aThat);
    5453//    HRESULT init(Console *aConsole, const com::Utf8Str &aName, const com::Utf8Str &aHostPath,
     
    9089    const Utf8Str &i_getAutoMountPoint() const;
    9190
    92     /**
    93      * Public internal method for getting the symlink policy.
    94      */
    95     const SymlinkPolicy_T i_getSymlinkPolicy() const;
    96 
    9791protected:
    9892
     
    10397                            bool aAutoMount,
    10498                            const com::Utf8Str &aAutoMountPoint,
    105                             bool fFailOnError,
    106                             SymlinkPolicy_T enmSymlinkPolicy);
     99                            bool fFailOnError);
    107100private:
    108101
    109     // wrapped ISharedFolder properties.
     102    // wrapped ISharedFolder properies.
    110103    HRESULT getName(com::Utf8Str &aName);
    111104    HRESULT getHostPath(com::Utf8Str &aHostPath);
     
    118111    HRESULT setAutoMountPoint(com::Utf8Str const &aAutoMountPoint);
    119112    HRESULT getLastAccessError(com::Utf8Str &aLastAccessError);
    120     HRESULT getSymlinkPolicy(SymlinkPolicy_T *aSymlinkPolicy);
    121     HRESULT setSymlinkPolicy(SymlinkPolicy_T aSymlinkPolicy);
    122113
    123114    VirtualBoxBase * const mParent;
  • trunk/src/VBox/Main/src-all/ConsoleSharedFolderImpl.cpp

    r105016 r105018  
    4444    Data()
    4545    : fWritable(false),
    46       fAutoMount(false),
    47       enmSymlinkPolicy(SymlinkPolicy_None)
     46      fAutoMount(false)
    4847    { }
    4948
     
    5453    const Utf8Str   strAutoMountPoint;
    5554    Utf8Str         strLastAccessError;
    56     SymlinkPolicy_T enmSymlinkPolicy;
    5755};
    5856
     
    307305}
    308306
    309 HRESULT ConsoleSharedFolder::getSymlinkPolicy(SymlinkPolicy_T *aSymlinkPolicy)
    310 {
    311     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    312     *aSymlinkPolicy = m->enmSymlinkPolicy;
    313     return S_OK;
    314 }
    315 
    316 HRESULT ConsoleSharedFolder::setSymlinkPolicy(SymlinkPolicy_T aSymlinkPolicy)
    317 {
    318     RT_NOREF(aSymlinkPolicy);
    319     return E_NOTIMPL;
    320 }
    321307
    322308const Utf8Str& ConsoleSharedFolder::i_getName() const
     
    345331}
    346332
    347 const SymlinkPolicy_T ConsoleSharedFolder::i_getSymlinkPolicy() const
    348 {
    349     return m->enmSymlinkPolicy;
    350 }
    351 
    352333/* vi: set tabstop=4 shiftwidth=4 expandtab: */
  • trunk/src/VBox/Main/src-all/SharedFolderImpl.cpp

    r105016 r105018  
    4646    Data()
    4747    : fWritable(false),
    48       fAutoMount(false),
    49       enmSymlinkPolicy(SymlinkPolicy_None)
     48      fAutoMount(false)
    5049    { }
    5150
     
    5655    const Utf8Str   strAutoMountPoint;
    5756    Utf8Str         strLastAccessError;
    58     SymlinkPolicy_T enmSymlinkPolicy;
    5957};
    6058
     
    111109                           bool aAutoMount,
    112110                           const Utf8Str &aAutoMountPoint,
    113                            bool fFailOnError,
    114                            SymlinkPolicy_T enmSymlinkPolicy)
     111                           bool fFailOnError)
    115112{
    116113    /* Enclose the state transition NotReady->InInit->Ready */
     
    120117    unconst(mMachine) = aMachine;
    121118
    122     HRESULT hrc = i_protectedInit(aMachine, aName, aHostPath, aWritable, aAutoMount, aAutoMountPoint, fFailOnError,
    123                                   enmSymlinkPolicy);
     119    HRESULT hrc = i_protectedInit(aMachine, aName, aHostPath, aWritable, aAutoMount, aAutoMountPoint, fFailOnError);
    124120
    125121    /* Confirm a successful initialization when it's the case */
     
    156152                                  aThat->m->fAutoMount,
    157153                                  aThat->m->strAutoMountPoint,
    158                                   false /* fFailOnError */,
    159                                   aThat->m->enmSymlinkPolicy);
     154                                  false /* fFailOnError */ );
    160155
    161156    /* Confirm a successful initialization when it's the case */
     
    219214                                      bool aAutoMount,
    220215                                      const Utf8Str &aAutoMountPoint,
    221                                       bool fFailOnError,
    222                                       SymlinkPolicy_T enmSymlinkPolicy)
    223 {
    224     LogFlowThisFunc(("aName={%s}, aHostPath={%s}, aWritable={%d}, aAutoMount={%d} enmSymlinkPolicy={%d}\n",
    225                       aName.c_str(), aHostPath.c_str(), aWritable, aAutoMount, enmSymlinkPolicy));
     216                                      bool fFailOnError)
     217{
     218    LogFlowThisFunc(("aName={%s}, aHostPath={%s}, aWritable={%d}, aAutoMount={%d}\n",
     219                      aName.c_str(), aHostPath.c_str(), aWritable, aAutoMount));
    226220
    227221    ComAssertRet(aParent && aName.isNotEmpty() && aHostPath.isNotEmpty(), E_INVALIDARG);
     
    277271    m->fAutoMount = aAutoMount;
    278272    unconst(m->strAutoMountPoint) = aAutoMountPoint;
    279     m->enmSymlinkPolicy = enmSymlinkPolicy;
    280273
    281274    return S_OK;
     
    392385}
    393386
    394 HRESULT SharedFolder::getSymlinkPolicy(SymlinkPolicy_T *aSymlinkPolicy)
    395 {
    396     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    397     *aSymlinkPolicy = m->enmSymlinkPolicy;
    398     return S_OK;
    399 }
    400 
    401 HRESULT SharedFolder::setSymlinkPolicy(SymlinkPolicy_T aSymlinkPolicy)
    402 {
    403     switch (aSymlinkPolicy)
    404     {
    405         case SymlinkPolicy_AllowedToAnyTarget:
    406         case SymlinkPolicy_AllowedInShareSubtree:
    407         case SymlinkPolicy_AllowedToRelativeTargets:
    408         case SymlinkPolicy_Forbidden:
    409             break;
    410         default:
    411             return setError(E_INVALIDARG, tr("The symbolic link policy specified (%d) is invalid."), aSymlinkPolicy);
    412     }
    413 
    414     AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    415     m->enmSymlinkPolicy = aSymlinkPolicy;
    416     return S_OK;
    417 }
    418387
    419388const Utf8Str& SharedFolder::i_getName() const
     
    442411}
    443412
    444 const SymlinkPolicy_T SharedFolder::i_getSymlinkPolicy() const
    445 {
    446     return m->enmSymlinkPolicy;
    447 }
    448 
    449413/* vi: set tabstop=4 shiftwidth=4 expandtab: */
  • trunk/src/VBox/Main/src-client/ConsoleImpl.cpp

    r105016 r105018  
    95419541                      | (fMissing           ? SHFL_ADD_MAPPING_F_MISSING : 0));
    95429542        SHFLSTRING_TO_HGMC_PARAM(&aParams[3], pAutoMountPoint);
    9543         HGCMSvcSetU32(&aParams[4], SymlinkPolicy_None);
    9544         AssertCompile(SHFL_CPARMS_ADD_MAPPING == 5);
     9543        AssertCompile(SHFL_CPARMS_ADD_MAPPING == 4);
    95459544
    95469545        vrc = m_pVMMDev->hgcmHostCall("VBoxSharedFolders", SHFL_FN_ADD_MAPPING, SHFL_CPARMS_ADD_MAPPING, aParams);
  • trunk/src/VBox/Main/src-server/MachineImpl.cpp

    r105016 r105018  
    50325032                        aName.c_str());
    50335033
    5034     SymlinkPolicy_T enmSymlinkPolicy = SymlinkPolicy_None;
    50355034    sharedFolder.createObject();
    50365035    hrc = sharedFolder->init(i_getMachine(),
     
    50405039                             !!aAutomount,
    50415040                             aAutoMountPoint,
    5042                              true /* fFailOnError */,
    5043                              enmSymlinkPolicy);
     5041                             true /* fFailOnError */);
    50445042    if (FAILED(hrc)) return hrc;
    50455043
     
    88208818                                     RT_BOOL(sf.fAutoMount),
    88218819                                     sf.strAutoMountPoint,
    8822                                      false /* fFailOnError */,
    8823                                      sf.enmSymlinkPolicy);
     8820                                     false /* fFailOnError */);
    88248821            if (FAILED(hrc)) return hrc;
    88258822            mHWData->mSharedFolders.push_back(sharedFolder);
     
    1019610193            sf.fAutoMount = !!pSF->i_isAutoMounted();
    1019710194            sf.strAutoMountPoint = pSF->i_getAutoMountPoint();
    10198             sf.enmSymlinkPolicy = pSF->i_getSymlinkPolicy();
    1019910195
    1020010196            data.llSharedFolders.push_back(sf);
  • trunk/src/VBox/Main/xml/Settings.cpp

    r105016 r105018  
    37933793SharedFolder::SharedFolder() :
    37943794    fWritable(false),
    3795     fAutoMount(false),
    3796     enmSymlinkPolicy(SymlinkPolicy_None)
     3795    fAutoMount(false)
    37973796{
    37983797}
     
    38103809            && fWritable         == g.fWritable
    38113810            && fAutoMount        == g.fAutoMount
    3812             && strAutoMountPoint == g.strAutoMountPoint
    3813             && enmSymlinkPolicy  == g.enmSymlinkPolicy);
     3811            && strAutoMountPoint == g.strAutoMountPoint);
    38143812}
    38153813
     
    59945992                pelmFolder->getAttributeValue("autoMount", sf.fAutoMount);
    59955993                pelmFolder->getAttributeValue("autoMountPoint", sf.strAutoMountPoint);
    5996 
    5997                 Utf8Str strTemp;
    5998                 if (pelmFolder->getAttributeValue("symlinkPolicy", strTemp))
    5999                 {
    6000                     if (strTemp == "forbidden")
    6001                         sf.enmSymlinkPolicy = SymlinkPolicy_Forbidden;
    6002                     else if (strTemp == "subtree")
    6003                         sf.enmSymlinkPolicy = SymlinkPolicy_AllowedInShareSubtree;
    6004                     else if (strTemp == "relative")
    6005                         sf.enmSymlinkPolicy = SymlinkPolicy_AllowedToRelativeTargets;
    6006                     else if (strTemp == "any")
    6007                         sf.enmSymlinkPolicy = SymlinkPolicy_AllowedToAnyTarget;
    6008                     else
    6009                         throw ConfigFileError(this,
    6010                                               pelmHwChild,
    6011                                               N_("Invalid value '%s' in SharedFolder/@symlinkPolicy attribute"),
    6012                                               strTemp.c_str());
    6013                 }
    60145994                hw.llSharedFolders.push_back(sf);
    60155995            }
     
    83298309            if (sf.strAutoMountPoint.isNotEmpty())
    83308310                pelmThis->setAttribute("autoMountPoint", sf.strAutoMountPoint);
    8331             const char *pcszSymlinkPolicy;
    8332             if (sf.enmSymlinkPolicy != SymlinkPolicy_None)
    8333             {
    8334                 switch (sf.enmSymlinkPolicy)
    8335                 {
    8336                     default: /*case SymlinkPolicy_Forbidden:*/    pcszSymlinkPolicy = "forbidden";  break;
    8337                     case SymlinkPolicy_AllowedInShareSubtree:     pcszSymlinkPolicy = "subtree";    break;
    8338                     case SymlinkPolicy_AllowedToRelativeTargets:  pcszSymlinkPolicy = "relative";   break;
    8339                     case SymlinkPolicy_AllowedToAnyTarget:        pcszSymlinkPolicy = "any";        break;
    8340                 }
    8341                 pelmThis->setAttribute("symlinkPolicy", pcszSymlinkPolicy);
    8342             }
    83438311        }
    83448312    }
     
    95639531            return;
    95649532        }
    9565 
    9566         // VirtualBox 7.1 (settings v1.20) adds support for customizable control over Shared Folders symlink creation.
    9567         if (hardwareMachine.llSharedFolders.size())
    9568         {
    9569             for (SharedFoldersList::const_iterator it = hardwareMachine.llSharedFolders.begin();
    9570                  it != hardwareMachine.llSharedFolders.end();
    9571                  ++it)
    9572             {
    9573                 if (it->enmSymlinkPolicy != SymlinkPolicy_None)
    9574                 {
    9575                     m->sv = SettingsVersion_v1_20;
    9576                     return;
    9577                 }
    9578             }
    9579         }
    95809533    }
    95819534
  • trunk/src/VBox/Main/xml/VirtualBox-settings.xsd

    r105016 r105018  
    301301    <xsd:enumeration value="VBoxSVGA"/>
    302302    <xsd:enumeration value="QemuRamFB"/>
    303   </xsd:restriction>
    304 </xsd:simpleType>
    305 
    306 <xsd:simpleType name="TSymlinkPolicy"> <!-- new since v1.20. -->
    307   <xsd:restriction base="xsd:token">
    308     <xsd:enumeration value="forbidden"/>
    309     <xsd:enumeration value="subtree"/>
    310     <xsd:enumeration value="relative"/>
    311     <xsd:enumeration value="any"/>
    312303  </xsd:restriction>
    313304</xsd:simpleType>
     
    13141305  <xsd:attribute name="autoMount" type="xsd:boolean" default="false"/>
    13151306  <xsd:attribute name="autoMountPoint" type="xsd:string"/>
    1316   <xsd:attribute name="symlinkPolicy" type="TSymlinkPolicy" default="forbidden"/> <!-- new since v1.20. -->
    13171307</xsd:complexType>
    13181308
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