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
6386e068
Commit
6386e068
authored
Feb 01, 2011
by
Devaev Maxim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactoring, fixed groupsChanged() signal
parent
0078b855
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
fmod_local_groups.py
plugins/functions/fmod_local_groups.py
+9
-8
No files found.
plugins/functions/fmod_local_groups.py
View file @
6386e068
...
@@ -65,16 +65,16 @@ class LocalGroup(service.FunctionObject) :
...
@@ -65,16 +65,16 @@ class LocalGroup(service.FunctionObject) :
return
tools
.
process
.
execProcess
(
"
%
s -G
%
s
%
s"
%
(
config
.
value
(
SERVICE_NAME
,
"usermod_prog_path"
),
return
tools
.
process
.
execProcess
(
"
%
s -G
%
s
%
s"
%
(
config
.
value
(
SERVICE_NAME
,
"usermod_prog_path"
),
","
.
join
(
users_list
),
user_name
),
False
)[
2
]
","
.
join
(
users_list
),
user_name
),
False
)[
2
]
@service.functionMethod
(
LOCAL_GROUP_METHODS_NAMESPACE
,
out_signature
=
"as"
)
def
users
(
self
)
:
return
grp
.
getgrnam
(
self
.
__group_name
)
.
gr_mem
###
###
@service.functionMethod
(
LOCAL_GROUP_METHODS_NAMESPACE
,
out_signature
=
"i"
)
@service.functionMethod
(
LOCAL_GROUP_METHODS_NAMESPACE
,
out_signature
=
"i"
)
def
gid
(
self
)
:
def
gid
(
self
)
:
return
grp
.
getgrnam
(
self
.
__group_name
)
.
gr_gid
return
grp
.
getgrnam
(
self
.
__group_name
)
.
gr_gid
@service.functionMethod
(
LOCAL_GROUP_METHODS_NAMESPACE
,
out_signature
=
"as"
)
def
users
(
self
)
:
return
grp
.
getgrnam
(
self
.
__group_name
)
.
gr_mem
class
LocalGroups
(
service
.
FunctionObject
)
:
class
LocalGroups
(
service
.
FunctionObject
)
:
...
@@ -83,12 +83,11 @@ class LocalGroups(service.FunctionObject) :
...
@@ -83,12 +83,11 @@ class LocalGroups(service.FunctionObject) :
@service.functionMethod
(
LOCAL_GROUPS_METHODS_NAMESPACE
,
in_signature
=
"si"
,
out_signature
=
"i"
)
@service.functionMethod
(
LOCAL_GROUPS_METHODS_NAMESPACE
,
in_signature
=
"si"
,
out_signature
=
"i"
)
def
addGroup
(
self
,
group_name
,
gid
)
:
def
addGroup
(
self
,
group_name
,
gid
)
:
group_name
=
validators
.
os
.
validGroupName
(
group_name
)
group_name
=
validators
.
os
.
validGroupName
(
group_name
)
(
gid_arg
,
gid_str
)
=
(
(
"-g
%
d"
%
(
gid
),
str
(
gid
))
if
gid
>=
0
else
(
""
,
"auto"
)
)
proc_args
=
"
%
s
%
s"
%
(
config
.
value
(
SERVICE_NAME
,
"groupadd_prog_path"
),
group_name
)
logger
.
verbose
(
"{mod}: Request to add UNIX group
\"
%
s
\"
with gid=
%
s"
%
(
group_name
,
gid_str
))
proc_args
+=
(
" -g
%
d"
%
(
gid
)
if
gid
>=
0
else
""
)
logger
.
verbose
(
"{mod}: Request to add UNIX group
\"
%
s
\"
with gid
%
d"
%
(
group_name
,
gid
))
return
tools
.
process
.
execProcess
(
"
%
s
%
s
%
s"
%
(
config
.
value
(
SERVICE_NAME
,
"groupadd_prog_path"
),
gid_arg
,
group_name
))
return
tools
.
process
.
execProcess
(
proc_args
,
False
)[
2
]
@service.functionMethod
(
LOCAL_GROUPS_METHODS_NAMESPACE
,
in_signature
=
"s"
,
out_signature
=
"i"
)
@service.functionMethod
(
LOCAL_GROUPS_METHODS_NAMESPACE
,
in_signature
=
"s"
,
out_signature
=
"i"
)
def
removeGroup
(
self
,
group_name
)
:
def
removeGroup
(
self
,
group_name
)
:
...
@@ -186,6 +185,8 @@ class Service(service.Service, pyinotify.ThreadedNotifier) :
...
@@ -186,6 +185,8 @@ class Service(service.Service, pyinotify.ThreadedNotifier) :
local_groups_shared
.
removeSharedObject
(
dbus_group_name
)
local_groups_shared
.
removeSharedObject
(
dbus_group_name
)
logger
.
verbose
(
"{mod}: Removed UNIX group
\"
%
s
\"
"
%
(
group_name
))
logger
.
verbose
(
"{mod}: Removed UNIX group
\"
%
s
\"
"
%
(
group_name
))
self
.
__local_groups
.
groupsChanged
()
###
###
def
localGroups
(
self
)
:
def
localGroups
(
self
)
:
...
...
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