From b239ff6cab74f9cd9580c5145e43be8a9ce9e5fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adolfo=20G=C3=B3mez=20Garc=C3=ADa?= Date: Tue, 4 Jan 2022 10:38:30 +0100 Subject: [PATCH] Removed "harcoded" msrdc path for mac --- .../uds/transports/RDP/scripts/macosx/direct.py | 14 ++++++++------ .../RDP/scripts/macosx/direct.py.signature | 2 +- .../uds/transports/RDP/scripts/macosx/tunnel.py | 13 +++++++------ .../RDP/scripts/macosx/tunnel.py.signature | 2 +- 4 files changed, 17 insertions(+), 14 deletions(-) diff --git a/server/src/uds/transports/RDP/scripts/macosx/direct.py b/server/src/uds/transports/RDP/scripts/macosx/direct.py index ba9cc770..2e80328b 100644 --- a/server/src/uds/transports/RDP/scripts/macosx/direct.py +++ b/server/src/uds/transports/RDP/scripts/macosx/direct.py @@ -9,11 +9,13 @@ from uds import tools # type: ignore globals()['sp'] = sp # type: ignore # pylint: disable=undefined-variable msrdc = ( - '/Applications/Microsoft Remote Desktop.app/Contents/MacOS/Microsoft Remote Desktop' + '/Applications/Microsoft Remote Desktop.app' ) msrdc_localized = ( - '/Applications/Microsoft Remote Desktop.localized/Microsoft Remote Desktop.app/Contents/MacOS/Microsoft Remote Desktop' + '/Applications/Microsoft Remote Desktop.localized/Microsoft Remote Desktop.app' ) +# msrdc_app = '/Contents/MacOS/Microsoft Remote Desktop' + xfreerdp = tools.findApp('xfreerdp') executable = None @@ -40,9 +42,9 @@ def fixResolution(): # Check first xfreerdp, allow password redir if xfreerdp and os.path.isfile(xfreerdp): executable = xfreerdp -elif os.path.isfile(msrdc) and sp['as_file']: # type: ignore +elif os.path.isdir(msrdc) and sp['as_file']: # type: ignore executable = msrdc -elif os.path.isfile(msrdc_localized) and sp['as_file']: # type: ignore +elif os.path.isdir(msrdc_localized) and sp['as_file']: # type: ignore executable = msrdc_localized if executable is None: @@ -81,7 +83,7 @@ if executable is None: ''' ) -elif executable == msrdc or executable == msrdc_localized: +if executable in (msrdc, msrdc_localized): theFile = sp['as_file'] # type: ignore filename = tools.saveTempFile(theFile) # Rename as .rdp, so open recognizes it @@ -94,7 +96,7 @@ elif executable == msrdc or executable == msrdc_localized: [ 'open', '-a', - '/Applications/Microsoft Remote Desktop.app', + executable, filename + '.rdp', ] ) diff --git a/server/src/uds/transports/RDP/scripts/macosx/direct.py.signature b/server/src/uds/transports/RDP/scripts/macosx/direct.py.signature index 05c56681..a60d123d 100644 --- a/server/src/uds/transports/RDP/scripts/macosx/direct.py.signature +++ b/server/src/uds/transports/RDP/scripts/macosx/direct.py.signature @@ -1 +1 @@ -Zynr5gg1ODuB1OTbsSd8FArXG/Z+1QQpbgdd1HNNQim8iFziDMRTyONLHB/IM/sblYis2rXOkIDfHyJKf3vqefw9XHKCFSkLJ5zrzmIjDJItBuepQuWy3dGRxym7WPjKYmQYYt3G7E6ypqiXvcRaFqUhjpjhkxfczxOQ3JIg7f6rHzrFxpMmcXB3+NG2gIFxN5/Rom2dwb2vuBhsImAIsx4of5VbNQ015wU6calXaxLTqqqlIfhcLrbod/AG/jvegoZTL2B4RHJkJYv7S1vVjzRlfmhOxinqUoh41dRYLCZET5KKufHyLDD/LVJlI7ToALHRXNX1dluBeDOBx1Dan2aTKZS/rz46sj2qld4zLDgmryb0rHX0fF9gj/WLT0RbiFJfvH0mA1hdgp5mYjp+eZZ5R5uVNhI87VJHs9uopAE8RBn3ecibk0Id9qRuumUSPgWkt2/hXOfdomeRJqH2YUcPhSDn7ZzH2/1E54IHlgf25EVCXEofilpAtmZfpg1NdzK5QUrOwNKXb24dicE20iIveKD/5gswovhLsNDijJSFEUE/uRAW0eQBy/jKpb3RiHiYOo+0IPDSd1yrstxwCSJubKhB3JqHjRg+b+mmu3IuU94bpcOk4eawJajNCrR0qYuegC581pxe4UmLBaz3gO80V7JGSYMSMT0ofnz1ViQ= \ No newline at end of file +SijMzRukH+xARWhBXzy3Xu0fCA35ToaOZbn7LhYGxpYAGwMYGz2o6AfproZSSg/PtTwJjurqwGvTGkcS80ZvMMx/xNiHUJw1dUygcKKWBbsra/uEdMTTnkXiZZo61VJAl/Xk74hTbU8f6QEmoZwxXVr+DcrX7kqXhr/YuRxRS16rmWu0mYwu45p45X6tOB5z7ySDXJvjWg8uzdXZwKuUSh0TZi5PKCzzP/u8yVou8t6TkNk4Szh6KA7RcnEzrPzIYnNesfBH0GiFUTo8FYavN4rsTMU3FcYN9dfEy3eqwGsfizJ9c8fXlsYYAS5lO2TyNHq8HwL3uEl1uzihu0Z64pLX5xDC+oSRxMPuFR88XyfzM58bUPbGa/DVnSwKRHJO16tDh4pZ133wO7alSi80VYrgR2OB61LA7NcQlO0iQGjXFSqRoYVXL9mU3yHWngm8jb8UIrXYyyZfKTS46dbqko0BQ2h2n/JPIFS1D0x//rePc5R9Mp/oDrZk1+9JhZ+fPULX/X0jLxxVG9xHhSQ2IscLqswOBbgvqcjsz44+hmdzWwXMABizxMiMk1DOh0caMAKQPvncqCcMwZNsUygLh4GQxxcfLSTFSuEtGgw26sQctmIIhXtcMl0gy/nFY8uvlhwwzVbdbFFumRmB0xyuhYvDOfdFaQrz3i6utuFFaAk= \ No newline at end of file diff --git a/server/src/uds/transports/RDP/scripts/macosx/tunnel.py b/server/src/uds/transports/RDP/scripts/macosx/tunnel.py index 0353b019..47697b9a 100644 --- a/server/src/uds/transports/RDP/scripts/macosx/tunnel.py +++ b/server/src/uds/transports/RDP/scripts/macosx/tunnel.py @@ -31,11 +31,12 @@ def fixResolution(): return list(map(lambda x: x.replace('#WIDTH#', width).replace('#HEIGHT#', height), sp['as_new_xfreerdp_params'])) # type: ignore + msrdc = ( - '/Applications/Microsoft Remote Desktop.app/Contents/MacOS/Microsoft Remote Desktop' + '/Applications/Microsoft Remote Desktop.app' ) msrdc_localized = ( - '/Applications/Microsoft Remote Desktop.localized/Microsoft Remote Desktop.app/Contents/MacOS/Microsoft Remote Desktop' + '/Applications/Microsoft Remote Desktop.localized/Microsoft Remote Desktop.app' ) xfreerdp = tools.findApp('xfreerdp') @@ -44,9 +45,9 @@ executable = None # Check first xfreerdp, allow password redir if xfreerdp and os.path.isfile(xfreerdp): executable = xfreerdp -elif os.path.isfile(msrdc) and sp['as_file']: # type: ignore +elif os.path.isdir(msrdc) and sp['as_file']: # type: ignore executable = msrdc -elif os.path.isfile(msrdc_localized) and sp['as_file']: # type: ignore +elif os.path.isdir(msrdc_localized) and sp['as_file']: # type: ignore executable = msrdc_localized if executable is None: @@ -96,7 +97,7 @@ if fs.check() is False: '

