From bbcc06f503788693e370a19c911cb50788cb2268 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adolfo=20G=C3=B3mez=20Garc=C3=ADa?= Date: Thu, 21 Dec 2017 19:04:06 +0100 Subject: [PATCH] Fixes on RDP for Linux. On linux client freerdp 1.1, seems that /home-drive with /drive:media,/media and /printer makes the client fail. (Works fine with 2.0). We have replaced so: 1.- Now by default, on linux, redirect drives redirects /media 2.- You can check "redirect home" so /home is also redirected (take care, /home, not home folder) 3.- If you want /home-drives, you can include it on "custom parameters" --- server/src/uds/transports/RDP/BaseRDPTransport.py | 9 +++++---- server/src/uds/transports/RDP/RDPFile.py | 15 +++++++++++---- server/src/uds/transports/RDP/RDPTransport.py | 6 ++++-- server/src/uds/transports/RDP/TRDPTransport.py | 6 ++++-- 4 files changed, 24 insertions(+), 12 deletions(-) diff --git a/server/src/uds/transports/RDP/BaseRDPTransport.py b/server/src/uds/transports/RDP/BaseRDPTransport.py index c938996fa..d6df74764 100644 --- a/server/src/uds/transports/RDP/BaseRDPTransport.py +++ b/server/src/uds/transports/RDP/BaseRDPTransport.py @@ -42,7 +42,7 @@ from uds.core.util import connection import logging import os -__updated__ = '2017-12-18' +__updated__ = '2017-12-21' logger = logging.getLogger(__name__) @@ -104,9 +104,10 @@ class BaseRDPTransport(Transport): multimedia = gui.CheckBoxField(label=_('Multimedia sync'), order=40, tooltip=_('If checked. Linux client will use multimedia parameter for xfreerdp'), tab='Linux Client') alsa = gui.CheckBoxField(label=_('Use Alsa'), order=41, tooltip=_('If checked, Linux client will try to use ALSA, otherwise Pulse will be used'), tab='Linux Client') - printerString = gui.TextField(label=_('Printer string'), order=42, tooltip=_('If printer is checked, the printer string used with xfreerdp client'), tab='Linux Client') - smartcardString = gui.TextField(label=_('Smartcard string'), order=43, tooltip=_('If smartcard is checked, the smartcard string used with xfreerdp client'), tab='Linux Client') - customParameters = gui.TextField(label=_('Custom parameters'), order=44, tooltip=_('If not empty, extra parameter to include for Linux Client (for example /usb:id,dev:054c:0268, or aything compatible with your xfreerdp client)'), tab='Linux Client') + redirectHome = gui.CheckBoxField(label=_('Redirect home folder'), order=42, tooltip=_('If checked, Linux client will try to redirect /home local folder'), tab='Linux Client', defvalue=gui.FALSE) + printerString = gui.TextField(label=_('Printer string'), order=43, tooltip=_('If printer is checked, the printer string used with xfreerdp client'), tab='Linux Client') + smartcardString = gui.TextField(label=_('Smartcard string'), order=44, tooltip=_('If smartcard is checked, the smartcard string used with xfreerdp client'), tab='Linux Client') + customParameters = gui.TextField(label=_('Custom parameters'), order=45, tooltip=_('If not empty, extra parameter to include for Linux Client (for example /usb:id,dev:054c:0268, or aything compatible with your xfreerdp client)'), tab='Linux Client') def isAvailableFor(self, userService, ip): ''' diff --git a/server/src/uds/transports/RDP/RDPFile.py b/server/src/uds/transports/RDP/RDPFile.py index a3053d31b..335529919 100644 --- a/server/src/uds/transports/RDP/RDPFile.py +++ b/server/src/uds/transports/RDP/RDPFile.py @@ -39,7 +39,7 @@ from uds.core.util import OsDetector import six import shlex -__updated__ = '2017-12-19' +__updated__ = '2017-12-21' class RDPFile(object): @@ -54,6 +54,7 @@ class RDPFile(object): redirectSerials = False redirectPrinters = False redirectDrives = False + redirectHome = False redirectSmartcards = False redirectAudio = True compression = True @@ -120,13 +121,19 @@ class RDPFile(object): if self.redirectDrives is True: params.append('/drive:media,/media') - params.append('/home-drive') + # params.append('/home-drive') + + if self.redirectHome is True: + params.append('/drive:home,/home') if self.redirectSerials is True: params.append('/serial:/dev/ttyS0') - if self.redirectPrinters and self.printerString not in (None, ''): - params.append('/printer:{}'.format(self.printerString)) + if self.redirectPrinters: + if self.printerString not in (None, ''): + params.append('/printer:{}'.format(self.printerString)) + else: + params.append('/printer') if self.compression: params.append('/compression:on') diff --git a/server/src/uds/transports/RDP/RDPTransport.py b/server/src/uds/transports/RDP/RDPTransport.py index 178f4754f..cd9bf55a6 100644 --- a/server/src/uds/transports/RDP/RDPTransport.py +++ b/server/src/uds/transports/RDP/RDPTransport.py @@ -44,7 +44,7 @@ logger = logging.getLogger(__name__) READY_CACHE_TIMEOUT = 30 -__updated__ = '2017-12-20' +__updated__ = '2017-12-21' class RDPTransport(BaseRDPTransport): @@ -73,12 +73,13 @@ class RDPTransport(BaseRDPTransport): aero = BaseRDPTransport.aero smooth = BaseRDPTransport.smooth credssp = BaseRDPTransport.credssp - multimedia = BaseRDPTransport.multimedia screenSize = BaseRDPTransport.screenSize colorDepth = BaseRDPTransport.colorDepth alsa = BaseRDPTransport.alsa + multimedia = BaseRDPTransport.multimedia + redirectHome = BaseRDPTransport.redirectHome printerString = BaseRDPTransport.printerString smartcardString = BaseRDPTransport.smartcardString customParameters = BaseRDPTransport.customParameters @@ -103,6 +104,7 @@ class RDPTransport(BaseRDPTransport): r.redirectPrinters = self.allowPrinters.isTrue() r.redirectSmartcards = self.allowSmartcards.isTrue() r.redirectDrives = self.allowDrives.isTrue() + r.redirectHome = self.redirectHome.isTrue() r.redirectSerials = self.allowSerials.isTrue() r.enableClipboard = self.allowClipboard.isTrue() r.redirectAudio = self.allowAudio.isTrue() diff --git a/server/src/uds/transports/RDP/TRDPTransport.py b/server/src/uds/transports/RDP/TRDPTransport.py index 9bee4288d..752d36c37 100644 --- a/server/src/uds/transports/RDP/TRDPTransport.py +++ b/server/src/uds/transports/RDP/TRDPTransport.py @@ -48,7 +48,7 @@ import logging import random import string -__updated__ = '2017-12-20' +__updated__ = '2017-12-21' logger = logging.getLogger(__name__) @@ -89,12 +89,13 @@ class TRDPTransport(BaseRDPTransport): aero = BaseRDPTransport.aero smooth = BaseRDPTransport.smooth credssp = BaseRDPTransport.credssp - multimedia = BaseRDPTransport.multimedia screenSize = BaseRDPTransport.screenSize colorDepth = BaseRDPTransport.colorDepth alsa = BaseRDPTransport.alsa + multimedia = BaseRDPTransport.multimedia + redirectHome = BaseRDPTransport.redirectHome printerString = BaseRDPTransport.printerString smartcardString = BaseRDPTransport.smartcardString customParameters = BaseRDPTransport.customParameters @@ -131,6 +132,7 @@ class TRDPTransport(BaseRDPTransport): r.redirectPrinters = self.allowPrinters.isTrue() r.redirectSmartcards = self.allowSmartcards.isTrue() r.redirectDrives = self.allowDrives.isTrue() + r.redirectHome = self.redirectHome.isTrue() r.redirectSerials = self.allowSerials.isTrue() r.enableClipboard = self.allowClipboard.isTrue() r.redirectAudio = self.allowAudio.isTrue()