enable autologin only when password is present

This commit is contained in:
citronneur
2014-10-25 20:58:19 +02:00
parent 7d9478d900
commit efae0da553
3 changed files with 8 additions and 3 deletions

View File

@@ -89,11 +89,9 @@ class MyRDPFactory(rdp.ClientFactory):
def clientConnectionLost(self, connector, reason):
reactor.stop()
app.exit()
def clientConnectionFailed(self, connector, reason):
reactor.stop()
app.exit()
def buildObserver(self, controller, addr):
class MyObserver(rdp.RDPClientObserver)

View File

@@ -490,7 +490,7 @@ class RDPInfo(CompositeType):
#code page
self.codePage = UInt32Le()
#support flag
self.flag = UInt32Le(InfoFlag.INFO_MOUSE | InfoFlag.INFO_UNICODE | InfoFlag.INFO_AUTOLOGON | InfoFlag.INFO_LOGONNOTIFY | InfoFlag.INFO_LOGONERRORS)
self.flag = UInt32Le(InfoFlag.INFO_MOUSE | InfoFlag.INFO_UNICODE | InfoFlag.INFO_LOGONNOTIFY | InfoFlag.INFO_LOGONERRORS)
self.cbDomain = UInt16Le(lambda:sizeof(self.domain) - 2)
self.cbUserName = UInt16Le(lambda:sizeof(self.userName) - 2)
self.cbPassword = UInt16Le(lambda:sizeof(self.password) - 2)

View File

@@ -95,6 +95,7 @@ class RDPClientController(pdu.layer.PDUClientListener):
Set password for session
@param password: password of session
"""
self.setAutologon()
self._pduLayer._info.password.value = password
def setDomain(self, domain):
@@ -104,6 +105,12 @@ class RDPClientController(pdu.layer.PDUClientListener):
"""
self._pduLayer._info.domain.value = domain
def setAutologon(self):
"""
@summary: enable autologon
"""
self._pduLayer._info.flag |= pdu.data.InfoFlag.INFO_AUTOLOGON
def addClientObserver(self, observer):
"""
Add observer to RDP protocol