1
0
mirror of https://github.com/dkmstr/openuds.git synced 2025-03-20 06:50:23 +03:00

Remove 'optimize teams' functionality from RDP transport classes and scripts

This commit is contained in:
Adolfo Gómez García 2025-03-12 19:17:14 +01:00
parent d94e15a340
commit aaed98d3b8
No known key found for this signature in database
GPG Key ID: DD1ABF20724CDA23
6 changed files with 6 additions and 38 deletions

View File

@ -97,7 +97,6 @@ class RDPTransport(BaseRDPTransport):
lnx_custom_parameters = BaseRDPTransport.lnx_custom_parameters
mac_custom_parameters = BaseRDPTransport.mac_custom_parameters
wnd_custom_parameters = BaseRDPTransport.wnd_custom_parameters
wnd_optimize_teams = BaseRDPTransport.wnd_optimize_teams
def get_transport_script( # pylint: disable=too-many-locals
self,
@ -147,7 +146,6 @@ class RDPTransport(BaseRDPTransport):
r.printer_params = self.lnx_printer_string.value
r.enforced_shares = self.enforce_drives.value
r.redir_usb = self.allow_usb_redirection.value
r.optimize_teams = self.wnd_optimize_teams.as_bool()
sp: collections.abc.MutableMapping[str, typing.Any] = {
'password': ci.password,
@ -164,7 +162,6 @@ class RDPTransport(BaseRDPTransport):
sp.update(
{
'as_file': r.as_file,
'optimize_teams': self.wnd_optimize_teams.as_bool(),
}
)
elif os.os == types.os.KnownOS.LINUX:

View File

@ -354,14 +354,6 @@ class BaseRDPTransport(transports.Transport):
old_field_name='customParametersWindows',
)
wnd_optimize_teams = gui.CheckBoxField(
label=_('Optimize Teams'),
order=46,
tooltip=_('If checked, Teams will be optimized (only works on Windows clients)'),
tab='Windows Client',
old_field_name='optimizeTeams',
)
def is_ip_allowed(self, userservice: 'models.UserService', ip: str) -> bool:
"""
Checks if the transport is available for the requested destination ip
@ -434,9 +426,6 @@ class BaseRDPTransport(transports.Transport):
if azure_ad:
username = 'AzureAD\\' + username
if self.wnd_optimize_teams.as_bool():
password = '' # nosec
return types.connections.ConnectionData(
protocol=self.protocol,
username=username,

View File

@ -71,7 +71,6 @@ class RDPFile:
enable_clipboard: bool = False
custom_parameters: typing.Optional[str] = None
enforced_shares: typing.Optional[str] = None
optimize_teams: bool = False
def __init__(
self,
@ -236,7 +235,7 @@ class RDPFile:
if self.username:
res += 'username:s:' + self.username + '\n'
res += 'domain:s:' + self.domain + '\n'
if self.target == types.os.KnownOS.WINDOWS and not self.optimize_teams:
if self.target == types.os.KnownOS.WINDOWS:
res += 'password 51:b:' + password + '\n'
res += 'alternate shell:s:' + '\n'

View File

@ -179,7 +179,6 @@ class TRDPTransport(BaseRDPTransport):
r.printer_params = self.lnx_printer_string.value
r.enforced_shares = self.enforce_drives.value
r.redir_usb = self.allow_usb_redirection.value
r.optimize_teams = self.wnd_optimize_teams.as_bool()
sp: collections.abc.MutableMapping[str, typing.Any] = {
'tunHost': tunnel_host,
@ -199,7 +198,6 @@ class TRDPTransport(BaseRDPTransport):
sp.update(
{
'as_file': r.as_file,
'optimize_teams': self.wnd_optimize_teams.as_bool(),
}
)
elif os.os == types.os.KnownOS.LINUX:

View File

@ -1,6 +1,5 @@
# pyright: reportUnknownMemberType=false,reportUnknownArgumentType=false,reportAttributeAccessIssue=false
import typing
import os
import win32crypt # type: ignore
import codecs
@ -46,24 +45,10 @@ except Exception as e: # nosec: Not really interested in the exception
theFile = sp['as_file'].format(password=password) # type: ignore
filename = tools.saveTempFile(theFile)
if sp['optimize_teams'] == True: # type: ignore
try:
# Very basic check for RDP client from Microsoft Store
h = wreg.OpenKey(wreg.HKEY_CLASSES_ROOT, '.rdp\\OpenWithProgids', 0, wreg.KEY_READ) # type: ignore
h.Close()
except Exception:
raise Exception(
'Required Microsoft Remote Desktop Application is not found. Please, install it from Microsoft store.'
)
# Add .rdp to filename for open with
os.rename(filename, filename + '.rdp')
filename = filename + '.rdp'
os.startfile(filename) # type: ignore # nosec
else:
executable = tools.findApp('mstsc.exe')
if executable is None:
raise Exception('Unable to find mstsc.exe. Check that path points to your SYSTEM32 folder')
executable = tools.findApp('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
subprocess.Popen([executable, filename]) # nosec
# tools.addFileToUnlink(filename)

View File

@ -1 +1 @@
kBJEVUJkPgpeSDRG4H4qcTOKmKhQgFIW1mtGWGvHiyALe/RTrBo8VcA9moZcGADAmZV0TYRmQRU4xQg0yD7A1fAo9ohMCxcszGSuEhbfC7Zk5KMMccqNRDVczRB2Kfc/KjcFcxpvcIMledEnJVWzjgzPdoogVWsNAKzXaRxugRxBa8vKYMaErnc9ffkdyWLMnQJrET7UNqLeOfFkClGdvilq4ARrkaM2IcYyTbpuNiUB6LlZh4ChrNGzMkNBHmUs/njPGd289MV+pkx4IQD3sZZCzXjNXQWIijjvzZ7udydqy6n0m2XMaRLb4RLnqTyQXTMR2IW6sSu4FZ770Mz2aGp6xN1L/RFuJD3llCJCIVshu92EHjG3oUeiNejrPnydy/wFOmaBuBs6s92LUNjpnxQ8zFHnJYSMYOzmV0/Dw+TOGuZqKCJeYsMp76ijwUSIb0UzQdWHYtEu8p7VyQPmHmD5pmI0yIsgqMoaiddmV4t/qk95QMZBWjsU+CdDETSx3F+pDX7q9Z2IDIKWNpT0zVSktNG4FOC8xZL0vJ13f3aOYPPnFzwDePujfqWacFQHmEDIUkYWJuTSvDpaxPdj/JO6eHLIoBsP5Dp7pWxrHKNSgsuSVBaF4hmEiAjY3hTIGpdReRCqurzS6Zsrwd069UmLYTL1BAWCrR4XPzO3zPg=
R3sdB3d7hhz6VEoAGNzdX0vIKgss4Xe1aEU62cTQKIA7Inw2zHkaBK0wRVxZqMYH5Of/iiyMiG+NlKFAWutSrOOthoyVT83RNtDpR4F+vDTZMpW2qopiiK6XbxX5PuJq/E3UWNsnElZasAIpJk9rKqlNEJ+tkycWyDkIYIHxE6M2yrqH+dWx/V3AaDMURtnzuZStzpxPMuEzezNdCI9Kbs1fCwSz18SRSkAtNINiMJbgBV573wwKEUUgKLzRHn1ijRk65OHRVLFDlRgXz/ArN0/nkW/FkQ9pYJW5MosD4TJfptO8QZ104jYPM960maMxOb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