Small fixes for rdp transport

This commit is contained in:
Adolfo Gómez García 2019-09-23 08:33:50 +02:00
parent 01317df1f7
commit 99bfae10ad
5 changed files with 24 additions and 22 deletions

View File

@ -33,18 +33,13 @@ Created on Jul 29, 2011
@author: Adolfo Gómez, dkmaster at dkmon dot com
"""
from __future__ import unicode_literals
import urllib.parse
import shlex
import typing
from uds.core.util import os_detector as OsDetector
__updated__ = '2018-11-22'
class RDPFile(object):
class RDPFile:
fullScreen = False
width = '800'
height = '600'
@ -74,7 +69,14 @@ class RDPFile(object):
linuxCustomParameters = None
enforcedShares: typing.Optional[str] = None
def __init__(self, fullScreen, width, height, bpp, target=OsDetector.Windows):
def __init__(
self,
fullScreen: bool,
width: typing.Union[str, int],
height: typing.Union[str, int],
bpp: str,
target: str = OsDetector.Windows
):
self.width = str(width)
self.height = str(height)
self.bpp = str(bpp)
@ -84,7 +86,7 @@ class RDPFile(object):
def get(self):
if self.target in (OsDetector.Windows, OsDetector.Linux):
return self.getGeneric()
elif self.target == OsDetector.Macintosh:
if self.target == OsDetector.Macintosh:
return self.getMacOsX()
# Unknown target
return ''
@ -94,7 +96,7 @@ class RDPFile(object):
return self.get()
@property
def as_new_xfreerdp_params(self):
def as_new_xfreerdp_params(self): # pylint: disable=too-many-statements,too-many-branches
"""
Parameters for xfreerdp >= 1.1.0 with self rdp description
Note that server is not added
@ -182,7 +184,7 @@ class RDPFile(object):
return params
@property
def as_rdesktop_params(self):
def as_rdesktop_params(self): # pylint: disable=too-many-branches
"""
Parameters for rdestop with self rdp description
Note that server is not added
@ -543,11 +545,11 @@ class RDPFile(object):
<string></string>
</dict>
</plist>'''.format(
desktopSize=desktopSize,
drives=drives,
audioMode=audioMode,
host=self.address,
domain=self.domain,
username=self.username,
wallpaper=wallpaper
)
desktopSize=desktopSize,
drives=drives,
audioMode=audioMode,
host=self.address,
domain=self.domain,
username=self.username,
wallpaper=wallpaper
)

View File

@ -13,7 +13,7 @@ from uds import tools # @UnresolvedImport
globals()['sp'] = sp # type: ignore # pylint: disable=undefined-variable
def execUdsRdp(udsrdp, port):
params = [udsrdp] + sp['as_new_xfreerdp_params'] + ['/v:127.0.0.1:{{}}'.format(port)] # @UndefinedVariable
params = [udsrdp] + sp['as_new_xfreerdp_params'] + ['/v:127.0.0.1:{}'.format(port)] # @UndefinedVariable
tools.addTaskToWait(subprocess.Popen(params))

View File

@ -1 +1 @@
iCvK8Bb74BtCXrSjci47DHFUwcrqNoPL9E4+QyU/I9dYkfSadMApsufBX7q7MSBb8mj0y7N3zUQ2KriAymhcAXVOlzAR4YhnQqHSjE/sh0DJaa1CZY7Ka4QHwE64sG5RQFZDlgBFS6FAuxUgRR5bO9hvE2MeOmkRc/JOOjO+xdx4PwjbrIFf/is4sk5CofJuo4+QCLjGlc5QynVbOpe7a4VsGX8hC3Zwu86TT8iylYVUGQypw+3RsCpKKV5+6KiAQsnzDI5eIK51LJe/Klw77S+JmDhukwcrmxOXXNANiCMIvfX1RdwJBqVdRQn4492ucPw3YTqvf2r5tsBd1oUSKX/qr1dRnayrcvWjVypZh/5s5MY6wvm+0bb7gH78n2qitaD00lMM76KL6nsvv4VzcnneJUzFs/AYeMf/865bMg1VKHTq3dmkbzeXIILVkvs696D9cMKSdDbTir8OTj7BIaQ4JAlJ4u854ZjY4rRdLj6S0OuOi4Hk9wFIa+UPr5NuthC77nlVSGPGEDXLAfApys0FiKQW3EcDlEDfC8L+2Ac0r/mulyqqiAdqzHHKDNVsCQZ6ldi4YP8JpQJjz2pxUnv3f5JL1Q5TkwZ9Ihac6j7iknXklBq6CSIWInG8GQEntmjhyoST88/9JQsM+rXCdduMjvT/SMymGCJMELf7qqY=
mVeXNISYgSRjJfdmw2ml60J80NSHPa3bMSDwiR71cwYRk+6uSolNfk53L7kGLR9SDIsDRIv9ruNV6LrJY2KcnAIkuWkDI62LAX7WCD0nN+H6CRS6Fbk2TFAEh6hgb/saya/mLyDmpxRpqLhuXQhHnnY90E3fWYm+ohoypu5UvqmHtBfvhYxgfGywkY/SEHOqSH4IY2bW8gfWn/4oSC6CRVVLQLsQu6v4InbZBY7GAymxCGDmDoS+CLnDoI6j+pnj9x/B2b0XT5zd3J7Q5vT8q7ZDtQjE7x2t/8WX0ZX57P0kzSuDgxP+zbnlgKD68WjHsGJStWeg67a1YZdEBjc9BoCFziHPhHWiTWNDc3vgKq0+8picI7WlkgNiwdrjGU0xsWvKUbK09w5ZrltW9TwA1OQgnWHQym//lyO3y9LHlhYSdjjLzfZpqmmosHe0Wwr1oN3QqqBIk1jKXNYvfXinfToNAh398Sr+J+IabprGi89ilcxYI+QsIM2jFg3inFw5HzFGM86poaVXL22FKWutUrm7LWZec4UHcZbKDThWNCg5qEB/vXzuGGjg40BsnocsJ6Cay37l78ZPtcCv+AjYgRAJtWyyiPD3JAqVm6EzSrrzKsEkAiH1IfzCod/xkxUTJiJCr32elbi0fD8R39RPiUM00ypDGBA8SXlrdSpgauc=

View File

@ -23,7 +23,7 @@ except Exception:
password = win32crypt.CryptProtectData(thePass, None, None, None, None, 0x05).encode('hex')
try:
key = wreg.OpenKey(wreg.HKEY_CURRENT_USER, 'Software\Microsoft\Terminal Server Client\LocalDevices', 0, wreg.KEY_SET_VALUE) # @UndefinedVariable
key = wreg.OpenKey(wreg.HKEY_CURRENT_USER, 'Software\\Microsoft\\Terminal Server Client\\LocalDevices', 0, wreg.KEY_SET_VALUE) # @UndefinedVariable
wreg.SetValueEx(key, sp['ip'], 0, wreg.REG_DWORD, 255) # @UndefinedVariable
wreg.CloseKey(key) # @UndefinedVariable
except Exception as e:

View File

@ -1 +1 @@
VcCDLuQf448XpN5Bin6YoREHOmzG+LYjPXuy9Bsm4k55bOc5GtYez+LDNsCuDUnH90n4tE6k5g2y9ZS4/baPB8ZBAoLs9QkMApT9ON29uxxie0ZgZtnaKk2jXdpoWCBMocjiFXxi4Z6plFkPG1n4hAynDulkwSkJErsODIqxhPR23k9jFCDknUTuZAal1O8X4g7oQY9t20qpkF73IShKUH1su+aiNl3C+Fsa2sXbTrcR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