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
7e40a715
Commit
7e40a715
authored
Feb 02, 2011
by
Devaev Maxim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setGid() for fmod_local_groups
parent
5dc7c918
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
6 deletions
+17
-6
fmod_local_groups.py
plugins/functions/fmod_local_groups.py
+17
-6
No files found.
plugins/functions/fmod_local_groups.py
View file @
7e40a715
...
@@ -46,6 +46,22 @@ class LocalGroup(service.FunctionObject) :
...
@@ -46,6 +46,22 @@ class LocalGroup(service.FunctionObject) :
###
###
@service.functionMethod
(
LOCAL_GROUP_METHODS_NAMESPACE
,
in_signature
=
"i"
,
out_signature
=
"i"
)
def
setGid
(
self
,
gid
)
:
if
gid
<
0
:
raise
validators
.
ValidatorError
(
"Incorrect GID
%
d"
%
(
gid
))
logger
.
verbose
(
"{mod}: Request to change gid for local group
\"
%
s
\"
, new gid=
%
d"
%
(
self
.
__group_name
,
gid
))
return
tools
.
process
.
execProcess
(
"
%
s -g
%
d
%
s"
%
(
config
.
value
(
SERVICE_NAME
,
"groupmod_prog_path"
),
gid
,
self
.
__group_name
),
False
)[
2
]
@service.functionMethod
(
LOCAL_GROUP_METHODS_NAMESPACE
,
out_signature
=
"i"
)
def
gid
(
self
)
:
return
grp
.
getgrnam
(
self
.
__group_name
)
.
gr_gid
###
@service.functionMethod
(
LOCAL_GROUP_METHODS_NAMESPACE
,
in_signature
=
"s"
,
out_signature
=
"i"
)
@service.functionMethod
(
LOCAL_GROUP_METHODS_NAMESPACE
,
in_signature
=
"s"
,
out_signature
=
"i"
)
def
addUser
(
self
,
user_name
)
:
def
addUser
(
self
,
user_name
)
:
user_name
=
validators
.
os
.
validUserName
(
user_name
)
user_name
=
validators
.
os
.
validUserName
(
user_name
)
...
@@ -69,12 +85,6 @@ class LocalGroup(service.FunctionObject) :
...
@@ -69,12 +85,6 @@ class LocalGroup(service.FunctionObject) :
def
users
(
self
)
:
def
users
(
self
)
:
return
grp
.
getgrnam
(
self
.
__group_name
)
.
gr_mem
return
grp
.
getgrnam
(
self
.
__group_name
)
.
gr_mem
###
@service.functionMethod
(
LOCAL_GROUP_METHODS_NAMESPACE
,
out_signature
=
"i"
)
def
gid
(
self
)
:
return
grp
.
getgrnam
(
self
.
__group_name
)
.
gr_gid
class
LocalGroups
(
service
.
FunctionObject
)
:
class
LocalGroups
(
service
.
FunctionObject
)
:
...
@@ -156,6 +166,7 @@ class Service(service.Service, pyinotify.ThreadedNotifier) :
...
@@ -156,6 +166,7 @@ class Service(service.Service, pyinotify.ThreadedNotifier) :
return
[
return
[
(
SERVICE_NAME
,
"groupadd_prog_path"
,
"/usr/sbin/groupadd"
,
str
),
(
SERVICE_NAME
,
"groupadd_prog_path"
,
"/usr/sbin/groupadd"
,
str
),
(
SERVICE_NAME
,
"groupdel_prog_path"
,
"/usr/sbin/groupdel"
,
str
),
(
SERVICE_NAME
,
"groupdel_prog_path"
,
"/usr/sbin/groupdel"
,
str
),
(
SERVICE_NAME
,
"groupmod_prog_path"
,
"/usr/sbin/groupmod"
,
str
),
(
SERVICE_NAME
,
"usermod_prog_path"
,
"/usr/sbin/usermod"
,
str
),
(
SERVICE_NAME
,
"usermod_prog_path"
,
"/usr/sbin/usermod"
,
str
),
(
SERVICE_NAME
,
"group_config_file_path"
,
"/etc/group"
,
str
)
(
SERVICE_NAME
,
"group_config_file_path"
,
"/etc/group"
,
str
)
]
]
...
...
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