儲存庫 vbox 的更動 12126
- 時間撮記:
- 2008-9-5 下午12:28:36 (16 年 以前)
- 位置:
- trunk/src/VBox
- 檔案:
-
- 修改 7 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp
r12057 r12126 425 425 " [-vrdpaddress <host>]\n" 426 426 " [-vrdpauthtype null|external|guest]\n" 427 " [-vrdpmulticon on|off]\n"); 427 " [-vrdpmulticon on|off]\n" 428 " [-vrdpreusecon on|off]\n"); 428 429 } 429 430 RTPrintf(" [-usb on|off]\n" … … 1648 1649 BOOL fMultiCon; 1649 1650 vrdpServer->COMGETTER(AllowMultiConnection)(&fMultiCon); 1651 BOOL fReuseCon; 1652 vrdpServer->COMGETTER(ReuseSingleConnection)(&fReuseCon); 1650 1653 VRDPAuthType_T vrdpAuthType; 1651 1654 const char *strAuthType; … … 1673 1676 RTPrintf("vrdpauthtype=\"%s\"\n", strAuthType); 1674 1677 RTPrintf("vrdpmulticon=\"%s\"\n", fMultiCon ? "on" : "off"); 1678 RTPrintf("vrdpreusecon=\"%s\"\n", fReuseCon ? "on" : "off"); 1675 1679 } 1676 1680 else … … 1678 1682 if (address.isEmpty()) 1679 1683 address = "0.0.0.0"; 1680 RTPrintf("VRDP: enabled (Address %lS, Port %d, MultiConn: %s, Authentication type: %s)\n", address.raw(), port, fMultiCon ? "on" : "off", strAuthType);1684 RTPrintf("VRDP: enabled (Address %lS, Port %d, MultiConn: %s, ReuseSingleConn: %s, Authentication type: %s)\n", address.raw(), port, fMultiCon ? "on" : "off", fReuseCon ? "on" : "off", strAuthType); 1681 1685 } 1682 1686 } … … 3794 3798 char *vrdpauthtype = NULL; 3795 3799 char *vrdpmulticon = NULL; 3800 char *vrdpreusecon = NULL; 3796 3801 #endif 3797 3802 int fUsbEnabled = -1; … … 4246 4251 i++; 4247 4252 vrdpmulticon = argv[i]; 4253 } 4254 else if (strcmp(argv[i], "-vrdpreusecon") == 0) 4255 { 4256 if (argc <= i + 1) 4257 return errorArgument("Missing argument to '%s'", argv[i]); 4258 i++; 4259 vrdpreusecon = argv[i]; 4248 4260 } 4249 4261 #endif /* VBOX_WITH_VRDP */ … … 5334 5346 5335 5347 #ifdef VBOX_WITH_VRDP 5336 if (vrdp || (vrdpport != UINT16_MAX) || vrdpaddress || vrdpauthtype || vrdpmulticon )5348 if (vrdp || (vrdpport != UINT16_MAX) || vrdpaddress || vrdpauthtype || vrdpmulticon || vrdpreusecon) 5337 5349 { 5338 5350 ComPtr<IVRDPServer> vrdpServer; … … 5400 5412 { 5401 5413 errorArgument("Invalid -vrdpmulticon argument '%s'", vrdpmulticon); 5414 rc = E_FAIL; 5415 break; 5416 } 5417 } 5418 if (vrdpreusecon) 5419 { 5420 if (strcmp(vrdpreusecon, "on") == 0) 5421 { 5422 CHECK_ERROR(vrdpServer, COMSETTER(ReuseSingleConnection)(true)); 5423 } 5424 else if (strcmp(vrdpreusecon, "off") == 0) 5425 { 5426 CHECK_ERROR(vrdpServer, COMSETTER(ReuseSingleConnection)(false)); 5427 } 5428 else 5429 { 5430 errorArgument("Invalid -vrdpreusecon argument '%s'", vrdpreusecon); 5402 5431 rc = E_FAIL; 5403 5432 break; -
trunk/src/VBox/Main/ConsoleImpl.cpp
r11832 r12126 332 332 mcAudioRefs = 0; 333 333 mcVRDPClients = 0; 334 mu32SingleRDPClientId = 0; 334 335 335 336 unconst (mVMMDev) = new VMMDev(this); … … 512 513 ) 513 514 )); 514 515 /* Multiconnection check. */516 BOOL allowMultiConnection = FALSE;517 hrc = mVRDPServer->COMGETTER(AllowMultiConnection) (&allowMultiConnection);518 AssertComRCReturn (hrc, VERR_ACCESS_DENIED);519 520 LogFlowFunc(("allowMultiConnection %d, mcVRDPClients = %d\n", allowMultiConnection, mcVRDPClients));521 522 if (allowMultiConnection == FALSE)523 {524 /* Note: the variable is incremented in ClientConnect callback, which is called when the client525 * is successfully connected, that is after the ClientLogon callback. Therefore the mcVRDPClients526 * value is 0 for first client.527 */528 if (mcVRDPClients > 0)529 {530 /* Reject. */531 LogRel(("VRDPAUTH: Multiple connections are not enabled. Access denied.\n"));532 return VERR_ACCESS_DENIED;533 }534 }535 515 536 516 switch (authType) … … 627 607 LogFlowFuncLeave(); 628 608 629 if (result == VRDPAuthAccessGranted) 630 { 631 LogRel(("VRDPAUTH: Access granted.\n")); 632 return VINF_SUCCESS; 633 } 634 635 /* Reject. */ 636 LogRel(("VRDPAUTH: Access denied.\n")); 637 return VERR_ACCESS_DENIED; 609 if (result != VRDPAuthAccessGranted) 610 { 611 /* Reject. */ 612 LogRel(("VRDPAUTH: Access denied.\n")); 613 return VERR_ACCESS_DENIED; 614 } 615 616 LogRel(("VRDPAUTH: Access granted.\n")); 617 618 /* Multiconnection check must be made after authentication, so bad clients would not interfere with a good one. */ 619 BOOL allowMultiConnection = FALSE; 620 hrc = mVRDPServer->COMGETTER(AllowMultiConnection) (&allowMultiConnection); 621 AssertComRCReturn (hrc, VERR_ACCESS_DENIED); 622 623 BOOL reuseSingleConnection = FALSE; 624 hrc = mVRDPServer->COMGETTER(ReuseSingleConnection) (&reuseSingleConnection); 625 AssertComRCReturn (hrc, VERR_ACCESS_DENIED); 626 627 LogFlowFunc(("allowMultiConnection %d, reuseSingleConnection = %d, mcVRDPClients = %d, mu32SingleRDPClientId = %d\n", allowMultiConnection, reuseSingleConnection, mcVRDPClients, mu32SingleRDPClientId)); 628 629 if (allowMultiConnection == FALSE) 630 { 631 /* Note: the 'mcVRDPClients' variable is incremented in ClientConnect callback, which is called when the client 632 * is successfully connected, that is after the ClientLogon callback. Therefore the mcVRDPClients 633 * value is 0 for first client. 634 */ 635 if (mcVRDPClients != 0) 636 { 637 Assert(mcVRDPClients == 1); 638 /* There is a client already. 639 * If required drop the existing client connection and let the connecting one in. 640 */ 641 if (reuseSingleConnection) 642 { 643 LogRel(("VRDPAUTH: Multiple connections are not enabled. Disconnecting existing client.\n")); 644 mConsoleVRDPServer->DisconnectClient (mu32SingleRDPClientId, false); 645 } 646 else 647 { 648 /* Reject. */ 649 LogRel(("VRDPAUTH: Multiple connections are not enabled. Access denied.\n")); 650 return VERR_ACCESS_DENIED; 651 } 652 } 653 654 /* Save the connected client id. From now on it will be necessary to disconnect this one. */ 655 mu32SingleRDPClientId = u32ClientId; 656 } 657 658 return VINF_SUCCESS; 638 659 } 639 660 -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r12020 r12126 9680 9680 <interface 9681 9681 name="IVRDPServer" extends="$unknown" 9682 uuid=" ed9d31ae-867f-45fc-b727-6740084d1883"9682 uuid="f4584ae7-6bce-474b-83d6-17d235e6aa89" 9683 9683 wsmap="managed" 9684 9684 > … … 9716 9716 Flag whether multiple simultaneous connections to the VM are permitted. 9717 9717 Note that this will be replaced by a more powerful mechanism in the future. 9718 </desc> 9719 </attribute> 9720 9721 <attribute name="reuseSingleConnection" type="boolean"> 9722 <desc> 9723 Flag whether the existing connection must be dropped and a new connection 9724 must be established by the VRDP server, when a new client connects in single 9725 connection mode. 9718 9726 </desc> 9719 9727 </attribute> -
trunk/src/VBox/Main/include/ConsoleImpl.h
r11083 r12126 472 472 int mcAudioRefs; 473 473 volatile uint32_t mcVRDPClients; 474 uint32_t mu32SingleRDPClientId; /* The id of a connected client in the single connection mode. */ 474 475 475 476 static const char *sSSMConsoleUnit; -
trunk/src/VBox/Main/include/ConsoleVRDPServer.h
r11820 r12126 98 98 99 99 void EnableConnections (void); 100 void DisconnectClient (uint32_t u32ClientId, bool fReconnect); 100 101 void MousePointerUpdate (const VRDPCOLORPOINTER *pPointer); 101 102 void MousePointerHide (void); -
trunk/src/VBox/Main/include/VRDPServerImpl.h
r8155 r12126 49 49 mAuthType == that.mAuthType && 50 50 mAuthTimeout == that.mAuthTimeout && 51 mAllowMultiConnection == that.mAllowMultiConnection); 51 mAllowMultiConnection == that.mAllowMultiConnection && 52 mReuseSingleConnection == that.mReuseSingleConnection); 52 53 } 53 54 … … 58 59 ULONG mAuthTimeout; 59 60 BOOL mAllowMultiConnection; 61 BOOL mReuseSingleConnection; 60 62 }; 61 63 … … 97 99 STDMETHOD(COMGETTER(AllowMultiConnection)) (BOOL *aAllowMultiConnection); 98 100 STDMETHOD(COMSETTER(AllowMultiConnection)) (BOOL aAllowMultiConnection); 101 STDMETHOD(COMGETTER(ReuseSingleConnection)) (BOOL *aReuseSingleConnection); 102 STDMETHOD(COMSETTER(ReuseSingleConnection)) (BOOL aReuseSingleConnection); 99 103 100 104 // IVRDPServer methods -
trunk/src/VBox/Main/xml/VirtualBox-settings-common.xsd
r12020 r12126 472 472 <xsd:attribute name="authTimeout" type="xsd:unsignedInt" default="5000"/> 473 473 <xsd:attribute name="allowMultiConnection" type="xsd:boolean" default="false"/> 474 <xsd:attribute name="reuseSingleConnection" type="xsd:boolean" default="false"/> 474 475 </xsd:complexType> 475 476
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器