diff --git a/server/src/uds/transports/RDP/scripts/linux/direct.py b/server/src/uds/transports/RDP/scripts/linux/direct.py index 9455de6a9..2fad82da2 100644 --- a/server/src/uds/transports/RDP/scripts/linux/direct.py +++ b/server/src/uds/transports/RDP/scripts/linux/direct.py @@ -23,8 +23,8 @@ def execNewXFreeRdp(xfreerdp): # Try to locate a xfreerdp and udsrdp. udsrdp will be used if found. -xfreerdp = tools.findApp('xfreerdp') -udsrdp = tools.findApp('udsrdp') +xfreerdp = tools.find_application('xfreerdp') +udsrdp = tools.find_application('udsrdp') fnc, app = None, None if xfreerdp: diff --git a/server/src/uds/transports/RDP/scripts/linux/tunnel.py b/server/src/uds/transports/RDP/scripts/linux/tunnel.py index 58dc078f2..1a48cb88b 100644 --- a/server/src/uds/transports/RDP/scripts/linux/tunnel.py +++ b/server/src/uds/transports/RDP/scripts/linux/tunnel.py @@ -25,8 +25,8 @@ def execNewXFreeRdp(xfreerdp, port): # Try to locate a xfreerdp and udsrdp. udsrdp will be used if found. -xfreerdp = tools.findApp('xfreerdp') -udsrdp = tools.findApp('udsrdp') +xfreerdp = tools.find_application('xfreerdp') +udsrdp = tools.find_application('udsrdp') fnc, app = None, None if xfreerdp: diff --git a/server/src/uds/transports/RDP/scripts/macosx/direct.py b/server/src/uds/transports/RDP/scripts/macosx/direct.py index e77c0ae78..f29ddef1f 100644 --- a/server/src/uds/transports/RDP/scripts/macosx/direct.py +++ b/server/src/uds/transports/RDP/scripts/macosx/direct.py @@ -16,7 +16,7 @@ msrdc_localized = ( ) # msrdc_app = '/Contents/MacOS/Microsoft Remote Desktop' -xfreerdp = tools.findApp('xfreerdp') +xfreerdp = tools.find_application('xfreerdp') executable = None @@ -85,7 +85,7 @@ if executable is None: ) if executable in (msrdc, msrdc_localized): theFile = sp['as_file'] # type: ignore - filename = tools.saveTempFile(theFile) + filename = tools.save_temp_file(theFile) # Rename as .rdp, so open recognizes it shutil.move(filename, filename + '.rdp') @@ -101,7 +101,7 @@ if executable in (msrdc, msrdc_localized): ] ) ) - tools.addFileToUnlink(filename + '.rdp') + tools.register_for_delayed_deletion(filename + '.rdp') elif executable == xfreerdp: # Fix resolution... try: diff --git a/server/src/uds/transports/RDP/scripts/macosx/tunnel.py b/server/src/uds/transports/RDP/scripts/macosx/tunnel.py index d7c9f3469..dff1fcbd1 100644 --- a/server/src/uds/transports/RDP/scripts/macosx/tunnel.py +++ b/server/src/uds/transports/RDP/scripts/macosx/tunnel.py @@ -38,7 +38,7 @@ msrdc_localized = ( '/Applications/Microsoft Remote Desktop.localized/Microsoft Remote Desktop.app' ) -xfreerdp = tools.findApp('xfreerdp') +xfreerdp = tools.find_application('xfreerdp') executable = None # Check first xfreerdp, allow password redir @@ -99,7 +99,7 @@ if fs.check() is False: if executable in (msrdc, msrdc_localized): theFile = theFile = sp['as_file'].format(address=address) # type: ignore - filename = tools.saveTempFile(theFile) + filename = tools.save_temp_file(theFile) # Rename as .rdp, so open recognizes it shutil.move(filename, filename + '.rdp') @@ -115,7 +115,7 @@ if executable in (msrdc, msrdc_localized): ] ) ) - tools.addFileToUnlink(filename + '.rdp') + tools.register_for_delayed_deletion(filename + '.rdp') elif executable == xfreerdp: # Fix resolution... try: diff --git a/server/src/uds/transports/RDP/scripts/windows/direct.py b/server/src/uds/transports/RDP/scripts/windows/direct.py index 24d4ba47c..5d8df0b9f 100644 --- a/server/src/uds/transports/RDP/scripts/windows/direct.py +++ b/server/src/uds/transports/RDP/scripts/windows/direct.py @@ -38,7 +38,7 @@ except Exception as e: # nosec: Not really interested in the exception # The password must be encoded, to be included in a .rdp file, as 'UTF-16LE' before protecting (CtrpyProtectData) it in order to work with mstsc theFile = sp['as_file'].format(password=password) # type: ignore -filename = tools.saveTempFile(theFile) +filename = tools.save_temp_file(theFile) if sp['optimize_teams'] == True: # type: ignore try: @@ -52,7 +52,7 @@ if sp['optimize_teams'] == True: # type: ignore filename = filename + '.rdp' os.startfile(filename) # type: ignore # nosec else: - executable = tools.findApp('mstsc.exe') + executable = tools.find_application('mstsc.exe') if executable is None: raise Exception( 'Unable to find mstsc.exe. Check that path points to your SYSTEM32 folder' @@ -60,4 +60,4 @@ else: subprocess.Popen([executable, filename]) # nosec -tools.addFileToUnlink(filename) +tools.register_for_delayed_deletion(filename) diff --git a/server/src/uds/transports/RDP/scripts/windows/tunnel.py b/server/src/uds/transports/RDP/scripts/windows/tunnel.py index 8feb5b147..b27617177 100644 --- a/server/src/uds/transports/RDP/scripts/windows/tunnel.py +++ b/server/src/uds/transports/RDP/scripts/windows/tunnel.py @@ -45,7 +45,7 @@ theFile = sp['as_file'].format( # type: ignore password=password, address='127.0.0.1:{}'.format(fs.server_address[1]) ) -filename = tools.saveTempFile(theFile) +filename = tools.save_temp_file(theFile) if sp['optimize_teams']: # type: ignore try: @@ -58,10 +58,10 @@ if sp['optimize_teams']: # type: ignore filename = filename + '.rdp' os.startfile(filename) # type: ignore # nosec else: - executable = tools.findApp('mstsc.exe') + executable = tools.find_application('mstsc.exe') if executable is None: raise Exception('Unable to find mstsc.exe. Check that path points to your SYSTEM32 folder') subprocess.Popen([executable, filename]) # nosec -# tools.addFileToUnlink(filename) +# tools.register_for_delayed_deletion(filename) diff --git a/server/src/uds/transports/SPICE/scripts/linux/direct.py b/server/src/uds/transports/SPICE/scripts/linux/direct.py index 62e527329..0c7f2ee51 100644 --- a/server/src/uds/transports/SPICE/scripts/linux/direct.py +++ b/server/src/uds/transports/SPICE/scripts/linux/direct.py @@ -7,7 +7,7 @@ import subprocess from uds import tools # type: ignore -executable = tools.findApp('remote-viewer') +executable = tools.find_application('remote-viewer') if executable is None: raise Exception( @@ -20,6 +20,6 @@ if executable is None: theFile = sp['as_file'] # type: ignore -filename = tools.saveTempFile(theFile) +filename = tools.save_temp_file(theFile) subprocess.Popen([executable, filename]) diff --git a/server/src/uds/transports/SPICE/scripts/linux/tunnel.py b/server/src/uds/transports/SPICE/scripts/linux/tunnel.py index 05133f562..775f13b5b 100644 --- a/server/src/uds/transports/SPICE/scripts/linux/tunnel.py +++ b/server/src/uds/transports/SPICE/scripts/linux/tunnel.py @@ -8,7 +8,7 @@ import subprocess from uds import tools # type: ignore from uds.tunnel import forward # type: ignore -executable = tools.findApp('remote-viewer') +executable = tools.find_application('remote-viewer') if executable is None: raise Exception( @@ -52,5 +52,5 @@ theFile = theFile.format( port='-1' if not fs else fs.server_address[1], ) -filename = tools.saveTempFile(theFile) +filename = tools.save_temp_file(theFile) subprocess.Popen([executable, filename]) diff --git a/server/src/uds/transports/SPICE/scripts/macosx/direct.py b/server/src/uds/transports/SPICE/scripts/macosx/direct.py index 3f601b961..5950d5e47 100644 --- a/server/src/uds/transports/SPICE/scripts/macosx/direct.py +++ b/server/src/uds/transports/SPICE/scripts/macosx/direct.py @@ -29,6 +29,6 @@ if not os.path.isfile(remoteViewer): theFile = sp['as_file'] # type: ignore -filename = tools.saveTempFile(theFile) +filename = tools.save_temp_file(theFile) subprocess.Popen([remoteViewer, filename]) diff --git a/server/src/uds/transports/SPICE/scripts/macosx/tunnel.py b/server/src/uds/transports/SPICE/scripts/macosx/tunnel.py index 42c931325..d7a134d03 100644 --- a/server/src/uds/transports/SPICE/scripts/macosx/tunnel.py +++ b/server/src/uds/transports/SPICE/scripts/macosx/tunnel.py @@ -56,5 +56,5 @@ theFile = theFile.format( port='-1' if not fs else fs.server_address[1], ) -filename = tools.saveTempFile(theFile) +filename = tools.save_temp_file(theFile) subprocess.Popen([remoteViewer, filename]) diff --git a/server/src/uds/transports/SPICE/scripts/windows/direct.py b/server/src/uds/transports/SPICE/scripts/windows/direct.py index 446b0594c..49d24945a 100644 --- a/server/src/uds/transports/SPICE/scripts/windows/direct.py +++ b/server/src/uds/transports/SPICE/scripts/windows/direct.py @@ -16,7 +16,7 @@ for env in ('PROGRAMFILES', 'PROGRAMW6432'): if env in os.environ: extraPaths += tuple(p + '\\bin' for p in glob.glob(os.environ[env] + '\\VirtViewer*')) # type: ignore -executable = tools.findApp('remote-viewer.exe', extraPaths) +executable = tools.find_application('remote-viewer.exe', extraPaths) if executable is None: raise Exception( @@ -32,6 +32,6 @@ if executable is None: theFile = sp['as_file'] # type: ignore -filename = tools.saveTempFile(theFile) +filename = tools.save_temp_file(theFile) subprocess.Popen([executable, filename]) diff --git a/server/src/uds/transports/SPICE/scripts/windows/tunnel.py b/server/src/uds/transports/SPICE/scripts/windows/tunnel.py index 4a1ae37b2..4e32ca880 100644 --- a/server/src/uds/transports/SPICE/scripts/windows/tunnel.py +++ b/server/src/uds/transports/SPICE/scripts/windows/tunnel.py @@ -17,7 +17,7 @@ for env in ('PROGRAMFILES', 'PROGRAMW6432'): if env in os.environ: extraPaths += tuple(p + '\\bin' for p in glob.glob(os.environ[env] + '\\VirtViewer*')) # type: ignore -executable = tools.findApp('remote-viewer.exe', extraPaths) +executable = tools.find_application('remote-viewer.exe', extraPaths) if executable is None: raise Exception( @@ -59,6 +59,6 @@ theFile = theFile.format( port='-1' if not fs else fs.server_address[1], ) -filename = tools.saveTempFile(theFile) +filename = tools.save_temp_file(theFile) subprocess.Popen([executable, filename]) diff --git a/server/src/uds/transports/X2GO/scripts/linux/direct.py b/server/src/uds/transports/X2GO/scripts/linux/direct.py index 404d13419..7d32c8530 100644 --- a/server/src/uds/transports/X2GO/scripts/linux/direct.py +++ b/server/src/uds/transports/X2GO/scripts/linux/direct.py @@ -9,13 +9,13 @@ from os.path import expanduser from uds import tools # type: ignore home = expanduser('~') + ':1;/media:1;' -keyFile = tools.saveTempFile(sp['key']) # type: ignore +keyFile = tools.save_temp_file(sp['key']) # type: ignore theFile = sp['xf'].format(export=home, keyFile=keyFile.replace('\\', '/'), ip=sp['ip'], port=sp['port']) # type: ignore -filename = tools.saveTempFile(theFile) +filename = tools.save_temp_file(theFile) # HOME=[temporal folder, where we create a .x2goclient folder and a sessions inside] pyhoca-cli -P UDS/test-session -executable = tools.findApp('x2goclient') +executable = tools.find_application('x2goclient') if executable is None: raise Exception( '''

