diff --git a/server/src/uds/transports/SPICE/RemoteViewerFile.py b/server/src/uds/transports/SPICE/RemoteViewerFile.py index 8fa97b1aa..0aff7aec4 100644 --- a/server/src/uds/transports/SPICE/RemoteViewerFile.py +++ b/server/src/uds/transports/SPICE/RemoteViewerFile.py @@ -8,7 +8,7 @@ import six import os -__updated__ = '2017-02-21' +__updated__ = '2017-03-30' TEMPLATE = '''[virt-viewer] @@ -62,7 +62,14 @@ class RemoteViewerFile(object): def as_file(self): return self.get() - def get(self): + @property + def as_file_ns(self): + return self.get(tls_port=-1) + + def get(self, tls_port=None): + if tls_port is None: + tls_port = self.tls_port + fullscreen = '01'[self.fullscreen] smartcard = '01'[self.smartcard] delete_file = '01'[self.delete_file] @@ -82,6 +89,6 @@ class RemoteViewerFile(object): usb_auto_share=usb_auto_share, delete_file=delete_file, host_subject=self.host_subject if self.tls_port != -1 else '', - ca=ca if self.tls_port != -1 else '', - secure_channel='secure-channels=main;inputs;cursor;playback;record;display;usbredir;smartcard' if self.tls_port != -1 else '' + ca=ca if tls_port != -1 else '', + secure_channel='secure-channels=main;inputs;cursor;playback;record;display;usbredir;smartcard' if tls_port != -1 else '' ) diff --git a/server/src/uds/transports/SPICE/scripts/linux/tunnel.py b/server/src/uds/transports/SPICE/scripts/linux/tunnel.py index 9088020d7..b3b9d62ba 100644 --- a/server/src/uds/transports/SPICE/scripts/linux/tunnel.py +++ b/server/src/uds/transports/SPICE/scripts/linux/tunnel.py @@ -21,6 +21,7 @@ if executable is None: ''') +theFile = '''{m.r.as_file_ns}''' if {m.port} != -1: # @UndefinedVariable forwardThread1, port = forward('{m.tunHost}', '{m.tunPort}', '{m.tunUser}', '{m.tunPass}', '{m.ip}', {m.port}) # @UndefinedVariable @@ -30,6 +31,7 @@ else: port = -1 if {m.secure_port} != -1: # @UndefinedVariable + theFile = '''{m.r.as_file}''' if port != -1: forwardThread2, secure_port = forwardThread1.clone('{m.ip}', {m.secure_port}) # @UndefinedVariable else: @@ -40,7 +42,7 @@ if {m.secure_port} != -1: # @UndefinedVariable else: secure_port = -1 -theFile = '''{m.r.as_file}'''.format( +theFile = theFile.format( secure_port=secure_port, port=port ) diff --git a/server/src/uds/transports/SPICE/scripts/macosx/tunnel.py b/server/src/uds/transports/SPICE/scripts/macosx/tunnel.py index 6496275ab..d9f0d7303 100644 --- a/server/src/uds/transports/SPICE/scripts/macosx/tunnel.py +++ b/server/src/uds/transports/SPICE/scripts/macosx/tunnel.py @@ -25,7 +25,7 @@ if not os.path.isfile(remoteViewer):
''') - +theFile = '''{m.r.as_file_ns}''' if {m.port} != -1: # @UndefinedVariable forwardThread1, port = forward('{m.tunHost}', '{m.tunPort}', '{m.tunUser}', '{m.tunPass}', '{m.ip}', {m.port}) # @UndefinedVariable @@ -35,6 +35,7 @@ else: port = -1 if {m.secure_port} != -1: # @UndefinedVariable + theFile = '''{m.r.as_file}''' if port != -1: forwardThread2, secure_port = forwardThread1.clone('{m.ip}', {m.secure_port}) # @UndefinedVariable else: @@ -45,7 +46,7 @@ if {m.secure_port} != -1: # @UndefinedVariable else: secure_port = -1 -theFile = '''{m.r.as_file}'''.format( +theFile = theFile.format( secure_port=secure_port, port=port ) diff --git a/server/src/uds/transports/SPICE/scripts/windows/tunnel.py b/server/src/uds/transports/SPICE/scripts/windows/tunnel.py index 90cc38c73..5568b5a47 100644 --- a/server/src/uds/transports/SPICE/scripts/windows/tunnel.py +++ b/server/src/uds/transports/SPICE/scripts/windows/tunnel.py @@ -28,7 +28,7 @@ if executable is None: Open download page ''') - +theFile = '''{m.r.as_file_ns}''' if {m.port} != -1: # @UndefinedVariable forwardThread1, port = forward('{m.tunHost}', '{m.tunPort}', '{m.tunUser}', '{m.tunPass}', '{m.ip}', {m.port}) # @UndefinedVariable @@ -38,6 +38,7 @@ else: port = -1 if {m.secure_port} != -1: # @UndefinedVariable + theFile = '''{m.r.as_file}''' if port != -1: forwardThread2, secure_port = forwardThread1.clone('{m.ip}', {m.secure_port}) # @UndefinedVariable else: @@ -49,7 +50,7 @@ if {m.secure_port} != -1: # @UndefinedVariable else: secure_port = -1 -theFile = '''{m.r.as_file}'''.format( +theFile = theFile.format( secure_port=secure_port, port=port )