mirror of
https://github.com/dkmstr/openuds.git
synced 2024-12-25 23:21:41 +03:00
Added support for linux environmenv var expansion on parameters for freerdp
This commit is contained in:
parent
d93e5dc566
commit
92e13c48de
@ -1,7 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
#
|
||||
# Copyright (c) 2012-2019 Virtual Cable S.L.
|
||||
# Copyright (c) 2012-2021 Virtual Cable S.L.U.
|
||||
# All rights reservem.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification,
|
||||
@ -83,7 +83,6 @@ class RDPTransport(BaseRDPTransport):
|
||||
|
||||
alsa = BaseRDPTransport.alsa
|
||||
multimedia = BaseRDPTransport.multimedia
|
||||
redirectHome = BaseRDPTransport.redirectHome
|
||||
printerString = BaseRDPTransport.printerString
|
||||
smartcardString = BaseRDPTransport.smartcardString
|
||||
customParameters = BaseRDPTransport.customParameters
|
||||
@ -122,7 +121,6 @@ class RDPTransport(BaseRDPTransport):
|
||||
r.redirectPrinters = self.allowPrinters.isTrue()
|
||||
r.redirectSmartcards = self.allowSmartcards.isTrue()
|
||||
r.redirectDrives = self.allowDrives.value
|
||||
r.redirectHome = self.redirectHome.isTrue()
|
||||
r.redirectSerials = self.allowSerials.isTrue()
|
||||
r.enableClipboard = self.allowClipboard.isTrue()
|
||||
r.redirectAudio = self.allowAudio.isTrue()
|
||||
|
@ -250,13 +250,6 @@ class BaseRDPTransport(transports.Transport):
|
||||
),
|
||||
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,
|
||||
|
@ -124,14 +124,11 @@ class RDPFile:
|
||||
|
||||
if self.redirectDrives != 'false':
|
||||
if self.target == OsDetector.Linux:
|
||||
params.append('/drive:media,/media')
|
||||
params.append('/drive:home,$HOME')
|
||||
else:
|
||||
params.append('/drive:Users,/Users')
|
||||
# params.append('/home-drive')
|
||||
|
||||
if self.redirectHome is True:
|
||||
params.append('/drive:home,/home')
|
||||
|
||||
if self.redirectSerials is True:
|
||||
params.append('/serial:/dev/ttyS0')
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
# * Redistributions in binary form must reproduce the above copyright notice,
|
||||
# this list of conditions and the following disclaimer in the documentation
|
||||
# and/or other materials provided with the distribution.
|
||||
# * Neither the name of Virtual Cable S.L. nor the names of its contributors
|
||||
# * Neither the name of Virtual Cable S.L.U. nor the names of its contributors
|
||||
# may be used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
#
|
||||
@ -29,8 +29,6 @@
|
||||
'''
|
||||
@author: Adolfo Gómez, dkmaster at dkmon dot com
|
||||
'''
|
||||
import random
|
||||
import string
|
||||
import logging
|
||||
import typing
|
||||
|
||||
@ -123,7 +121,6 @@ class TRDPTransport(BaseRDPTransport):
|
||||
|
||||
alsa = BaseRDPTransport.alsa
|
||||
multimedia = BaseRDPTransport.multimedia
|
||||
redirectHome = BaseRDPTransport.redirectHome
|
||||
printerString = BaseRDPTransport.printerString
|
||||
smartcardString = BaseRDPTransport.smartcardString
|
||||
customParameters = BaseRDPTransport.customParameters
|
||||
@ -179,7 +176,6 @@ class TRDPTransport(BaseRDPTransport):
|
||||
r.redirectPrinters = self.allowPrinters.isTrue()
|
||||
r.redirectSmartcards = self.allowSmartcards.isTrue()
|
||||
r.redirectDrives = self.allowDrives.value
|
||||
r.redirectHome = self.redirectHome.isTrue()
|
||||
r.redirectSerials = self.allowSerials.isTrue()
|
||||
r.enableClipboard = self.allowClipboard.isTrue()
|
||||
r.redirectAudio = self.allowAudio.isTrue()
|
||||
|
@ -11,13 +11,15 @@ globals()['sp'] = sp # type: ignore # pylint: disable=undefined-variable
|
||||
|
||||
def execUdsRdp(udsrdp):
|
||||
import subprocess # @Reimport
|
||||
params = [udsrdp] + sp['as_new_xfreerdp_params'] + ['/v:{}'.format(sp['address'])] # type: ignore
|
||||
import os.path
|
||||
params = [os.path.expandvars(i) for i in [udsrdp] + sp['as_new_xfreerdp_params'] + ['/v:{}'.format(sp['address'])]] # type: ignore
|
||||
tools.addTaskToWait(subprocess.Popen(params))
|
||||
|
||||
|
||||
def execNewXFreeRdp(xfreerdp):
|
||||
import subprocess # @Reimport
|
||||
params = [xfreerdp] + sp['as_new_xfreerdp_params'] + ['/v:{}'.format(sp['address'])] # type: ignore
|
||||
import os.path
|
||||
params = [os.path.expandvars(i) for i in [xfreerdp] + sp['as_new_xfreerdp_params'] + ['/v:{}'.format(sp['address'])]] # type: ignore
|
||||
tools.addTaskToWait(subprocess.Popen(params))
|
||||
|
||||
# Try to locate a "valid" version of xfreerdp as first option (<1.1 does not allows drive redirections, so it will not be used if found)
|
||||
|
@ -1 +1 @@
|
||||
eY7ynpCTiB3Y0zGryBe7SAuc426LEi4+UbyAbMmZXi4I8uFA4KnO7lsQfdmfDjIzZqktTWaAQBGy0cRUEypa8fjbPc+TrkQmAJerLE5+DtH1RH2eHm9eH5uQHN7e4tn8vf3NrD5FCYdenOlVXtzCZhauATjy7VyjMha5RfPbuRDfHvNPcAwlE4Ty6Im8oKBa3kLmCczdI1eSKZgrXHrzDOyJYpIAlBE6RknVusGEcPnUbtoPxgBB3/YNIcy3AswToyElrmWeY0egpYm3skcTKtrrvKD5zc74ueTb5WZER0EzCfEZNHPwo6QnCbyo06U5u6dEkBg1kVFIXxEx/OoIXwpWWUWJn08cqVA/g7RNNdkXZ4iB9v4gRducZEpWGJbH8aq0tOSBOgTg7dxN1SGoayXQT0We3pCZL8Utl/gU5FqvCCGBeHE3dq/ELoAlFuq66AHV+stY08cUuURPObvgwrwA18HpmnppXgYY3RXmX8udfxwCCvOzya4iTuzC4mlQTj/QbYvKCtOgnP/upv7bEhu0+bGfTYSyLBKNFPItgIThc0ockn0BxSHuM0Ln2mK5COruhyYh3sNaQALFGST6pcBm2SvfP1HqWKzvB2V6a+xls5yqYtAR9RyHvZ1bc5QouwKNgqjzV9xSclf7QBwPjXTlOXvln6s4dj6LhLyt9kg=
|
||||
dUxR22o4gWcruKdy1oVaJWeIIAWLmR5HGZ+yKKQcT6qoE9fcN4+C7V65XW9/KJZQ4N7qlNgT3UAzQL5HeGvS7GpBXUg4rbmIu5FNlge1PKWKpNmCMeAnvdfye2G1k+U6oIv74HbOnno6PCxoYqjpURJdWgBatgm5susopye0x7Vqa31O2uuysLEoEuQ8REznMFqSJIRfhQwcw4yGXl9jyHFz6LyB4nTV02qJ4BHE7q0VtEdKAKTGOvGmLm3WXsSJrOdVUoLYWv5mOgvHaO/8e1fHq+FEt1yt7wpFAj1wd4FkTFMp7Aujpk8AOKLp8PBw0aWOb1H96v04FIM5S7eWYp1/vrB6P9uFIjr15zpb4svt0KeH2T0XX0psysQdUAcAvddqZM2fCStYCxPGehkF3iZQ5yuKphPP6f8OgWakWDoJZaYnCfq098Qg4NV13W1bukEH8yVnfVT5CeTg0qP5hnYW9vkYS+Srg5QWARU34CsPTyolHcpqa+X7wRjdFV65xZ13OxScjNnlnYp9pJypn16XOPkMc7LACmjs2QlrDnrOuE7QMLrSYBqBpwLPv9fVWYdV1GYdjP+KLbhl4OGZlB4SlwrCBiRibltImzJlLdpEpT7Q2gOm0LEZD2GBcFU7jUnomsl3q/DuPUMkexbEdly+tsBR81lUHQzxrnRSMBA=
|
@ -12,13 +12,15 @@ globals()['sp'] = sp # type: ignore # pylint: disable=undefined-variable
|
||||
|
||||
def execUdsRdp(udsrdp, port):
|
||||
import subprocess # @Reimport
|
||||
params = [udsrdp] + sp['as_new_xfreerdp_params'] + ['/v:127.0.0.1:{}'.format(port)] # type: ignore
|
||||
import os.path
|
||||
params = [os.path.expandvars(i) for i in [udsrdp] + sp['as_new_xfreerdp_params'] + ['/v:127.0.0.1:{}'.format(port)]] # type: ignore
|
||||
tools.addTaskToWait(subprocess.Popen(params))
|
||||
|
||||
|
||||
def execNewXFreeRdp(xfreerdp, port):
|
||||
import subprocess # @Reimport
|
||||
params = [xfreerdp] + sp['as_new_xfreerdp_params'] + ['/v:127.0.0.1:{}'.format(port)] # type: ignore
|
||||
import os.path
|
||||
params = [os.path.expandvars(i) for i in [xfreerdp] + sp['as_new_xfreerdp_params'] + ['/v:127.0.0.1:{}'.format(port)]] # type: ignore
|
||||
tools.addTaskToWait(subprocess.Popen(params))
|
||||
|
||||
# Try to locate a "valid" version of xfreerdp as first option (<1.1 does not allows drive redirections, so it will not be used if found)
|
||||
|
@ -1 +1 @@
|
||||
qohDf0W4PxfiAn8RDcQrZcl3v/V6+B6Zj2Ba2FukDlm+XXEbrNE0dHONXJPd6zTZ+lWRvYrTHKWWyJVgRoN3gxhEghY+iw+4B4yX6uwxynb/DtHNVg8wG1tFzFfGnHCua9E7+iY+5Y6oDJo76tOmLGYZNGmOA0vwn5IDNqIKTqnAPzJnNbpHrePV5LO/xF59aZ2RthxhcBquSpkZA8Hm9z7Hw4oagOysqSknXTxdyeLBxQLc+KpGXhdo8jbD2In+21r/9V3pqFUM5AyL85tl5eunhDDyKt5KvN8vznMFCITxpJWQ8BSWtqOqNiJvhfqSXm3CVlATeLEDOeuVinF/P4AYzw9qybagKyxL0GQTSATXEmarevAKsZ5nvY5wPUx1BL6OloUWXHjlAvSDCBIRyde3ravDWtT+cajQGyinD8Mhb4emOutr/syirKZXDK8orP3L0gEMCqERKHrv0IpbIldyiyZ2Pt85lvtAQ0nYkPBUnA/kodBrESgJ0DVFqZLEx1YhzEEHEVGZuklt/hUpOzOhtTGhT2MHG2la8ANYJo8pQ+QZTaMtZHGH4uI3r6AxrI7DIBa1K5JZn66jC5pFik5Y7KcJR9d+D8QZU8QVFK4pz5oO6RI7xzka48MxhV3CFvRQ+wDeukfOWS1xThpabxPQbsrc0O/KLFkRrzsHHco=
|
||||
Kg6F9WJidlNK2BOlKX1TlgJ02Hl7jJyCMzc4pUoJxCyOlFAGC/nLIM5kslXE0cfZEIV5kryy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