You must have installed latest X2GO Client in order to connect to this UDS service.

@@ -33,5 +33,5 @@ subprocess.Popen( '--add-to-known-hosts', ] ) -# tools.addFileToUnlink(filename) -# tools.addFileToUnlink(keyFile) +# tools.register_for_delayed_deletion(filename) +# tools.register_for_delayed_deletion(keyFile) diff --git a/server/src/uds/transports/X2GO/scripts/linux/tunnel.py b/server/src/uds/transports/X2GO/scripts/linux/tunnel.py index 4c348461e..8b83da4ee 100644 --- a/server/src/uds/transports/X2GO/scripts/linux/tunnel.py +++ b/server/src/uds/transports/X2GO/scripts/linux/tunnel.py @@ -20,13 +20,13 @@ if fs.check() is False: ) home = expanduser('~') + ':1;/media:1;' -keyFile = tools.saveTempFile(sp['key']) # type: ignore +keyFile = tools.save_temp_file(sp['key']) # type: ignore theFile = sp['xf'].format(export=home, keyFile=keyFile.replace('\\', '/'), ip='127.0.0.1', port=fs.server_address[1]) # type: ignore -filename = tools.saveTempFile(theFile) +filename = tools.save_temp_file(theFile) # HOME=[temporal folder, where we create a .x2goclient folder and a sessions inside] pyhoca-cli -P UDS/test-session -executable = tools.findApp('x2goclient') +executable = tools.find_application('x2goclient') if executable is None: raise Exception( '''

