1
0
mirror of https://github.com/dkmstr/openuds.git synced 2025-03-11 00:58:39 +03:00

Fixes for passwords

This commit is contained in:
Adolfo Gómez García 2018-07-18 22:44:23 +02:00
parent fbbdc529fe
commit 4777b7e8f9
4 changed files with 7 additions and 4 deletions

View File

@ -36,6 +36,7 @@ from django.http import HttpResponse
from uds.models import TicketStore
from uds.core.util import net
from uds.core.auths import auth
from uds.core.managers import cryptoManager
import logging
@ -57,6 +58,7 @@ def guacamole(request, tunnelId):
try:
val = TicketStore.get(tunnelId, invalidate=False)
val['password'] = cryptoManager().decrypt(val['password'])
response = dict2resp(val)
except Exception:

View File

@ -44,6 +44,7 @@ from uds.core.transports.BaseTransport import TUNNELED_GROUP
from uds.core.transports import protocols
from uds.core.util import connection
from uds.core.util import OsDetector
from uds.core.managers import cryptoManager
from uds.models import TicketStore
import logging
@ -194,7 +195,7 @@ class HTML5RDPTransport(Transport):
'protocol': 'rdp',
'hostname': ip,
'username': username,
'password': password,
'password': cryptoManager().encrypt(password),
'ignore-cert': 'true',
'security': self.security.value,
'drive-path': '/share/{}'.format(user.uuid),

View File

@ -27,8 +27,8 @@ def execRdesktop(rdesktop):
import subprocess # @Reimport
params = [rdesktop] + {m.r.as_rdesktop_params} + ['{m.r.address}'] # @UndefinedVariable
p = subprocess.Popen(params, stdin=subprocess.PIPE)
if '{m.password}' != '':
p.stdin.write('{m.password}')
if """{m.password}""" != '':
p.stdin.write("""{m.password}""")
p.stdin.close()
tools.addTaskToWait(p)

View File

@ -29,7 +29,7 @@ def execRdesktop(rdesktop, port):
params = [rdesktop] + {m.r.as_rdesktop_params} + ['127.0.0.1:{{}}'.format(port)] # @UndefinedVariable
p = subprocess.Popen(params, stdin=subprocess.PIPE)
if {m.hasCredentials}: # @UndefinedVariable
p.stdin.write('{m.password}')
p.stdin.write("""{m.password}""")
p.stdin.close()
tools.addTaskToWait(p)