PAM configuration: separate PAM config for settingsd

parent 9a0dad9a
# PAM configuration for the settingsd service
# Standard Un*x authentication.
@include common-auth
......@@ -7,13 +7,14 @@ from pamela import authenticate, change_password, PAMError
SERVICE_NAME = "pam_authentication"
PAM_SERVICE_NAME = "settingsd"
class PamAuthentication(service.FunctionObject) :
@service.functionMethod("pam", in_signature="ss", out_signature="b")
def authenticate(self, login, password):
try:
authenticate(login, password)
authenticate(login, password, service=PAM_SERVICE_NAME)
return True
except PAMError:
return False
......@@ -23,7 +24,7 @@ class PamAuthentication(service.FunctionObject) :
if len(new_password) == 0:
return False
try:
change_password(login, new_password)
change_password(login, new_password, service=PAM_SERVICE_NAME)
return True
except PAMError as 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