mirror of
https://github.com/dkmstr/openuds.git
synced 2024-12-23 17:34:17 +03:00
restricted PAM to only 1 "id" on params
This commit is contained in:
parent
8a7ceb926d
commit
7c92d8ad5c
@ -2,4 +2,4 @@
|
|||||||
# uds=http://172.27.0.1:8000
|
# 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,
|
# 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"
|
# 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
|
||||||
|
@ -49,12 +49,13 @@ def pam(request):
|
|||||||
return HttpResponseNotAllowed(['GET'])
|
return HttpResponseNotAllowed(['GET'])
|
||||||
if 'id' in request.GET and 'pass' in request.GET:
|
if 'id' in request.GET and 'pass' in request.GET:
|
||||||
# This is an "auth" request
|
# This is an "auth" request
|
||||||
|
ids = request.GET.getlist('id')
|
||||||
|
response = '0'
|
||||||
|
if len(ids) == 1:
|
||||||
logger.debug("Auth request for user [{0}] and pass [{1}]".format(request.GET['id'], request.GET['pass']))
|
logger.debug("Auth request for user [{0}] and pass [{1}]".format(request.GET['id'], request.GET['pass']))
|
||||||
password = TicketStore.get(request.GET['id'])
|
password = TicketStore.get(request.GET['id'])
|
||||||
response = '0'
|
|
||||||
if password == request.GET['pass']:
|
if password == request.GET['pass']:
|
||||||
response = '1'
|
response = '1'
|
||||||
|
|
||||||
elif 'uid' in request.GET:
|
elif 'uid' in request.GET:
|
||||||
# This is an "get name for id" call
|
# This is an "get name for id" call
|
||||||
logger.debug("NSS Request for id [{0}]".format(request.GET['uid']))
|
logger.debug("NSS Request for id [{0}]".format(request.GET['uid']))
|
||||||
|
Loading…
Reference in New Issue
Block a user