From 45a4dec18fcaf98afbd900479f143523f58024e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adolfo=20G=C3=B3mez=20Garc=C3=ADa?= Date: Tue, 23 May 2023 02:25:35 +0200 Subject: [PATCH 1/2] Fix tunnel removal procedure on Mac Launcher --- client-py3/full/src/UDSClientLauncher.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/client-py3/full/src/UDSClientLauncher.py b/client-py3/full/src/UDSClientLauncher.py index d27b74dc6..fc00bd1d0 100644 --- a/client-py3/full/src/UDSClientLauncher.py +++ b/client-py3/full/src/UDSClientLauncher.py @@ -11,6 +11,7 @@ from PyQt5 import QtCore, QtWidgets, QtGui SCRIPT_NAME = 'UDSClientLauncher' + class UdsApplication(QtWidgets.QApplication): path: str tunnels: typing.List[subprocess.Popen] @@ -22,6 +23,10 @@ class UdsApplication(QtWidgets.QApplication): self.lastWindowClosed.connect(self.closeTunnels) # type: ignore def cleanTunnels(self) -> None: + ''' + Removes all finished tunnels from the list + ''' + def isRunning(p: subprocess.Popen): try: if p.poll() is None: @@ -30,13 +35,13 @@ class UdsApplication(QtWidgets.QApplication): logger.debug('Got error polling subprocess: %s', e) return False - for k in [i for i, tunnel in enumerate(self.tunnels) if not isRunning(tunnel)]: - try: - del self.tunnels[k] - except Exception as e: - logger.debug('Error closing tunnel: %s', e) + # Remove references to finished tunnels, they will be garbage collected + self.tunnels = [tunnel for tunnel in self.tunnels if isRunning(tunnel)] def closeTunnels(self) -> None: + ''' + Finishes all running tunnels + ''' logger.debug('Closing remaining tunnels') for tunnel in self.tunnels: logger.debug('Checking %s - "%s"', tunnel, tunnel.poll()) @@ -70,6 +75,6 @@ def main(args: typing.List[str]): sys.exit(app.exec()) + if __name__ == "__main__": main(args=sys.argv) - From 0363ac3a6acc31582f2f70c0801250f976518e44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adolfo=20G=C3=B3mez=20Garc=C3=ADa?= Date: Tue, 23 May 2023 03:15:34 +0200 Subject: [PATCH 2/2] added /rfx /rfx:gfx to macos by default --- server/src/uds/transports/RDP/rdp_file.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/server/src/uds/transports/RDP/rdp_file.py b/server/src/uds/transports/RDP/rdp_file.py index a832da1a7..bbc77967b 100644 --- a/server/src/uds/transports/RDP/rdp_file.py +++ b/server/src/uds/transports/RDP/rdp_file.py @@ -48,7 +48,7 @@ class RDPFile: address = '' username = '' domain = '' - password = '' + password = '' # nosec: emtpy password is ok here redirectSerials = False redirectPrinters = False redirectDrives = "false" # Can have "true", "false" or "dynamic" @@ -179,7 +179,7 @@ class RDPFile: params.append('/u:{}'.format(self.username)) else: forceRDPSecurity = True - if self.password != '': + if self.password: params.append('/p:{}'.format(self.password)) else: forceRDPSecurity = True @@ -192,10 +192,16 @@ class RDPFile: if self.customParameters and self.customParameters.strip() != '': params += shlex.split(self.customParameters.strip()) + # On MacOSX, /rfx /gfx:rfx are almost inprescindible, as it seems the only way to get a decent performance + if self.target == OsDetector.KnownOS.Macintosh: + for i in ('/rfx', '/gfx:rfx'): + if i not in params: + params.append(i) + return params def getGeneric(self): # pylint: disable=too-many-statements - password = '{password}' + password = '{password}' # nosec: placeholder screenMode = '2' if self.fullScreen else '1' audioMode = '0' if self.redirectAudio else '2' serials = '1' if self.redirectSerials else '0'