Could not connect to tunnel server.

Please, check your network settings.

' ) -if executable == msrdc or executable == msrdc_localized: +if executable in (msrdc, msrdc_localized): theFile = theFile = sp['as_file'].format(address=address) # type: ignore filename = tools.saveTempFile(theFile) @@ -110,7 +111,7 @@ if executable == msrdc or executable == msrdc_localized: [ 'open', '-a', - '/Applications/Microsoft Remote Desktop.app', + executable, filename + '.rdp', ] ) diff --git a/server/src/uds/transports/RDP/scripts/macosx/tunnel.py.signature b/server/src/uds/transports/RDP/scripts/macosx/tunnel.py.signature index 7d222e6d..a9f656bf 100644 --- a/server/src/uds/transports/RDP/scripts/macosx/tunnel.py.signature +++ b/server/src/uds/transports/RDP/scripts/macosx/tunnel.py.signature @@ -1 +1 @@ -EE3eFjtFJijhoTj6QI1P1DbSfY/pxmb8A2GNP7drfyvmbdK4MagMRJdcKvP9MgRZONAfmj1/xGuzRgTwY6fheeQTAQZhGhzrm5mbraI15eo5PhlSPWKuLFCYUEYatY4Go7clTMA4OWJLG2ApAU+XryM8kTZ4IHpu7Hf//pVIOLPkL4yOsVt7hBTb7VybLyc21UiHY9+w6paiTpiJ0GFQ0jvJBaPUk88gzeyzXxlg6bVGSgDfjCSDd1kKt6CwVzDq4La9xHNIdV6o8iN/kMRFsNE3m9Axr4vSs6GIMHru+DsZZYAeQKIzhgk3jtPUnPEJsWKL35kfWcdH8mqoLVscoZzfPlRHnX1TVwsy/rgUST8osNhRKdZfbP+47iyWpuTPL59HZINbmY87vfut2TpLzTA2t+HC2Yg59gP2SiMRn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