You must have installed latest X2GO Client in order to connect to this UDS service.

diff --git a/server/src/uds/transports/X2GO/scripts/windows/direct.py b/server/src/uds/transports/X2GO/scripts/windows/direct.py index 71b638426..851825837 100644 --- a/server/src/uds/transports/X2GO/scripts/windows/direct.py +++ b/server/src/uds/transports/X2GO/scripts/windows/direct.py @@ -10,13 +10,13 @@ from os.path import expanduser from uds import tools # type: ignore home = expanduser('~').replace('\\', '\\\\') + '#1;' -keyFile = tools.saveTempFile(sp['key']) # type: ignore +keyFile = tools.save_temp_file(sp['key']) # type: ignore # On windows, the separator beween active and not is "#" theFile = sp['xf'].format(export='c:\\\\#1;', keyFile=keyFile.replace('\\', '/'), ip=sp['ip'], port=sp['port']) # type: ignore -filename = tools.saveTempFile(theFile) +filename = tools.save_temp_file(theFile) x2goPath = os.environ['PROGRAMFILES(X86)'] + '\\x2goclient' -executable = tools.findApp('x2goclient.exe', [x2goPath]) +executable = tools.find_application('x2goclient.exe', [x2goPath]) if executable is None: raise Exception( '''

You must have installed latest X2GO Client in order to connect to this UDS service.

