Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
settingsd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
settingsd
Commits
af9967f5
Commit
af9967f5
authored
Jan 29, 2019
by
Дмитрий Никулин
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add pam_authentication module
parent
de464448
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
36 additions
and
3 deletions
+36
-3
settingsd-altlinux.spec
.gear/settingsd-altlinux.spec
+1
-1
org.etersoft.settingsd.conf
configs/dbus/org.etersoft.settingsd.conf
+5
-0
main.conf
configs/settingsd/main.conf
+3
-0
fmod_pam_authentication.py
plugins/functions/fmod_pam_authentication.py
+25
-0
fmod_system_services.py
plugins/functions/fmod_system_services.py
+1
-1
process.py
settingsd/tools/process.py
+1
-1
No files found.
.gear/settingsd-altlinux.spec
View file @
af9967f5
...
...
@@ -10,7 +10,7 @@ Packager: Devaev Maxim <mdevaev@etersoft.ru>
Source: %name-%version.tar
BuildArch: noarch
BuildRequires: python-dev
Requires: python
-module-dbus, python
-module-pyinotify
Requires: python
3-module-dbus, python3-module-pam, python3
-module-pyinotify
Requires: chkconfig, service, SysVinit, pm-utils, lsb-release, hwclock
%description
Extensible service to control the operating system via D-Bus.
...
...
configs/dbus/org.etersoft.settingsd.conf
View file @
af9967f5
...
...
@@ -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
>
...
...
configs/settingsd/main.conf
View file @
af9967f5
...
...
@@ -27,3 +27,6 @@ enabled = yes
[
date_time
]
enabled
=
yes
[
pam_authentication
]
enabled
=
yes
plugins/functions/fmod_pam_authentication.py
0 → 100644
View file @
af9967f5
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
plugins/functions/fmod_system_services.py
View file @
af9967f5
...
...
@@ -92,7 +92,7 @@ class SystemService(service.FunctionObject) :
@service.functionMethod
(
SYSTEM_SERVICE_METHODS_NAMESPACE
,
out_signature
=
"i"
)
def
status
(
self
)
:
proc_args_list
=
[
os
.
path
.
join
(
config
.
value
(
SERVICE_NAME
,
"initd_dir"
),
self
.
__system_service_name
)
,
"status"
]
proc_args_list
=
[
"serv"
,
self
.
__system_service_name
,
"status"
]
return
tools
.
process
.
execProcess
(
proc_args_list
,
fatal_flag
=
False
)[
2
]
...
...
settingsd/tools/process.py
View file @
af9967f5
...
...
@@ -16,7 +16,7 @@ class SubprocessFailure(Exception) :
def
execProcess
(
proc_args_list
,
proc_input
=
None
,
fatal_flag
=
True
,
confidential_input_flag
=
False
)
:
logger
.
debug
(
"{submod}: Executing child process
\"
%
s
\"
"
%
(
str
(
proc_args_list
)))
proc
=
subprocess
.
Popen
(
proc_args_list
,
shell
=
True
,
bufsize
=
1024
,
close_fds
=
True
,
proc
=
subprocess
.
Popen
(
proc_args_list
,
bufsize
=
1024
,
close_fds
=
True
,
stdin
=
subprocess
.
PIPE
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
,
env
=
{
"LC_ALL"
:
"C"
})
(
proc_stdout
,
proc_stderr
)
=
proc
.
communicate
(
proc_input
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment