Commit b4bd560b authored by Дмитрий Никулин's avatar Дмитрий Никулин Committed by Никита Ефремов

PAM configuration: separate PAM config for settingsd

parent 5355a04b
# PAM configuration for the settingsd service
# Standard Un*x authentication.
@include common-auth
...@@ -7,13 +7,14 @@ from pamela import authenticate, change_password, PAMError ...@@ -7,13 +7,14 @@ from pamela import authenticate, change_password, PAMError
SERVICE_NAME = "pam_authentication" SERVICE_NAME = "pam_authentication"
PAM_SERVICE_NAME = "settingsd"
class PamAuthentication(service.FunctionObject) : class PamAuthentication(service.FunctionObject) :
@service.functionMethod("pam", in_signature="ss", out_signature="b") @service.functionMethod("pam", in_signature="ss", out_signature="b")
def authenticate(self, login, password): def authenticate(self, login, password):
try: try:
authenticate(login, password) authenticate(login, password, service=PAM_SERVICE_NAME)
return True return True
except PAMError: except PAMError:
return False return False
...@@ -23,7 +24,7 @@ class PamAuthentication(service.FunctionObject) : ...@@ -23,7 +24,7 @@ class PamAuthentication(service.FunctionObject) :
if len(new_password) == 0: if len(new_password) == 0:
return False return False
try: try:
change_password(login, new_password) change_password(login, new_password, service=PAM_SERVICE_NAME)
return True return True
except PAMError as err: except PAMError as err:
print(err) print(err)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment