VirtualBox

Changeset 34574 in vbox


Ignore:
Timestamp:
Dec 1, 2010 3:01:02 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
68369
Message:

Make vrde auth library configurable per VM.

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/settings.h

    r34244 r34574  
    293293    AuthType_T      authType;
    294294    uint32_t        ulAuthTimeout;
     295    com::Utf8Str    strAuthLibrary;
    295296    bool            fAllowMultiConnection,
    296297                    fReuseSingleConnection,
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp

    r34529 r34574  
    309309                     "                            [--vrdeproperty <name=[value]>]\n"
    310310                     "                            [--vrdeauthtype null|external|guest]\n"
     311                     "                            [--vrdeauthlibrary default|<name>\n"
    311312                     "                            [--vrdemulticon on|off]\n"
    312313                     "                            [--vrdereusecon on|off]\n"
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp

    r34563 r34574  
    142142    MODIFYVM_VRDEPROPERTY,
    143143    MODIFYVM_VRDEAUTHTYPE,
     144    MODIFYVM_VRDEAUTHLIBRARY,
    144145    MODIFYVM_VRDEMULTICON,
    145146    MODIFYVM_VRDEREUSECON,
     
    265266    { "--vrdeproperty",             MODIFYVM_VRDEPROPERTY,              RTGETOPT_REQ_STRING },
    266267    { "--vrdeauthtype",             MODIFYVM_VRDEAUTHTYPE,              RTGETOPT_REQ_STRING },
     268    { "--vrdeauthlibrary",          MODIFYVM_VRDEAUTHLIBRARY,           RTGETOPT_REQ_STRING },
    267269    { "--vrdemulticon",             MODIFYVM_VRDEMULTICON,              RTGETOPT_REQ_BOOL_ONOFF },
    268270    { "--vrdereusecon",             MODIFYVM_VRDEREUSECON,              RTGETOPT_REQ_BOOL_ONOFF },
     
    19351937            }
    19361938
     1939            case MODIFYVM_VRDEAUTHLIBRARY:
     1940            {
     1941                ComPtr<IVRDEServer> vrdeServer;
     1942                machine->COMGETTER(VRDEServer)(vrdeServer.asOutParam());
     1943                ASSERT(vrdeServer);
     1944
     1945                if (vrdeServer)
     1946                {
     1947                    if (strcmp(ValueUnion.psz, "default") != 0)
     1948                    {
     1949                        Bstr bstr(ValueUnion.psz);
     1950                        CHECK_ERROR(vrdeServer, COMSETTER(AuthLibrary)(bstr.raw()));
     1951                    }
     1952                    else
     1953                        CHECK_ERROR(vrdeServer, COMSETTER(AuthLibrary)(NULL));
     1954                }
     1955                break;
     1956            }
     1957
    19371958            case MODIFYVM_VRDPMULTICON:
    19381959                vrdeWarningDeprecatedOption("multicon");
  • trunk/src/VBox/Main/ConsoleVRDPServer.cpp

    r34559 r34574  
    14901490    {
    14911491        /* Load the external authentication library. */
    1492 
    1493         ComPtr<IMachine> machine;
    1494         mConsole->COMGETTER(Machine)(machine.asOutParam());
    1495 
    1496         ComPtr<IVirtualBox> virtualBox;
    1497         machine->COMGETTER(Parent)(virtualBox.asOutParam());
    1498 
    1499         ComPtr<ISystemProperties> systemProperties;
    1500         virtualBox->COMGETTER(SystemProperties)(systemProperties.asOutParam());
    1501 
    15021492        Bstr authLibrary;
    1503         systemProperties->COMGETTER(VRDEAuthLibrary)(authLibrary.asOutParam());
     1493        mConsole->getVRDEServer()->COMGETTER(AuthLibrary)(authLibrary.asOutParam());
    15041494
    15051495        Utf8Str filename = authLibrary;
  • trunk/src/VBox/Main/VRDEServerImpl.cpp

    r34244 r34574  
    8787    mData->mAuthType             = AuthType_Null;
    8888    mData->mAuthTimeout          = 0;
     89    mData->mAuthLibrary.setNull();
    8990    mData->mEnabled              = FALSE;
    9091    mData->mAllowMultiConnection = FALSE;
     
    206207    mData->mAuthType = data.authType;
    207208    mData->mAuthTimeout = data.ulAuthTimeout;
     209    mData->mAuthLibrary = data.strAuthLibrary;
    208210    mData->mAllowMultiConnection = data.fAllowMultiConnection;
    209211    mData->mReuseSingleConnection = data.fReuseSingleConnection;
     
    232234    data.fEnabled = !!mData->mEnabled;
    233235    data.authType = mData->mAuthType;
     236    data.strAuthLibrary = mData->mAuthLibrary;
    234237    data.ulAuthTimeout = mData->mAuthTimeout;
    235238    data.fAllowMultiConnection = !!mData->mAllowMultiConnection;
     
    570573        mParent->onVRDEServerChange();
    571574#endif
     575    }
     576
     577    return S_OK;
     578}
     579
     580STDMETHODIMP VRDEServer::COMGETTER(AuthLibrary) (BSTR *aLibrary)
     581{
     582    CheckComArgOutPointerValid(aLibrary);
     583
     584    AutoCaller autoCaller(this);
     585    if (FAILED(autoCaller.rc())) return autoCaller.rc();
     586
     587    Bstr bstrLibrary;
     588
     589    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     590    bstrLibrary = mData->mAuthLibrary;
     591    alock.release();
     592
     593    if (bstrLibrary.isEmpty())
     594    {
     595        /* Get the global setting. */
     596        ComPtr<ISystemProperties> systemProperties;
     597        HRESULT hrc = mParent->getVirtualBox()->COMGETTER(SystemProperties)(systemProperties.asOutParam());
     598
     599        if (SUCCEEDED(hrc))
     600            hrc = systemProperties->COMGETTER(VRDEAuthLibrary)(bstrLibrary.asOutParam());
     601
     602        if (FAILED(hrc))
     603            return setError(hrc, "failed to query the library setting\n");
     604    }
     605
     606    bstrLibrary.cloneTo(aLibrary);
     607
     608    return S_OK;
     609}
     610
     611STDMETHODIMP VRDEServer::COMSETTER(AuthLibrary) (IN_BSTR aLibrary)
     612{
     613    AutoCaller autoCaller(this);
     614    if (FAILED(autoCaller.rc())) return autoCaller.rc();
     615
     616    /* the machine needs to be mutable */
     617    AutoMutableStateDependency adep(mParent);
     618    if (FAILED(adep.rc())) return adep.rc();
     619
     620    Bstr bstrLibrary(aLibrary);
     621
     622    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     623
     624    if (mData->mAuthLibrary != bstrLibrary)
     625    {
     626        mData.backup();
     627        mData->mAuthLibrary = bstrLibrary;
     628
     629        /* leave the lock before informing callbacks */
     630        alock.release();
     631
     632        AutoWriteLock mlock(mParent COMMA_LOCKVAL_SRC_POS);
     633        mParent->setModified(Machine::IsModified_VRDEServer);
     634        mlock.release();
     635
     636        mParent->onVRDEServerChange(/* aRestart */ TRUE);
    572637    }
    573638
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r34563 r34574  
    1263112631  <interface
    1263212632    name="IVRDEServer" extends="$unknown"
    12633     uuid="468ab3d3-4808-489e-a301-05d60e959fbc"
     12633    uuid="444e5d4a-ecd9-4c38-af95-a2fbfd69b486"
    1263412634    wsmap="managed"
    1263512635    >
     
    1267712677        The name of Extension Pack providing VRDE for this VM.  Overrides
    1267812678        <link to="ISystemProperties::defaultVRDEExtPack"/>.
     12679      </desc>
     12680    </attribute>
     12681
     12682    <attribute name="AuthLibrary" type="wstring">
     12683      <desc>
     12684        Library used for authentication of RDP clients by this VM. Overrides
     12685        <link to="ISystemProperties::VRDEAuthLibrary"/>.
    1267912686      </desc>
    1268012687    </attribute>
  • trunk/src/VBox/Main/include/VRDEServerImpl.h

    r34563 r34574  
    3535    {
    3636        BOOL mEnabled;
     37        Bstr mAuthLibrary;
    3738        AuthType_T mAuthType;
    3839        ULONG mAuthTimeout;
     
    8586    STDMETHOD(COMGETTER(VRDEExtPack))(BSTR *aExtPack);
    8687    STDMETHOD(COMSETTER(VRDEExtPack))(IN_BSTR aExtPack);
     88    STDMETHOD(COMGETTER(AuthLibrary)) (BSTR *aValue);
     89    STDMETHOD(COMSETTER(AuthLibrary)) (IN_BSTR aValue);
    8790
    8891    // IVRDEServer methods
  • trunk/src/VBox/Main/xml/Settings.cpp

    r34497 r34574  
    13861386                  && (authType                  == v.authType)
    13871387                  && (ulAuthTimeout             == v.ulAuthTimeout)
     1388                  && (strAuthLibrary            == v.strAuthLibrary)
    13881389                  && (fAllowMultiConnection     == v.fAllowMultiConnection)
    13891390                  && (fReuseSingleConnection    == v.fReuseSingleConnection)
     
    24742475            }
    24752476
     2477            pelmHwChild->getAttributeValue("authLibrary", hw.vrdeSettings.strAuthLibrary);
    24762478            pelmHwChild->getAttributeValue("authTimeout", hw.vrdeSettings.ulAuthTimeout);
    24772479            pelmHwChild->getAttributeValue("allowMultiConnection", hw.vrdeSettings.fAllowMultiConnection);
     
    34413443    if (m->sv >= SettingsVersion_v1_11)
    34423444    {
     3445        if (hw.vrdeSettings.strAuthLibrary.length())
     3446            pelmVRDE->setAttribute("authLibrary", hw.vrdeSettings.strAuthLibrary);
    34433447        if (hw.vrdeSettings.strVrdeExtPack.isNotEmpty())
    34443448            pelmVRDE->setAttribute("VRDEExtPack", hw.vrdeSettings.strVrdeExtPack);
     
    43324336             || mediaRegistry.llFloppyImages.size()
    43334337             || !hardwareMachine.vrdeSettings.strVrdeExtPack.isEmpty()
     4338             || !hardwareMachine.vrdeSettings.strAuthLibrary.isEmpty()
    43344339             || machineUserData.strOsType == "JRockitVE"
    43354340           )
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