Add pam_authentication module

parent d638d480
......@@ -148,6 +148,11 @@
<allow send_destination="org.etersoft.settingsd" send_interface="org.etersoft.settingsd.functions.disks.smart"/>
</policy>
<!-- fmod_pam_authentication -->
<policy context="default">
<allow send_destination="org.etersoft.settingsd" send_interface="org.etersoft.settingsd.functions.pam"/>
</policy>
</busconfig>
......
......@@ -27,3 +27,6 @@ enabled = yes
[date_time]
enabled = yes
[pam_authentication]
enabled = yes
import os
from settingsd import const
from settingsd import config
from settingsd import service
from settingsd import shared
from pam import pam
SERVICE_NAME = "pam_authentication"
class PamAuthentication(service.FunctionObject) :
@service.functionMethod("pam", in_signature="ss", out_signature="b")
def authenticate(self, login, password):
authenticator = pam()
return authenticator.authenticate(login, password)
class Service(service.Service) :
def initService(self):
shared.Functions.addSharedObject(SERVICE_NAME, PamAuthentication(SERVICE_NAME, self))
@classmethod
def serviceName(self):
return SERVICE_NAME
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