@@ -36,5 +36,5 @@ subprocess.Popen( '--add-to-known-hosts', ] ) -# tools.addFileToUnlink(filename) -# tools.addFileToUnlink(keyFile) +# tools.register_for_delayed_deletion(filename) +# tools.register_for_delayed_deletion(keyFile) diff --git a/server/src/uds/transports/X2GO/scripts/windows/tunnel.py b/server/src/uds/transports/X2GO/scripts/windows/tunnel.py index b7b79750e..715f05079 100644 --- a/server/src/uds/transports/X2GO/scripts/windows/tunnel.py +++ b/server/src/uds/transports/X2GO/scripts/windows/tunnel.py @@ -22,12 +22,12 @@ if fs.check() is False: # Care, expanduser is encoding using "mcbs", so treat it as bytes on python 2.7 home = expanduser('~').replace('\\', '\\\\') + '#1;' -keyFile = tools.saveTempFile(sp['key']) # type: ignore +keyFile = tools.save_temp_file(sp['key']) # type: ignore theFile = sp['xf'].format(export=home, keyFile=keyFile.replace('\\', '/'), ip='127.0.0.1', port=fs.server_address[1]) # type: ignore -filename = tools.saveTempFile(theFile) +filename = tools.save_temp_file(theFile) x2goPath = os.environ['PROGRAMFILES(X86)'] + '\\x2goclient' -executable = tools.findApp('x2goclient.exe', [x2goPath]) +executable = tools.find_application('x2goclient.exe', [x2goPath]) if executable is None: raise Exception( '''

You must have installed latest X2GO Client in default program file folder in order to connect to this UDS service.