1
0
mirror of https://github.com/dkmstr/openuds.git synced 2024-12-22 13:34:04 +03:00

restricted PAM to only 1 "id" on params

This commit is contained in:
Adolfo Gómez García 2019-05-14 08:22:11 +02:00
parent 8a7ceb926d
commit 7c92d8ad5c
2 changed files with 7 additions and 6 deletions

View File

@ -2,4 +2,4 @@
# uds=http://172.27.0.1:8000
# Or we can get the server from an external file. The path part of the URL inside the file will be removed,
# so, if we put "https://example.com/other", the value of uds configuration will be "https://example.com"
udsfile=/var/ssh_443/etc/uds.conf
udsfile=/etc/uds.conf

View File

@ -49,12 +49,13 @@ def pam(request):
return HttpResponseNotAllowed(['GET'])
if 'id' in request.GET and 'pass' in request.GET:
# This is an "auth" request
logger.debug("Auth request for user [{0}] and pass [{1}]".format(request.GET['id'], request.GET['pass']))
password = TicketStore.get(request.GET['id'])
ids = request.GET.getlist('id')
response = '0'
if password == request.GET['pass']:
response = '1'
if len(ids) == 1:
logger.debug("Auth request for user [{0}] and pass [{1}]".format(request.GET['id'], request.GET['pass']))
password = TicketStore.get(request.GET['id'])
if password == request.GET['pass']:
response = '1'
elif 'uid' in request.GET:
# This is an "get name for id" call
logger.debug("NSS Request for id [{0}]".format(request.GET['uid']))